Start integrating the derivable SizedBytes

- just derive it on Key and KeyPair for now
This commit is contained in:
François Garillot
2020-11-03 16:45:37 -05:00
parent 3954cd23b8
commit 230b1bcef6
10 changed files with 84 additions and 100 deletions
+5 -4
View File
@@ -15,7 +15,7 @@ use crate::{
group::Group,
hash::Hash,
key_exchange::traits::{KeyExchange, ToBytes},
keypair::{KeyPair, SizedBytes},
keypair::{KeyPair, SizedBytesExt},
oprf,
serialization::{
serialize, tokenize, u8_to_credential_type, CredentialType, ProtocolMessageType,
@@ -23,6 +23,7 @@ use crate::{
slow_hash::SlowHash,
};
use generic_array::{typenum::Unsigned, GenericArray};
use generic_bytes::SizedBytes;
use rand_core::{CryptoRng, RngCore};
use std::collections::HashMap;
use std::{convert::TryFrom, marker::PhantomData};
@@ -640,7 +641,7 @@ impl<CS: CipherSuite> ClientRegistration<CS> {
/// # Example
///
/// ```
/// use opaque_ke::{opaque::{ClientRegistration, ServerRegistration}, keypair::{X25519KeyPair, SizedBytes}};
/// use opaque_ke::{opaque::{ClientRegistration, ServerRegistration}, keypair::X25519KeyPair};
/// # use opaque_ke::errors::ProtocolError;
/// # use opaque_ke::keypair::KeyPair;
/// use rand_core::{OsRng, RngCore};
@@ -822,7 +823,7 @@ where
/// # Example
///
/// ```
/// use opaque_ke::{opaque::*, keypair::{X25519KeyPair, SizedBytes}};
/// use opaque_ke::{opaque::*, keypair::X25519KeyPair};
/// # use opaque_ke::errors::ProtocolError;
/// use rand_core::{OsRng, RngCore};
/// use opaque_ke::ciphersuite::CipherSuite;
@@ -898,7 +899,7 @@ where
/// # Example
///
/// ```
/// use opaque_ke::{opaque::*, keypair::{KeyPair, X25519KeyPair, SizedBytes}};
/// use opaque_ke::{opaque::*, keypair::{KeyPair, X25519KeyPair}};
/// # use opaque_ke::errors::ProtocolError;
/// use rand_core::{OsRng, RngCore};
/// use opaque_ke::ciphersuite::CipherSuite;