Updating test vectors to RFC 9807 (#386)

* Updating to RFC 9807

* Update CHANGELOG.md

Co-authored-by: daxpedda <[email protected]>

* Update CHANGELOG.md

Co-authored-by: daxpedda <[email protected]>

* Update CHANGELOG.md

Co-authored-by: daxpedda <[email protected]>

---------

Co-authored-by: daxpedda <[email protected]>
This commit is contained in:
Kevin Lewi
2025-09-08 11:27:47 -07:00
committed by GitHub
co-authored by daxpedda
parent 8f9d7ec125
commit 226fe0ea7a
8 changed files with 853 additions and 888 deletions
+13 -1
View File
@@ -182,7 +182,7 @@ macro_rules! json_to_test_vectors {
#[test]
fn tests() -> Result<(), ProtocolError> {
let rfc: Value =
serde_json::from_str(super::parser::rfc_to_json(super::opaque_vectors::VECTORS).as_str())
serde_json::from_str(super::parser::rfc_to_json(super::rfc9807_vectors::VECTORS).as_str())
.expect("Could not parse json");
#[cfg(feature = "ristretto255")]
@@ -213,6 +213,10 @@ fn tests() -> Result<(), ProtocolError> {
"Parsing error"
);
// There should be 2 real test vectors and 1 fake test vector
assert_eq!(ristretto_real_tvs.len(), 2);
assert_eq!(ristretto_fake_tvs.len(), 1);
test_registration_request::<Ristretto255Sha512NoKsf>(&ristretto_real_tvs)?;
test_registration_response::<Ristretto255Sha512NoKsf>(&ristretto_real_tvs)?;
test_registration_upload::<Ristretto255Sha512NoKsf>(&ristretto_real_tvs)?;
@@ -251,6 +255,10 @@ fn tests() -> Result<(), ProtocolError> {
"Parsing error"
);
// There should be 2 real test vectors and 1 fake test vector
assert_eq!(ristretto_real_tvs.len(), 2);
assert_eq!(ristretto_fake_tvs.len(), 1);
test_registration_request::<Ristretto255Sha512Curve25519NoKsf>(&ristretto_real_tvs)?;
test_registration_response::<Ristretto255Sha512Curve25519NoKsf>(&ristretto_real_tvs)?;
test_registration_upload::<Ristretto255Sha512Curve25519NoKsf>(&ristretto_real_tvs)?;
@@ -286,6 +294,10 @@ fn tests() -> Result<(), ProtocolError> {
"Parsing error"
);
// There should be 2 real test vectors and 1 fake test vector
assert_eq!(p256_real_tvs.len(), 2);
assert_eq!(p256_fake_tvs.len(), 1);
test_registration_request::<P256Sha256NoKsf>(&p256_real_tvs)?;
test_registration_response::<P256Sha256NoKsf>(&p256_real_tvs)?;
test_registration_upload::<P256Sha256NoKsf>(&p256_real_tvs)?;