Implement client_mac_key test

This commit is contained in:
dAxpeDDa
2021-07-30 14:45:27 -07:00
committed by Kevin Lewi
parent ec528eb4d9
commit 3f6b6d4afe
4 changed files with 21 additions and 1 deletions
+6
View File
@@ -67,6 +67,7 @@ pub struct TestVectorParameters {
pub randomized_pwd: Vec<u8>,
pub handshake_secret: Vec<u8>,
pub server_mac_key: Vec<u8>,
pub client_mac_key: Vec<u8>,
}
// Pulled from "OPAQUE-3DH Test Vector 1" and "OPAQUE-3DH Test Vector 6"
@@ -490,6 +491,7 @@ fn populate_test_vectors(values: &Value) -> TestVectorParameters {
randomized_pwd: parse!(values, "randomized_pwd"),
handshake_secret: parse!(values, "handshake_secret"),
server_mac_key: parse!(values, "server_mac_key"),
client_mac_key: parse!(values, "client_mac_key"),
}
}
@@ -706,6 +708,10 @@ fn test_ke3() -> Result<(), ProtocolError> {
hex::encode(&parameters.handshake_secret),
hex::encode(&client_login_finish_result.handshake_secret)
);
assert_eq!(
hex::encode(&parameters.client_mac_key),
hex::encode(&client_login_finish_result.client_mac_key)
);
assert_eq!(
hex::encode(&parameters.KE3),
hex::encode(client_login_finish_result.message.serialize())