fix misuse of constants in KE2Message
This commit is contained in:
+2
-3
@@ -9,7 +9,6 @@
|
||||
use crate::group::Group;
|
||||
use curve25519_dalek::{edwards::EdwardsPoint, ristretto::RistrettoPoint};
|
||||
|
||||
use generic_array::GenericArray;
|
||||
use hkdf::Hkdf;
|
||||
use sha2::{Sha256, Sha512};
|
||||
|
||||
@@ -22,13 +21,13 @@ pub trait GroupWithMapToCurve: Group {
|
||||
impl GroupWithMapToCurve for RistrettoPoint {
|
||||
fn map_to_curve(password: &[u8], pepper: Option<&[u8]>) -> Self {
|
||||
let (hashed_input, _) = Hkdf::<Sha512>::extract(pepper, password);
|
||||
<Self as Group>::hash_to_curve(GenericArray::from_slice(&hashed_input))
|
||||
<Self as Group>::hash_to_curve(&hashed_input)
|
||||
}
|
||||
}
|
||||
|
||||
impl GroupWithMapToCurve for EdwardsPoint {
|
||||
fn map_to_curve(password: &[u8], pepper: Option<&[u8]>) -> Self {
|
||||
let (hashed_input, _) = Hkdf::<Sha256>::extract(pepper, password);
|
||||
<Self as Group>::hash_to_curve(GenericArray::from_slice(&hashed_input))
|
||||
<Self as Group>::hash_to_curve(&hashed_input)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user