chore: bump to 0.7.0-pre.0, new ciphersuite impl (#2)
Rust CI / cargo fmt (push) Successful in 3s
Rust CI / cargo clippy (push) Successful in 28s
Rust CI / test (1.87.0 / no backend / no frontend) (push) Successful in 1m24s
Rust CI / test (stable / no backend / no frontend) (push) Successful in 1m18s
Rust CI / test (1.87.0 / no backend / --features danger) (push) Successful in 1m23s
Rust CI / test (stable / no backend / --features danger) (push) Successful in 1m17s
Rust CI / test (1.87.0 / no backend / --features serde) (push) Successful in 1m27s
Rust CI / test (stable / no backend / --features serde) (push) Successful in 1m18s
Rust CI / test (1.87.0 / --features ristretto255-ciphersuite / no frontend) (push) Successful in 1m34s
Rust CI / test (stable / --features ristretto255-ciphersuite / no frontend) (push) Successful in 1m29s
Rust CI / test (1.87.0 / --features ristretto255-ciphersuite / --features danger) (push) Successful in 1m34s
Rust CI / test (stable / --features ristretto255-ciphersuite / --features danger) (push) Successful in 1m30s
Rust CI / test (1.87.0 / --features ristretto255-ciphersuite / --features serde) (push) Successful in 1m36s
Rust CI / test (stable / --features ristretto255-ciphersuite / --features serde) (push) Successful in 1m27s
Rust CI / cargo audit (push) Successful in 5s
Rust CI / no-std (thumbv6m-none-eabi / no backend) (push) Successful in 13s
Rust CI / no-std (wasm32-unknown-unknown / no backend) (push) Successful in 14s
Rust CI / no-std (wasm32-unknown-unknown / --features ristretto255-ciphersuite) (push) Successful in 14s
Rust CI / no-std (thumbv6m-none-eabi / --features ristretto255-ciphersuite) (push) Successful in 13s
Rust CI / cargo fmt (push) Successful in 3s
Rust CI / cargo clippy (push) Successful in 28s
Rust CI / test (1.87.0 / no backend / no frontend) (push) Successful in 1m24s
Rust CI / test (stable / no backend / no frontend) (push) Successful in 1m18s
Rust CI / test (1.87.0 / no backend / --features danger) (push) Successful in 1m23s
Rust CI / test (stable / no backend / --features danger) (push) Successful in 1m17s
Rust CI / test (1.87.0 / no backend / --features serde) (push) Successful in 1m27s
Rust CI / test (stable / no backend / --features serde) (push) Successful in 1m18s
Rust CI / test (1.87.0 / --features ristretto255-ciphersuite / no frontend) (push) Successful in 1m34s
Rust CI / test (stable / --features ristretto255-ciphersuite / no frontend) (push) Successful in 1m29s
Rust CI / test (1.87.0 / --features ristretto255-ciphersuite / --features danger) (push) Successful in 1m34s
Rust CI / test (stable / --features ristretto255-ciphersuite / --features danger) (push) Successful in 1m30s
Rust CI / test (1.87.0 / --features ristretto255-ciphersuite / --features serde) (push) Successful in 1m36s
Rust CI / test (stable / --features ristretto255-ciphersuite / --features serde) (push) Successful in 1m27s
Rust CI / cargo audit (push) Successful in 5s
Rust CI / no-std (thumbv6m-none-eabi / no backend) (push) Successful in 13s
Rust CI / no-std (wasm32-unknown-unknown / no backend) (push) Successful in 14s
Rust CI / no-std (wasm32-unknown-unknown / --features ristretto255-ciphersuite) (push) Successful in 14s
Rust CI / no-std (thumbv6m-none-eabi / --features ristretto255-ciphersuite) (push) Successful in 13s
Reviewed-on: vexahub/voprf-vexahub#2 Co-authored-by: UneBaguette <[email protected]> Co-committed-by: UneBaguette <[email protected]>
This commit was merged in pull request #2.
This commit is contained in:
+2
-1
@@ -1,7 +1,8 @@
|
||||
# Changelog
|
||||
|
||||
## 0.6.0-rc.0 (June 27, 2026)
|
||||
## 0.7.0-pre.0 (June 28, 2026)
|
||||
* MSRV bumped to 1.87
|
||||
* `CipherSuite` no longer has a blanket impl via `VoprfParameters`; use `Suite<G, H>` instead (breaking change)
|
||||
* Migrated from `elliptic-curve 0.13` to `0.14`
|
||||
* Replaced `generic-array` with `hybrid-array`
|
||||
* Updated `digest` dependency to 0.11
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ name = "voprf-vexahub"
|
||||
readme = "README.md"
|
||||
repository = "https://github.com/facebook/voprf/"
|
||||
rust-version = "1.87"
|
||||
version = "0.6.0-rc.0"
|
||||
version = "0.7.0-pre.0"
|
||||
|
||||
[features]
|
||||
alloc = []
|
||||
|
||||
@@ -13,6 +13,7 @@ use core::ops::Mul;
|
||||
use digest::block_api::BlockSizeUser;
|
||||
use digest::typenum::{IsLess, IsLessOrEqual, U256};
|
||||
use digest::{Digest, FixedOutput, HashMarker, OutputSizeUser};
|
||||
use hash2curve::OprfParameters;
|
||||
use hybrid_array::ArraySize;
|
||||
use hybrid_array::typenum::{IsGreaterOrEqual, Prod, True, U2};
|
||||
|
||||
@@ -37,3 +38,23 @@ where
|
||||
/// transcripts).
|
||||
type Hash: Digest + BlockSizeUser + Default + FixedOutput + HashMarker;
|
||||
}
|
||||
|
||||
/// A generic [`CipherSuite`] implementation for any compatible (Group, Hash) pair
|
||||
#[allow(dead_code)]
|
||||
#[derive(Debug)]
|
||||
pub struct Suite<G, H>(core::marker::PhantomData<(G, H)>);
|
||||
|
||||
impl<G, H> CipherSuite for Suite<G, H>
|
||||
where
|
||||
G: Group + OprfParameters,
|
||||
H: BlockSizeUser + Default + FixedOutput + HashMarker + OutputSizeUser,
|
||||
<G as Group>::SecurityLevel: Mul<U2>,
|
||||
<H as OutputSizeUser>::OutputSize: ArraySize
|
||||
+ IsLess<U256>
|
||||
+ IsLessOrEqual<<H as BlockSizeUser>::BlockSize, Output = True>
|
||||
+ IsGreaterOrEqual<Prod<<G as Group>::SecurityLevel, U2>, Output = True>,
|
||||
{
|
||||
const ID: &'static [u8] = G::ID;
|
||||
type Group = G;
|
||||
type Hash = H;
|
||||
}
|
||||
|
||||
+3
-11
@@ -566,21 +566,13 @@ mod voprf;
|
||||
#[cfg(test)]
|
||||
mod tests;
|
||||
|
||||
/// A [`CipherSuite`] using P-256 and SHA-256, exposed for doctests.
|
||||
#[cfg(feature = "doctest")]
|
||||
#[derive(Debug)]
|
||||
#[doc(hidden)]
|
||||
pub struct P256CipherSuite;
|
||||
|
||||
#[cfg(feature = "doctest")]
|
||||
impl CipherSuite for P256CipherSuite {
|
||||
const ID: &'static [u8] = b"P256-SHA256";
|
||||
type Group = p256::NistP256;
|
||||
type Hash = sha2::Sha256;
|
||||
}
|
||||
pub type P256CipherSuite = Suite<p256::NistP256, sha2::Sha256>;
|
||||
|
||||
// Exports
|
||||
|
||||
pub use crate::ciphersuite::CipherSuite;
|
||||
pub use crate::ciphersuite::{CipherSuite, Suite};
|
||||
#[cfg(feature = "danger")]
|
||||
pub use crate::common::derive_key;
|
||||
pub use crate::common::{
|
||||
|
||||
+16
-16
@@ -271,8 +271,8 @@ mod tests {
|
||||
use rand::rngs::SysRng;
|
||||
|
||||
use super::*;
|
||||
use crate::Group;
|
||||
use crate::common::{Dst, STR_HASH_TO_GROUP};
|
||||
use crate::{Group, Suite};
|
||||
|
||||
fn prf<CS: CipherSuite>(
|
||||
input: &[u8],
|
||||
@@ -393,26 +393,26 @@ mod tests {
|
||||
zeroize_oprf_server::<Ristretto255>();
|
||||
}
|
||||
|
||||
base_retrieval::<NistP256>();
|
||||
base_inversion_unsalted::<NistP256>();
|
||||
server_evaluate::<NistP256>();
|
||||
base_retrieval::<Suite<NistP256, sha2::Sha256>>();
|
||||
base_inversion_unsalted::<Suite<NistP256, sha2::Sha256>>();
|
||||
server_evaluate::<Suite<NistP256, sha2::Sha256>>();
|
||||
|
||||
zeroize_oprf_client::<NistP256>();
|
||||
zeroize_oprf_server::<NistP256>();
|
||||
zeroize_oprf_client::<Suite<NistP256, sha2::Sha256>>();
|
||||
zeroize_oprf_server::<Suite<NistP256, sha2::Sha256>>();
|
||||
|
||||
base_retrieval::<NistP384>();
|
||||
base_inversion_unsalted::<NistP384>();
|
||||
server_evaluate::<NistP384>();
|
||||
base_retrieval::<Suite<NistP384, sha2::Sha384>>();
|
||||
base_inversion_unsalted::<Suite<NistP384, sha2::Sha384>>();
|
||||
server_evaluate::<Suite<NistP384, sha2::Sha384>>();
|
||||
|
||||
zeroize_oprf_client::<NistP384>();
|
||||
zeroize_oprf_server::<NistP384>();
|
||||
zeroize_oprf_client::<Suite<NistP384, sha2::Sha384>>();
|
||||
zeroize_oprf_server::<Suite<NistP384, sha2::Sha384>>();
|
||||
|
||||
base_retrieval::<NistP521>();
|
||||
base_inversion_unsalted::<NistP521>();
|
||||
server_evaluate::<NistP521>();
|
||||
base_retrieval::<Suite<NistP521, sha2::Sha512>>();
|
||||
base_inversion_unsalted::<Suite<NistP521, sha2::Sha512>>();
|
||||
server_evaluate::<Suite<NistP521, sha2::Sha512>>();
|
||||
|
||||
zeroize_oprf_client::<NistP521>();
|
||||
zeroize_oprf_server::<NistP521>();
|
||||
zeroize_oprf_client::<Suite<NistP521, sha2::Sha512>>();
|
||||
zeroize_oprf_server::<Suite<NistP521, sha2::Sha512>>();
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
+16
-16
@@ -736,8 +736,8 @@ mod tests {
|
||||
use rand::rngs::SysRng;
|
||||
|
||||
use super::*;
|
||||
use crate::Group;
|
||||
use crate::common::STR_HASH_TO_GROUP;
|
||||
use crate::{Group, Suite};
|
||||
|
||||
fn prf<CS: CipherSuite>(
|
||||
input: &[u8],
|
||||
@@ -895,26 +895,26 @@ mod tests {
|
||||
zeroize_verifiable_server::<Ristretto255>();
|
||||
}
|
||||
|
||||
verifiable_retrieval::<NistP256>();
|
||||
verifiable_bad_public_key::<NistP256>();
|
||||
verifiable_server_evaluate::<NistP256>();
|
||||
verifiable_retrieval::<Suite<NistP256, sha2::Sha256>>();
|
||||
verifiable_bad_public_key::<Suite<NistP256, sha2::Sha256>>();
|
||||
verifiable_server_evaluate::<Suite<NistP256, sha2::Sha256>>();
|
||||
|
||||
zeroize_verifiable_client::<NistP256>();
|
||||
zeroize_verifiable_server::<NistP256>();
|
||||
zeroize_verifiable_client::<Suite<NistP256, sha2::Sha256>>();
|
||||
zeroize_verifiable_server::<Suite<NistP256, sha2::Sha256>>();
|
||||
|
||||
verifiable_retrieval::<NistP384>();
|
||||
verifiable_bad_public_key::<NistP384>();
|
||||
verifiable_server_evaluate::<NistP384>();
|
||||
verifiable_retrieval::<Suite<NistP384, sha2::Sha384>>();
|
||||
verifiable_bad_public_key::<Suite<NistP384, sha2::Sha384>>();
|
||||
verifiable_server_evaluate::<Suite<NistP384, sha2::Sha384>>();
|
||||
|
||||
zeroize_verifiable_client::<NistP384>();
|
||||
zeroize_verifiable_server::<NistP384>();
|
||||
zeroize_verifiable_client::<Suite<NistP384, sha2::Sha384>>();
|
||||
zeroize_verifiable_server::<Suite<NistP384, sha2::Sha384>>();
|
||||
|
||||
verifiable_retrieval::<NistP521>();
|
||||
verifiable_bad_public_key::<NistP521>();
|
||||
verifiable_server_evaluate::<NistP521>();
|
||||
verifiable_retrieval::<Suite<NistP521, sha2::Sha512>>();
|
||||
verifiable_bad_public_key::<Suite<NistP521, sha2::Sha512>>();
|
||||
verifiable_server_evaluate::<Suite<NistP521, sha2::Sha512>>();
|
||||
|
||||
zeroize_verifiable_client::<NistP521>();
|
||||
zeroize_verifiable_server::<NistP521>();
|
||||
zeroize_verifiable_client::<Suite<NistP521, sha2::Sha512>>();
|
||||
zeroize_verifiable_server::<Suite<NistP521, sha2::Sha512>>();
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -328,9 +328,9 @@ mod test {
|
||||
let _ = $item::<crate::Ristretto255>::deserialize(&$bytes[..]);
|
||||
}
|
||||
|
||||
let _ = $item::<p256::NistP256>::deserialize(&$bytes[..]);
|
||||
let _ = $item::<p384::NistP384>::deserialize(&$bytes[..]);
|
||||
let _ = $item::<p521::NistP521>::deserialize(&$bytes[..]);
|
||||
let _ = $item::<crate::Suite<p256::NistP256, sha2::Sha256>>::deserialize(&$bytes[..]);
|
||||
let _ = $item::<crate::Suite<p384::NistP384, sha2::Sha384>>::deserialize(&$bytes[..]);
|
||||
let _ = $item::<crate::Suite<p521::NistP521, sha2::Sha512>>::deserialize(&$bytes[..]);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -10,21 +10,3 @@ mod cfrg_vectors;
|
||||
mod mock_rng;
|
||||
mod parser;
|
||||
mod test_cfrg_vectors;
|
||||
|
||||
impl crate::CipherSuite for p256::NistP256 {
|
||||
const ID: &'static [u8] = <p256::NistP256 as hash2curve::OprfParameters>::ID;
|
||||
type Group = p256::NistP256;
|
||||
type Hash = sha2::Sha256;
|
||||
}
|
||||
|
||||
impl crate::CipherSuite for p384::NistP384 {
|
||||
const ID: &'static [u8] = <p384::NistP384 as hash2curve::OprfParameters>::ID;
|
||||
type Group = p384::NistP384;
|
||||
type Hash = sha2::Sha384;
|
||||
}
|
||||
|
||||
impl crate::CipherSuite for p521::NistP521 {
|
||||
const ID: &'static [u8] = <p521::NistP521 as hash2curve::OprfParameters>::ID;
|
||||
type Group = p521::NistP521;
|
||||
type Hash = sha2::Sha512;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ use crate::tests::parser::*;
|
||||
use crate::{
|
||||
BlindedElement, CipherSuite, EvaluationElement, Group, OprfClient, OprfServer, PoprfClient,
|
||||
PoprfServer, PoprfServerBatchEvaluateFinishResult, PoprfServerBatchEvaluatePrepareResult,
|
||||
Proof, Result, VoprfClient, VoprfServer, VoprfServerBatchEvaluateFinishResult,
|
||||
Proof, Result, Suite, VoprfClient, VoprfServer, VoprfServerBatchEvaluateFinishResult,
|
||||
};
|
||||
|
||||
#[derive(Debug)]
|
||||
@@ -133,83 +133,83 @@ fn test_vectors() -> Result<()> {
|
||||
let p256_oprf_tvs =
|
||||
json_to_test_vectors!(rfc, String::from("P256-SHA256"), String::from("OPRF"));
|
||||
assert_ne!(p256_oprf_tvs.len(), 0);
|
||||
test_oprf_seed_to_key::<NistP256>(&p256_oprf_tvs)?;
|
||||
test_oprf_blind::<NistP256>(&p256_oprf_tvs)?;
|
||||
test_oprf_blind_evaluate::<NistP256>(&p256_oprf_tvs)?;
|
||||
test_oprf_finalize::<NistP256>(&p256_oprf_tvs)?;
|
||||
test_oprf_evaluate::<NistP256>(&p256_oprf_tvs)?;
|
||||
test_oprf_seed_to_key::<Suite<NistP256, sha2::Sha256>>(&p256_oprf_tvs)?;
|
||||
test_oprf_blind::<Suite<NistP256, sha2::Sha256>>(&p256_oprf_tvs)?;
|
||||
test_oprf_blind_evaluate::<Suite<NistP256, sha2::Sha256>>(&p256_oprf_tvs)?;
|
||||
test_oprf_finalize::<Suite<NistP256, sha2::Sha256>>(&p256_oprf_tvs)?;
|
||||
test_oprf_evaluate::<Suite<NistP256, sha2::Sha256>>(&p256_oprf_tvs)?;
|
||||
|
||||
let p256_voprf_tvs =
|
||||
json_to_test_vectors!(rfc, String::from("P256-SHA256"), String::from("VOPRF"));
|
||||
assert_ne!(p256_voprf_tvs.len(), 0);
|
||||
test_voprf_seed_to_key::<NistP256>(&p256_voprf_tvs)?;
|
||||
test_voprf_blind::<NistP256>(&p256_voprf_tvs)?;
|
||||
test_voprf_blind_evaluate::<NistP256>(&p256_voprf_tvs)?;
|
||||
test_voprf_finalize::<NistP256>(&p256_voprf_tvs)?;
|
||||
test_voprf_evaluate::<NistP256>(&p256_voprf_tvs)?;
|
||||
test_voprf_seed_to_key::<Suite<NistP256, sha2::Sha256>>(&p256_voprf_tvs)?;
|
||||
test_voprf_blind::<Suite<NistP256, sha2::Sha256>>(&p256_voprf_tvs)?;
|
||||
test_voprf_blind_evaluate::<Suite<NistP256, sha2::Sha256>>(&p256_voprf_tvs)?;
|
||||
test_voprf_finalize::<Suite<NistP256, sha2::Sha256>>(&p256_voprf_tvs)?;
|
||||
test_voprf_evaluate::<Suite<NistP256, sha2::Sha256>>(&p256_voprf_tvs)?;
|
||||
|
||||
let p256_poprf_tvs =
|
||||
json_to_test_vectors!(rfc, String::from("P256-SHA256"), String::from("POPRF"));
|
||||
assert_ne!(p256_poprf_tvs.len(), 0);
|
||||
test_poprf_seed_to_key::<NistP256>(&p256_poprf_tvs)?;
|
||||
test_poprf_blind::<NistP256>(&p256_poprf_tvs)?;
|
||||
test_poprf_blind_evaluate::<NistP256>(&p256_poprf_tvs)?;
|
||||
test_poprf_finalize::<NistP256>(&p256_poprf_tvs)?;
|
||||
test_poprf_evaluate::<NistP256>(&p256_poprf_tvs)?;
|
||||
test_poprf_seed_to_key::<Suite<NistP256, sha2::Sha256>>(&p256_poprf_tvs)?;
|
||||
test_poprf_blind::<Suite<NistP256, sha2::Sha256>>(&p256_poprf_tvs)?;
|
||||
test_poprf_blind_evaluate::<Suite<NistP256, sha2::Sha256>>(&p256_poprf_tvs)?;
|
||||
test_poprf_finalize::<Suite<NistP256, sha2::Sha256>>(&p256_poprf_tvs)?;
|
||||
test_poprf_evaluate::<Suite<NistP256, sha2::Sha256>>(&p256_poprf_tvs)?;
|
||||
|
||||
let p384_oprf_tvs =
|
||||
json_to_test_vectors!(rfc, String::from("P384-SHA384"), String::from("OPRF"));
|
||||
assert_ne!(p384_oprf_tvs.len(), 0);
|
||||
test_oprf_seed_to_key::<NistP384>(&p384_oprf_tvs)?;
|
||||
test_oprf_blind::<NistP384>(&p384_oprf_tvs)?;
|
||||
test_oprf_blind_evaluate::<NistP384>(&p384_oprf_tvs)?;
|
||||
test_oprf_finalize::<NistP384>(&p384_oprf_tvs)?;
|
||||
test_oprf_evaluate::<NistP384>(&p384_oprf_tvs)?;
|
||||
test_oprf_seed_to_key::<Suite<NistP384, sha2::Sha384>>(&p384_oprf_tvs)?;
|
||||
test_oprf_blind::<Suite<NistP384, sha2::Sha384>>(&p384_oprf_tvs)?;
|
||||
test_oprf_blind_evaluate::<Suite<NistP384, sha2::Sha384>>(&p384_oprf_tvs)?;
|
||||
test_oprf_finalize::<Suite<NistP384, sha2::Sha384>>(&p384_oprf_tvs)?;
|
||||
test_oprf_evaluate::<Suite<NistP384, sha2::Sha384>>(&p384_oprf_tvs)?;
|
||||
|
||||
let p384_voprf_tvs =
|
||||
json_to_test_vectors!(rfc, String::from("P384-SHA384"), String::from("VOPRF"));
|
||||
assert_ne!(p384_voprf_tvs.len(), 0);
|
||||
test_voprf_seed_to_key::<NistP384>(&p384_voprf_tvs)?;
|
||||
test_voprf_blind::<NistP384>(&p384_voprf_tvs)?;
|
||||
test_voprf_blind_evaluate::<NistP384>(&p384_voprf_tvs)?;
|
||||
test_voprf_finalize::<NistP384>(&p384_voprf_tvs)?;
|
||||
test_voprf_evaluate::<NistP384>(&p384_voprf_tvs)?;
|
||||
test_voprf_seed_to_key::<Suite<NistP384, sha2::Sha384>>(&p384_voprf_tvs)?;
|
||||
test_voprf_blind::<Suite<NistP384, sha2::Sha384>>(&p384_voprf_tvs)?;
|
||||
test_voprf_blind_evaluate::<Suite<NistP384, sha2::Sha384>>(&p384_voprf_tvs)?;
|
||||
test_voprf_finalize::<Suite<NistP384, sha2::Sha384>>(&p384_voprf_tvs)?;
|
||||
test_voprf_evaluate::<Suite<NistP384, sha2::Sha384>>(&p384_voprf_tvs)?;
|
||||
|
||||
let p384_poprf_tvs =
|
||||
json_to_test_vectors!(rfc, String::from("P384-SHA384"), String::from("POPRF"));
|
||||
assert_ne!(p384_poprf_tvs.len(), 0);
|
||||
test_poprf_seed_to_key::<NistP384>(&p384_poprf_tvs)?;
|
||||
test_poprf_blind::<NistP384>(&p384_poprf_tvs)?;
|
||||
test_poprf_blind_evaluate::<NistP384>(&p384_poprf_tvs)?;
|
||||
test_poprf_finalize::<NistP384>(&p384_poprf_tvs)?;
|
||||
test_poprf_evaluate::<NistP384>(&p384_poprf_tvs)?;
|
||||
test_poprf_seed_to_key::<Suite<NistP384, sha2::Sha384>>(&p384_poprf_tvs)?;
|
||||
test_poprf_blind::<Suite<NistP384, sha2::Sha384>>(&p384_poprf_tvs)?;
|
||||
test_poprf_blind_evaluate::<Suite<NistP384, sha2::Sha384>>(&p384_poprf_tvs)?;
|
||||
test_poprf_finalize::<Suite<NistP384, sha2::Sha384>>(&p384_poprf_tvs)?;
|
||||
test_poprf_evaluate::<Suite<NistP384, sha2::Sha384>>(&p384_poprf_tvs)?;
|
||||
|
||||
let p521_oprf_tvs =
|
||||
json_to_test_vectors!(rfc, String::from("P521-SHA512"), String::from("OPRF"));
|
||||
assert_ne!(p521_oprf_tvs.len(), 0);
|
||||
test_oprf_seed_to_key::<NistP521>(&p521_oprf_tvs)?;
|
||||
test_oprf_blind::<NistP521>(&p521_oprf_tvs)?;
|
||||
test_oprf_blind_evaluate::<NistP521>(&p521_oprf_tvs)?;
|
||||
test_oprf_finalize::<NistP521>(&p521_oprf_tvs)?;
|
||||
test_oprf_evaluate::<NistP521>(&p521_oprf_tvs)?;
|
||||
test_oprf_seed_to_key::<Suite<NistP521, sha2::Sha512>>(&p521_oprf_tvs)?;
|
||||
test_oprf_blind::<Suite<NistP521, sha2::Sha512>>(&p521_oprf_tvs)?;
|
||||
test_oprf_blind_evaluate::<Suite<NistP521, sha2::Sha512>>(&p521_oprf_tvs)?;
|
||||
test_oprf_finalize::<Suite<NistP521, sha2::Sha512>>(&p521_oprf_tvs)?;
|
||||
test_oprf_evaluate::<Suite<NistP521, sha2::Sha512>>(&p521_oprf_tvs)?;
|
||||
|
||||
let p521_voprf_tvs =
|
||||
json_to_test_vectors!(rfc, String::from("P521-SHA512"), String::from("VOPRF"));
|
||||
assert_ne!(p521_voprf_tvs.len(), 0);
|
||||
test_voprf_seed_to_key::<NistP521>(&p521_voprf_tvs)?;
|
||||
test_voprf_blind::<NistP521>(&p521_voprf_tvs)?;
|
||||
test_voprf_blind_evaluate::<NistP521>(&p521_voprf_tvs)?;
|
||||
test_voprf_finalize::<NistP521>(&p521_voprf_tvs)?;
|
||||
test_voprf_evaluate::<NistP521>(&p521_voprf_tvs)?;
|
||||
test_voprf_seed_to_key::<Suite<NistP521, sha2::Sha512>>(&p521_voprf_tvs)?;
|
||||
test_voprf_blind::<Suite<NistP521, sha2::Sha512>>(&p521_voprf_tvs)?;
|
||||
test_voprf_blind_evaluate::<Suite<NistP521, sha2::Sha512>>(&p521_voprf_tvs)?;
|
||||
test_voprf_finalize::<Suite<NistP521, sha2::Sha512>>(&p521_voprf_tvs)?;
|
||||
test_voprf_evaluate::<Suite<NistP521, sha2::Sha512>>(&p521_voprf_tvs)?;
|
||||
|
||||
let p521_poprf_tvs =
|
||||
json_to_test_vectors!(rfc, String::from("P521-SHA512"), String::from("POPRF"));
|
||||
assert_ne!(p521_poprf_tvs.len(), 0);
|
||||
test_poprf_seed_to_key::<NistP521>(&p521_poprf_tvs)?;
|
||||
test_poprf_blind::<NistP521>(&p521_poprf_tvs)?;
|
||||
test_poprf_blind_evaluate::<NistP521>(&p521_poprf_tvs)?;
|
||||
test_poprf_finalize::<NistP521>(&p521_poprf_tvs)?;
|
||||
test_poprf_evaluate::<NistP521>(&p521_poprf_tvs)?;
|
||||
test_poprf_seed_to_key::<Suite<NistP521, sha2::Sha512>>(&p521_poprf_tvs)?;
|
||||
test_poprf_blind::<Suite<NistP521, sha2::Sha512>>(&p521_poprf_tvs)?;
|
||||
test_poprf_blind_evaluate::<Suite<NistP521, sha2::Sha512>>(&p521_poprf_tvs)?;
|
||||
test_poprf_finalize::<Suite<NistP521, sha2::Sha512>>(&p521_poprf_tvs)?;
|
||||
test_poprf_evaluate::<Suite<NistP521, sha2::Sha512>>(&p521_poprf_tvs)?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
+22
-22
@@ -553,8 +553,8 @@ mod tests {
|
||||
use rand::rngs::SysRng;
|
||||
|
||||
use super::*;
|
||||
use crate::Group;
|
||||
use crate::common::{Dst, STR_HASH_TO_GROUP};
|
||||
use crate::{Group, Suite};
|
||||
|
||||
fn prf<CS: CipherSuite>(
|
||||
input: &[u8],
|
||||
@@ -774,32 +774,32 @@ mod tests {
|
||||
zeroize_voprf_server::<Ristretto255>();
|
||||
}
|
||||
|
||||
verifiable_retrieval::<NistP256>();
|
||||
verifiable_batch_retrieval::<NistP256>();
|
||||
verifiable_bad_public_key::<NistP256>();
|
||||
verifiable_batch_bad_public_key::<NistP256>();
|
||||
verifiable_server_evaluate::<NistP256>();
|
||||
verifiable_retrieval::<Suite<NistP256, sha2::Sha256>>();
|
||||
verifiable_batch_retrieval::<Suite<NistP256, sha2::Sha256>>();
|
||||
verifiable_bad_public_key::<Suite<NistP256, sha2::Sha256>>();
|
||||
verifiable_batch_bad_public_key::<Suite<NistP256, sha2::Sha256>>();
|
||||
verifiable_server_evaluate::<Suite<NistP256, sha2::Sha256>>();
|
||||
|
||||
zeroize_voprf_client::<NistP256>();
|
||||
zeroize_voprf_server::<NistP256>();
|
||||
zeroize_voprf_client::<Suite<NistP256, sha2::Sha256>>();
|
||||
zeroize_voprf_server::<Suite<NistP256, sha2::Sha256>>();
|
||||
|
||||
verifiable_retrieval::<NistP384>();
|
||||
verifiable_batch_retrieval::<NistP384>();
|
||||
verifiable_bad_public_key::<NistP384>();
|
||||
verifiable_batch_bad_public_key::<NistP384>();
|
||||
verifiable_server_evaluate::<NistP384>();
|
||||
verifiable_retrieval::<Suite<NistP384, sha2::Sha384>>();
|
||||
verifiable_batch_retrieval::<Suite<NistP384, sha2::Sha384>>();
|
||||
verifiable_bad_public_key::<Suite<NistP384, sha2::Sha384>>();
|
||||
verifiable_batch_bad_public_key::<Suite<NistP384, sha2::Sha384>>();
|
||||
verifiable_server_evaluate::<Suite<NistP384, sha2::Sha384>>();
|
||||
|
||||
zeroize_voprf_client::<NistP384>();
|
||||
zeroize_voprf_server::<NistP384>();
|
||||
zeroize_voprf_client::<Suite<NistP384, sha2::Sha384>>();
|
||||
zeroize_voprf_server::<Suite<NistP384, sha2::Sha384>>();
|
||||
|
||||
verifiable_retrieval::<NistP521>();
|
||||
verifiable_batch_retrieval::<NistP521>();
|
||||
verifiable_bad_public_key::<NistP521>();
|
||||
verifiable_batch_bad_public_key::<NistP521>();
|
||||
verifiable_server_evaluate::<NistP521>();
|
||||
verifiable_retrieval::<Suite<NistP521, sha2::Sha512>>();
|
||||
verifiable_batch_retrieval::<Suite<NistP521, sha2::Sha512>>();
|
||||
verifiable_bad_public_key::<Suite<NistP521, sha2::Sha512>>();
|
||||
verifiable_batch_bad_public_key::<Suite<NistP521, sha2::Sha512>>();
|
||||
verifiable_server_evaluate::<Suite<NistP521, sha2::Sha512>>();
|
||||
|
||||
zeroize_voprf_client::<NistP521>();
|
||||
zeroize_voprf_server::<NistP521>();
|
||||
zeroize_voprf_client::<Suite<NistP521, sha2::Sha512>>();
|
||||
zeroize_voprf_server::<Suite<NistP521, sha2::Sha512>>();
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user