Adding CipherSuite trait to handle bundling of underlying crypto primitives

This commit is contained in:
Kevin Lewi
2020-06-14 23:29:25 -07:00
parent 0cf13c2266
commit ab1b1d6209
+2 -7
View File
@@ -52,10 +52,7 @@ fn server_registration_roundtrip() {
let sc = <RistrettoPoint as Group>::random_scalar(&mut rng);
let mut oprf_bytes: Vec<u8> = vec![];
oprf_bytes.extend_from_slice(sc.as_bytes());
let reg = ServerRegistration::<Default>::try_from(
&oprf_bytes[..],
)
.unwrap();
let reg = ServerRegistration::<Default>::try_from(&oprf_bytes[..]).unwrap();
let reg_bytes = reg.to_bytes();
assert_eq!(reg_bytes, oprf_bytes);
// If we do have envelope and client pk, the server registration contains
@@ -70,9 +67,7 @@ fn server_registration_roundtrip() {
bytes.extend_from_slice(sc.as_bytes());
bytes.extend_from_slice(&mock_client_kp.public().to_arr());
bytes.extend_from_slice(&mock_rkr_bytes);
let reg =
ServerRegistration::<Default>::try_from(&bytes[..])
.unwrap();
let reg = ServerRegistration::<Default>::try_from(&bytes[..]).unwrap();
let reg_bytes = reg.to_bytes();
assert_eq!(reg_bytes, bytes);
}