// M1 = H(H(N) XOR H(g) | H(U) | s | A | B | K)
pub fn compute_m1<D: Digest>(
params: &SrpGroup,
+ identity_hash: &[u8],
+ salt: &[u8],
a_pub: &[u8],
b_pub: &[u8],
key: &[u8],
let mut d = D::new();
d.update(ng_xor);
+ d.update(identity_hash);
+ d.update(salt);
d.update(a_pub);
d.update(b_pub);
d.update(key);
// M2 = H(A, M1, K)
pub fn compute_m2<D: Digest>(a_pub: &[u8], m1: &Output<D>, key: &[u8]) -> Output<D> {
let mut d = D::new();
- d.update(&a_pub);
- d.update(&m1);
- d.update(&key);
+ d.update(a_pub);
+ d.update(m1);
+ d.update(key);
d.finalize()
}