diff --git a/src/lib.rs b/src/lib.rs index 6b37bc8..178ecbd 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -340,7 +340,7 @@ //! let messages: Vec<_> = messages.collect(); //! ``` //! -//! If [`alloc`] is available, [VoprfServer::batch_evaluate] can be called +//! If `alloc` is available, [VoprfServer::batch_evaluate] can be called //! to avoid having to collect output manually: //! //! ``` @@ -432,7 +432,7 @@ //! //! # Features //! -//! - The `alloc` feature requires Rusts [`alloc`] crate and enables batching +//! - The `alloc` feature requires Rust's `alloc` crate and enables batching //! VOPRF evaluations. //! //! - The `serde` feature, enabled by default, provides convenience functions diff --git a/src/tests/test_cfrg_vectors.rs b/src/tests/test_cfrg_vectors.rs index e8583bd..9322e24 100644 --- a/src/tests/test_cfrg_vectors.rs +++ b/src/tests/test_cfrg_vectors.rs @@ -131,23 +131,29 @@ fn test_vectors() -> Result<()> { test_poprf_finalize::(&ristretto_poprf_tvs)?; } - let p256base_tvs = + let p256_oprf_tvs = json_to_test_vectors!(rfc, String::from("P-256, SHA-256"), String::from("OPRF")); - assert_ne!(p256base_tvs.len(), 0); + assert_ne!(p256_oprf_tvs.len(), 0); + test_oprf_seed_to_key::(&p256_oprf_tvs)?; + test_oprf_blind::(&p256_oprf_tvs)?; + test_oprf_evaluate::(&p256_oprf_tvs)?; + test_oprf_finalize::(&p256_oprf_tvs)?; - let p256verifiable_tvs = + let p256_voprf_tvs = json_to_test_vectors!(rfc, String::from("P-256, SHA-256"), String::from("VOPRF")); - assert_ne!(p256verifiable_tvs.len(), 0); + assert_ne!(p256_voprf_tvs.len(), 0); + test_voprf_seed_to_key::(&p256_voprf_tvs)?; + test_voprf_blind::(&p256_voprf_tvs)?; + test_voprf_evaluate::(&p256_voprf_tvs)?; + test_voprf_finalize::(&p256_voprf_tvs)?; - test_oprf_seed_to_key::(&p256base_tvs)?; - test_oprf_blind::(&p256base_tvs)?; - test_oprf_evaluate::(&p256base_tvs)?; - test_oprf_finalize::(&p256base_tvs)?; - - test_voprf_seed_to_key::(&p256verifiable_tvs)?; - test_voprf_blind::(&p256verifiable_tvs)?; - test_voprf_evaluate::(&p256verifiable_tvs)?; - test_voprf_finalize::(&p256verifiable_tvs)?; + let p256_poprf_tvs = + json_to_test_vectors!(rfc, String::from("P-256, SHA-256"), String::from("POPRF")); + assert_ne!(p256_poprf_tvs.len(), 0); + test_poprf_seed_to_key::(&p256_poprf_tvs)?; + test_poprf_blind::(&p256_poprf_tvs)?; + test_poprf_evaluate::(&p256_poprf_tvs)?; + test_poprf_finalize::(&p256_poprf_tvs)?; Ok(()) }