Update keypair generation to use derive_auth_keypair (#326)

This commit is contained in:
Kevin Lewi
2023-05-27 17:39:04 -05:00
committed by GitHub
parent c73eb963db
commit deb7ca3dc0
11 changed files with 582 additions and 566 deletions
-1
View File
@@ -68,7 +68,6 @@ impl KeGroup for Curve25519 {
fn derive_auth_keypair<CS: voprf::CipherSuite>(
seed: GenericArray<u8, Self::SkLen>,
_info: &[u8],
) -> Result<Self::Sk, InternalError>
where
<CS::Hash as OutputSizeUser>::OutputSize:
+3 -1
View File
@@ -24,6 +24,8 @@ use zeroize::Zeroize;
use crate::errors::InternalError;
const STR_OPAQUE_DERIVE_AUTH_KEY_PAIR: [u8; 33] = *b"OPAQUE-DeriveDiffieHellmanKeyPair";
/// A group representation for use in the key exchange
pub trait KeGroup {
/// Public key
@@ -62,12 +64,12 @@ pub trait KeGroup {
/// opposed to the OprfGroup).
fn derive_auth_keypair<CS: voprf::CipherSuite>(
seed: GenericArray<u8, Self::SkLen>,
info: &[u8],
) -> Result<Self::Sk, InternalError>
where
<CS::Hash as OutputSizeUser>::OutputSize:
IsLess<U256> + IsLessOrEqual<<CS::Hash as BlockSizeUser>::BlockSize>,
{
let info = &STR_OPAQUE_DERIVE_AUTH_KEY_PAIR;
let dst_1 = GenericArray::from(STR_DERIVE_KEYPAIR)
.concat(STR_OPRF.into())
.concat([voprf::Mode::Oprf.to_u8()].into())