refactor file struct
This commit is contained in:
1
src/models/mod.rs
Normal file
1
src/models/mod.rs
Normal file
@@ -0,0 +1 @@
|
||||
pub mod opaque;
|
||||
36
src/models/opaque.rs
Normal file
36
src/models/opaque.rs
Normal file
@@ -0,0 +1,36 @@
|
||||
use opaque_ke::{Ristretto255, TripleDh, ServerSetup, CredentialResponse, RegistrationUploadLen, RegistrationResponse};
|
||||
use opaque_ke::keypair::{OprfSeed, PrivateKey};
|
||||
use sha2::Sha512;
|
||||
use opaque_ke::CipherSuite;
|
||||
use opaque_ke::argon2::Argon2;
|
||||
use opaque_ke::generic_array::GenericArray;
|
||||
use uuid::Uuid;
|
||||
|
||||
pub const NONCE_SIZE: usize = 12;
|
||||
pub const SESSION_KEY_SIZE: usize = 32;
|
||||
pub const SECRET_KEY_SIZE: usize = 16;
|
||||
|
||||
pub struct NKodeCipherSuite;
|
||||
|
||||
impl CipherSuite for NKodeCipherSuite {
|
||||
type OprfCs = Ristretto255;
|
||||
type KeyExchange = TripleDh<Ristretto255, Sha512>;
|
||||
type Ksf = Argon2<'static>;
|
||||
}
|
||||
|
||||
pub type NKodeServerSetup = ServerSetup<NKodeCipherSuite, PrivateKey<Ristretto255>, OprfSeed<Sha512>>;
|
||||
|
||||
|
||||
pub type PasswordFile = GenericArray<u8, RegistrationUploadLen<NKodeCipherSuite>>;
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub struct LoginSession {
|
||||
pub response: CredentialResponse<NKodeCipherSuite>,
|
||||
pub session_id: Uuid
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub struct RegisterSession {
|
||||
pub response: RegistrationResponse<NKodeCipherSuite>,
|
||||
pub session_id: Uuid
|
||||
}
|
||||
Reference in New Issue
Block a user