/// v is the provided during initial user registration
pub fn process_reply(
&self,
+ username: &str,
b: &[u8],
v: &[u8],
a_pub: &[u8],
let u = compute_u::<D>(&a_pub.to_bytes_be(), &b_pub.to_bytes_be());
+ let mut d = D::new();
+ d.update(username);
+ let identity_hash = d.finalize();
+
let key = self.compute_premaster_secret(&a_pub, &v, &u, &b);
let m1 = compute_m1::<D>(
self.params,
+ identity_hash.as_slice(),
&a_pub.to_bytes_be(),
&b_pub.to_bytes_be(),
&key.to_bytes_be(),
// M1 = H(H(N) XOR H(g) | H(U) | s | A | B | K)
pub fn compute_m1<D: Digest>(
params: &SrpGroup,
+ identity_hash: &[u8],
a_pub: &[u8],
b_pub: &[u8],
key: &[u8],
let mut d = D::new();
d.update(ng_xor);
+ d.update(identity_hash);
d.update(a_pub);
d.update(b_pub);
d.update(key);