From eb782ecb0234dede5ec992953aa828064a6bcdd7 Mon Sep 17 00:00:00 2001 From: Kevin Lewi Date: Wed, 9 Oct 2024 18:38:17 -0700 Subject: [PATCH] Fixups to keep in sync with draft-10 --- CHANGELOG.md | 25 +- Cargo.toml | 4 +- README.md | 4 +- src/key_exchange/group/curve25519.rs | 57 +- src/key_exchange/group/elliptic_curve.rs | 4 +- src/key_exchange/group/mod.rs | 37 +- src/key_exchange/group/ristretto255.rs | 4 +- src/lib.rs | 2 +- src/tests/full_test.rs | 1011 ++++------------------ src/tests/opaque_vectors.rs | 728 +++++----------- src/tests/parser.rs | 6 +- src/tests/test_opaque_vectors.rs | 75 +- 12 files changed, 453 insertions(+), 1504 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c956d41..e41fba14 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,28 +1,7 @@ # Changelog -## 3.0.0-pre.5 (September 18, 2024) -* Increased MSRV to 1.74 -* Updated voprf dependency - -## 3.0.0-pre.4 (July 25, 2023) -* Updated voprf and curve25519-dalek dependencies - -## 3.0.0-pre.3 (June 7, 2023) -* Adjusted curve25519 support logic -* Adjusted key generation logic to be in line with commit 727b9ac of - https://github.com/cfrg/draft-irtf-cfrg-opaque -* Updated voprf dependency - -## 3.0.0-pre.2 (March 14, 2023) -* Updated VOPRF to draft 19 -* Added P384 testing support -* Increased MSRV to 1.65 -* Updating dependencies - -## 3.0.0-pre.1 (February 8, 2023) -* Renaming of X25519 to Curve25519 -* Increased MSRV to 1.60 -* Updating dependencies +## 2.1.0-pre.1 (October 10, 2024) +* Updated dependencies: voprf v0.4.1, curve25519-dalek v4 ## 2.0.0 (September 21, 2022) * Synced implementation with draft-irtf-cfrg-opaque-10 diff --git a/Cargo.toml b/Cargo.toml index b520fd8e..b874307f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,7 @@ name = "opaque-ke" readme = "README.md" repository = "https://github.com/facebook/opaque-ke" rust-version = "1.74" -version = "3.0.0-pre.5" +version = "2.1.0-pre.1" [features] argon2 = ["dep:argon2"] @@ -39,7 +39,7 @@ serde = { version = "1", default-features = false, features = [ "derive", ], optional = true } subtle = { version = "2.3", default-features = false } -voprf = { version = "0.5", default-features = false, features = ["danger"] } +voprf = { version = "0.4.1", default-features = false, features = ["danger"] } zeroize = { version = "1.5", features = ["zeroize_derive"] } [target.'cfg(target_arch = "wasm32")'.dependencies] diff --git a/README.md b/README.md index a9c82ee7..aa92edbb 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ Installation Add the following line to the dependencies of your `Cargo.toml`: ``` -opaque-ke = "3.0.0-pre.5" +opaque-ke = "2.1.0-pre.1" ``` ### Minimum Supported Rust Version @@ -40,7 +40,7 @@ Resources --------- - [OPAQUE academic publication](https://eprint.iacr.org/2018/163.pdf), including formal definitions and a proof of security -- [draft-irtf-cfrg-opaque-16](https://datatracker.ietf.org/doc/draft-irtf-cfrg-opaque/16/), containing a detailed (byte-level) specification for OPAQUE +- [draft-irtf-cfrg-opaque-10](https://datatracker.ietf.org/doc/draft-irtf-cfrg-opaque/10/), containing a detailed (byte-level) specification for OPAQUE - ["Let's talk about PAKE"](https://blog.cryptographyengineering.com/2018/10/19/lets-talk-about-pake/), an introductory blog post written by Matthew Green that covers OPAQUE - [@serenity-kit/opaque](https://github.com/serenity-kit/opaque), a WebAssembly package for this library - [opaque-wasm](https://github.com/marucjmar/opaque-wasm), a WebAssembly package for this library. A comparison between `@serenity-kit/opaque` and `opaque-wasm` can be found [here](https://opaque-documentation.netlify.app/docs/faq#how-does-it-compare-to-opaque-wasm) diff --git a/src/key_exchange/group/curve25519.rs b/src/key_exchange/group/curve25519.rs index d3039267..c57154b4 100644 --- a/src/key_exchange/group/curve25519.rs +++ b/src/key_exchange/group/curve25519.rs @@ -9,11 +9,12 @@ //! Key Exchange group implementation for Curve25519 use curve25519_dalek::montgomery::MontgomeryPoint; -use curve25519_dalek::scalar::{self, Scalar}; +use curve25519_dalek::scalar::Scalar; use curve25519_dalek::traits::Identity; use digest::core_api::BlockSizeUser; -use digest::{FixedOutput, HashMarker, OutputSizeUser}; -use generic_array::typenum::{IsLess, IsLessOrEqual, U256, U32}; +use digest::{FixedOutput, HashMarker}; +use elliptic_curve::hash2curve::{ExpandMsg, ExpandMsgXmd, Expander}; +use generic_array::typenum::{IsLess, IsLessOrEqual, U256, U32, U64}; use generic_array::GenericArray; use rand::{CryptoRng, RngCore}; use subtle::ConstantTimeEq; @@ -28,7 +29,7 @@ pub struct Curve25519; impl KeGroup for Curve25519 { type Pk = MontgomeryPoint; type PkLen = U32; - type Sk = [u8; 32]; + type Sk = Scalar; type SkLen = U32; fn serialize_pk(pk: Self::Pk) -> GenericArray { @@ -46,61 +47,59 @@ impl KeGroup for Curve25519 { fn random_sk(rng: &mut R) -> Self::Sk { loop { - // Sample 32 random bytes and then clamp, as described in https://cr.yp.to/ecdh.html - let mut scalar_bytes = [0u8; 32]; + let mut scalar_bytes = [0u8; 64]; rng.fill_bytes(&mut scalar_bytes); - let scalar = scalar::clamp_integer(scalar_bytes); + let scalar = Scalar::from_bytes_mod_order_wide(&scalar_bytes); - if scalar != Scalar::ZERO.to_bytes() { + if scalar != Scalar::ZERO { break scalar; } } } - fn hash_to_scalar<'a, H>(_input: &[&[u8]], _dst: &[&[u8]]) -> Result + // Implements the `HashToScalar()` function from + // + fn hash_to_scalar<'a, H>(input: &[&[u8]], dst: &[u8]) -> Result where H: BlockSizeUser + Default + FixedOutput + HashMarker, H::OutputSize: IsLess + IsLessOrEqual, { - unimplemented!() - } + let mut uniform_bytes = GenericArray::<_, U64>::default(); + ExpandMsgXmd::::expand_message(input, &[dst], 64) + .map_err(|_| InternalError::HashToScalar)? + .fill_bytes(&mut uniform_bytes); - fn derive_auth_keypair( - seed: GenericArray, - _info: &[u8], - ) -> Result - where - ::OutputSize: - IsLess + IsLessOrEqual<::BlockSize>, - { - Ok(scalar::clamp_integer(seed.into())) + let scalar = Scalar::from_bytes_mod_order_wide(&uniform_bytes.into()); + + if scalar == Scalar::ZERO { + Err(InternalError::HashToScalar) + } else { + Ok(scalar) + } } fn is_zero_scalar(scalar: Self::Sk) -> subtle::Choice { - scalar.ct_eq(&Scalar::ZERO.to_bytes()) + scalar.ct_eq(&Scalar::ZERO) } fn public_key(sk: Self::Sk) -> Self::Pk { - MontgomeryPoint::mul_base_clamped(sk) + MontgomeryPoint::mul_base(&sk) } fn diffie_hellman(pk: Self::Pk, sk: Self::Sk) -> GenericArray { - Self::serialize_pk(pk.mul_clamped(sk)) + Self::serialize_pk(sk * pk) } fn serialize_sk(sk: Self::Sk) -> GenericArray { - sk.into() + sk.to_bytes().into() } fn deserialize_sk(bytes: &[u8]) -> Result { bytes .try_into() .ok() - .and_then(|bytes| { - let scalar = scalar::clamp_integer(bytes); - (scalar == bytes).then_some(scalar) - }) - .filter(|scalar| scalar != &Scalar::ZERO.to_bytes()) + .and_then(|bytes| Scalar::from_canonical_bytes(bytes).into()) + .filter(|scalar| scalar != &Scalar::ZERO) .ok_or(InternalError::PointError) } } diff --git a/src/key_exchange/group/elliptic_curve.rs b/src/key_exchange/group/elliptic_curve.rs index 782f53b6..b22d28ea 100644 --- a/src/key_exchange/group/elliptic_curve.rs +++ b/src/key_exchange/group/elliptic_curve.rs @@ -53,12 +53,12 @@ where // Implements the `HashToScalar()` function from // - fn hash_to_scalar(input: &[&[u8]], dst: &[&[u8]]) -> Result + fn hash_to_scalar<'a, H>(input: &[&[u8]], dst: &[u8]) -> Result where H: BlockSizeUser + Default + FixedOutput + HashMarker, H::OutputSize: IsLess + IsLessOrEqual, { - Self::hash_to_scalar::>(input, dst) + Self::hash_to_scalar::>(input, &[dst]) .map_err(|_| InternalError::HashToScalar) .and_then(|scalar| { if bool::from(scalar.is_zero()) { diff --git a/src/key_exchange/group/mod.rs b/src/key_exchange/group/mod.rs index c93d9e96..e2582301 100644 --- a/src/key_exchange/group/mod.rs +++ b/src/key_exchange/group/mod.rs @@ -17,7 +17,7 @@ pub mod ristretto255; use digest::core_api::BlockSizeUser; use digest::{FixedOutput, HashMarker, OutputSizeUser}; use generic_array::sequence::Concat; -use generic_array::typenum::{IsLess, IsLessOrEqual, U256}; +use generic_array::typenum::{IsLess, IsLessOrEqual, U11, U256}; use generic_array::{ArrayLength, GenericArray}; use rand::{CryptoRng, RngCore}; use zeroize::Zeroize; @@ -49,7 +49,7 @@ pub trait KeGroup { /// # Errors /// [`InternalError::HashToScalar`] if the `input` is empty or longer then /// [`u16::MAX`]. - fn hash_to_scalar(input: &[&[u8]], dst: &[&[u8]]) -> Result + fn hash_to_scalar(input: &[&[u8]], dst: &[u8]) -> Result where H: BlockSizeUser + Default + FixedOutput + HashMarker, H::OutputSize: IsLess + IsLessOrEqual; @@ -69,11 +69,8 @@ pub trait KeGroup { ::OutputSize: IsLess + IsLessOrEqual<::BlockSize>, { - let dst_1 = GenericArray::from(STR_DERIVE_KEYPAIR) - .concat(STR_OPRF.into()) - .concat([voprf::Mode::Oprf.to_u8()].into()) - .concat([b'-'].into()); - let dst_2 = CS::ID.as_bytes(); + let context_string = create_context_string::(voprf::Mode::Oprf); + let dst = GenericArray::from(STR_DERIVE_KEYPAIR).concat(context_string); let info_len = i2osp_2(info.len()) .map_err(|_| InternalError::OprfError(voprf::Error::DeriveKeyPair))?; @@ -84,7 +81,7 @@ pub trait KeGroup { // || contextString) let sk_s = Self::hash_to_scalar::( &[&seed, &info_len, info, &counter.to_be_bytes()], - &[&dst_1, dst_2], + &dst, ) .map_err(|_| InternalError::OprfError(voprf::Error::DeriveKeyPair))?; @@ -115,9 +112,31 @@ pub trait KeGroup { // Helper functions used to compute DeriveAuthKeyPair() (taken from the voprf // crate) -const STR_OPRF: [u8; 7] = *b"OPRFV1-"; +const STR_VOPRF: [u8; 8] = *b"VOPRF10-"; const STR_DERIVE_KEYPAIR: [u8; 13] = *b"DeriveKeyPair"; +/// Generates the contextString parameter as defined in +/// +fn create_context_string(mode: voprf::Mode) -> GenericArray +where + ::OutputSize: + IsLess + IsLessOrEqual<::BlockSize>, +{ + // FIXME: this should be in voprf library + let cs_id_u16: u16 = match CS::ID { + "ristretto255-SHA512" => 0x0001, + "decaf448-SHAKE256" => 0x0002, + "P256-SHA256" => 0x0003, + "P384-SHA384" => 0x0004, + "P521-SHA512" => 0x0005, + _ => panic!("Incompatible ciphersuite: {}", CS::ID), + }; + + GenericArray::from(STR_VOPRF) + .concat([mode.to_u8()].into()) + .concat(cs_id_u16.to_be_bytes().into()) +} + fn i2osp_2(input: usize) -> Result<[u8; 2], InternalError> { u16::try_from(input) .map(|input| input.to_be_bytes()) diff --git a/src/key_exchange/group/ristretto255.rs b/src/key_exchange/group/ristretto255.rs index b5d9194b..710f9e28 100644 --- a/src/key_exchange/group/ristretto255.rs +++ b/src/key_exchange/group/ristretto255.rs @@ -72,12 +72,12 @@ impl KeGroup for Ristretto255 { // Implements the `HashToScalar()` function from // - fn hash_to_scalar<'a, H>(input: &[&[u8]], dst: &[&[u8]]) -> Result + fn hash_to_scalar<'a, H>(input: &[&[u8]], dst: &[u8]) -> Result where H: BlockSizeUser + Default + FixedOutput + HashMarker, H::OutputSize: IsLess + IsLessOrEqual, { - ::hash_to_scalar::(input, dst) + ::hash_to_scalar::(input, &[dst]) .map_err(InternalError::OprfInternalError) } diff --git a/src/lib.rs b/src/lib.rs index 890a20e9..34050da9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -9,7 +9,7 @@ //! An implementation of the OPAQUE asymmetric password authentication key //! exchange protocol //! -//! Note: This implementation is in sync with [draft-irtf-cfrg-opaque-16](https://datatracker.ietf.org/doc/draft-irtf-cfrg-opaque/16/), +//! Note: This implementation is in sync with [draft-irtf-cfrg-opaque-10](https://datatracker.ietf.org/doc/draft-irtf-cfrg-opaque/10/), //! but this specification is subject to change, until the final version //! published by the IETF. //! diff --git a/src/tests/full_test.rs b/src/tests/full_test.rs index 977d27ab..618c38a4 100644 --- a/src/tests/full_test.rs +++ b/src/tests/full_test.rs @@ -53,28 +53,6 @@ impl CipherSuite for Ristretto255 { type Ksf = Identity; } -#[cfg(feature = "ristretto255")] -struct Ristretto255P256; - -#[cfg(feature = "ristretto255")] -impl CipherSuite for Ristretto255P256 { - type OprfCs = p256::NistP256; - type KeGroup = crate::Ristretto255; - type KeyExchange = TripleDh; - type Ksf = Identity; -} - -#[cfg(feature = "ristretto255")] -struct Ristretto255P384; - -#[cfg(feature = "ristretto255")] -impl CipherSuite for Ristretto255P384 { - type OprfCs = p384::NistP384; - type KeGroup = crate::Ristretto255; - type KeyExchange = TripleDh; - type Ksf = Identity; -} - struct P256; impl CipherSuite for P256 { @@ -84,55 +62,6 @@ impl CipherSuite for P256 { type Ksf = Identity; } -struct P256P384; - -impl CipherSuite for P256P384 { - type OprfCs = p384::NistP384; - type KeGroup = p256::NistP256; - type KeyExchange = TripleDh; - type Ksf = Identity; -} - -#[cfg(feature = "ristretto255")] -struct P256Ristretto255; - -#[cfg(feature = "ristretto255")] -impl CipherSuite for P256Ristretto255 { - type OprfCs = crate::Ristretto255; - type KeGroup = p256::NistP256; - type KeyExchange = TripleDh; - type Ksf = Identity; -} - -struct P384; - -impl CipherSuite for P384 { - type OprfCs = p384::NistP384; - type KeGroup = p384::NistP384; - type KeyExchange = TripleDh; - type Ksf = Identity; -} - -struct P384P256; - -impl CipherSuite for P384P256 { - type OprfCs = p256::NistP256; - type KeGroup = p384::NistP384; - type KeyExchange = TripleDh; - type Ksf = Identity; -} - -#[cfg(feature = "ristretto255")] -struct P384Ristretto255; - -#[cfg(feature = "ristretto255")] -impl CipherSuite for P384Ristretto255 { - type OprfCs = crate::Ristretto255; - type KeGroup = p384::NistP384; - type KeyExchange = TripleDh; - type Ksf = Identity; -} - #[cfg(all(feature = "curve25519", feature = "ristretto255"))] struct Curve25519Ristretto255; @@ -155,17 +84,6 @@ impl CipherSuite for Curve25519P256 { type Ksf = Identity; } -#[cfg(feature = "curve25519")] -struct Curve25519P384; - -#[cfg(feature = "curve25519")] -impl CipherSuite for Curve25519P384 { - type OprfCs = p384::NistP384; - type KeGroup = crate::Curve25519; - type KeyExchange = TripleDh; - type Ksf = Identity; -} - pub struct TestVectorParameters { pub client_s_pk: Vec, pub client_s_sk: Vec, @@ -205,456 +123,156 @@ static STR_PASSWORD: &str = "password"; static STR_CREDENTIAL_IDENTIFIER: &str = "credential_identifier"; // To regenerate these test vectors, run: -// cargo test --features curve25519 -- --nocapture generate_test_vectors +// cargo test --features curve25519-u64 -- --nocapture generate_test_vectors #[cfg(feature = "ristretto255")] static TEST_VECTOR_RISTRETTO255: &str = r#" { - "client_s_pk": "58f84ab1de6d6baed997b8622a7340470a2e321778cf15a6a349f57143181b6d", - "client_s_sk": "ca1860c537f99dce6da9d0bf674f7c5c483c7e12c07487821d0fc60b78702a03", - "client_e_pk": "5898671746f581bbaa9019ea3e5dc5809612960e38f3fd3569237e8d0cf14a23", - "client_e_sk": "bd61a18173fe09b88529b4c04424637ce066fabc0f077985713ae12457d7b601", - "server_s_pk": "32033f92bfd82242f7dc9b2574f6916a53aa4ef83ecab4f4d912aad9957d8027", - "server_s_sk": "ab8f8598cb4166fb5ee1d437b6f5b563b59e4b699ded8e176c25ee77358bac01", - "server_e_pk": "f4ac5c4ef8dfae76705ddc1dd6c64b916680f69975cad5733ba7a4570bdd5629", - "server_e_sk": "7bf9ca648ab766269eeed497f640264cc248caaf94498b3aba2324395d061308", - "fake_sk": "23c51f2bd15324bbc088313184ff2daf81454c24002887b8abd8dc1d78f35000", - "credential_identifier": "637265644964656e746966696572", - "id_u": "696455", - "id_s": "696453", - "password": "70617373776f7264", - "blinding_factor": "16d9379d74dd857d97ed7470bc022290f0aed9d14c8de873c03139360d7c2203", - "oprf_seed": "089519f6ab43cb90f6c37abe2f4d6ef7928106fd5920c9856d717c6db229d6887b98ea296e8c48f962065e8c224ee1d687b5e9ea9be5c9fd66a1d5edf4326aa3", - "masking_nonce": "ff24215c44990ee27982e667ed57e1fefe21a38ecae3cf8dad951237ba6166cfef780945009e3cfc031f59552a8d7b84571c7c13722d88a52f2b7d279e27ff84", - "envelope_nonce": "add2e39416fb5917d1328dd9987b9e8e2ee30c04eb4f4a8ae5c52e63b719846a", - "client_nonce": "db1f9c4b2e3f4f307d35490a2d9ace7ccd2e124c5a08655bfb97597f24d5da55", - "server_nonce": "00285d1b30f04f84f020dc60d702581cf36fc8f683b75b1efd21e01056a1a102", - "context": "636f6e74657874", - "registration_request": "3025151fce8a32a8961aaf77031402a3d0cf70370052b22b6131c78de82e8366", - "registration_response": "1a566c5cb551027e996788ad999b14ecd8bc0f230348aef90674e733d946cd6332033f92bfd82242f7dc9b2574f6916a53aa4ef83ecab4f4d912aad9957d8027", - "registration_upload": "90c46263e6709e038ffd12d5e97eca652800edc492b942a798951da8af74ef289e8fe0c9fef7a8f785445c82f6185f1e8682ae907197ce97ae0521c0f5ce4f636781ad5b5c3f9df7c4af0dfdd0f77ce98846d019cf4189b8f0a793cd59e2b42aca1860c537f99dce6da9d0bf674f7c5c483c7e12c07487821d0fc60b78702a039923ef46ae4f5b0240484250d690a6b1533bc8d5cd89e5b5bb78ebe4cb40d4439275e924b80683c6b8833cb503059bd3bcb083aa72bf70d1d2cb4e6d40cd61d7", - "credential_request": "3025151fce8a32a8961aaf77031402a3d0cf70370052b22b6131c78de82e8366db1f9c4b2e3f4f307d35490a2d9ace7ccd2e124c5a08655bfb97597f24d5da555898671746f581bbaa9019ea3e5dc5809612960e38f3fd3569237e8d0cf14a23", - "credential_response": "1a566c5cb551027e996788ad999b14ecd8bc0f230348aef90674e733d946cd63ff24215c44990ee27982e667ed57e1fefe21a38ecae3cf8dad951237ba6166cfd7635651e5f867c08c02e7564b86a03d1b1b198dec5b9b54f998d3bfba0f4fe956d3e795c672c275ac2fb0a5ce38920bc17f532348243f79db5aaf34db507ce41096d9a326ee453f02ab1d1c9b738507fbe87197b13c65720e4f16737f9da173613b90bd5b2ee6812c0462299a7c3b179e439e88af08abf607796e4e9d23e17f7bf9ca648ab766269eeed497f640264cc248caaf94498b3aba2324395d061308a0c9863142b43845b16e9bf9e1d236038a0cf8a470a7291c60e8579dae1e2128d7919f28f7a4ff9fdd915f00b42007aa1de6f9a0bded2cbbf297e923bcef57f42fb06bcfca035fbc66cf74300c54daec3738dbaca2ba470bb81330efab584256", - "credential_finalization": "6a3f177d73886db031e081e116a1eb7c13ef763a60a0ae8b7477f4fcf6c7d22618651402f3ab7bd501f42442a010a185253c87bb051cca80686b54ceb5c410d3", - "client_registration_state": "16d9379d74dd857d97ed7470bc022290f0aed9d14c8de873c03139360d7c22033025151fce8a32a8961aaf77031402a3d0cf70370052b22b6131c78de82e8366", - "client_login_state": "16d9379d74dd857d97ed7470bc022290f0aed9d14c8de873c03139360d7c22033025151fce8a32a8961aaf77031402a3d0cf70370052b22b6131c78de82e8366db1f9c4b2e3f4f307d35490a2d9ace7ccd2e124c5a08655bfb97597f24d5da555898671746f581bbaa9019ea3e5dc5809612960e38f3fd3569237e8d0cf14a23bd61a18173fe09b88529b4c04424637ce066fabc0f077985713ae12457d7b601db1f9c4b2e3f4f307d35490a2d9ace7ccd2e124c5a08655bfb97597f24d5da55", - "server_login_state": "01410c086ece65443dcbca42c6703d08bae0d293f4b9b78449df626f7f8b04d8cada3f693670e74683f4ec6f9df9d1773fa4212a6ddc52343874bcfb0a87dd82cd25afdbb29dd431c859b337de3123e325d9aa9c99e9a59fd98858c6835e8c34d0945a251261f456ffa67399c8745e478c7377a3774930a49f0b7c351ed654e38d62e93a5ec5cd0305521bcce9695b3ce23b4713a699bd9e1e102049652bc407fc6579cf4c7f8e5e3dcfaadb73a36c49bc2084b82246c01c630dde63a5bbfb40", - "password_file": "90c46263e6709e038ffd12d5e97eca652800edc492b942a798951da8af74ef289e8fe0c9fef7a8f785445c82f6185f1e8682ae907197ce97ae0521c0f5ce4f636781ad5b5c3f9df7c4af0dfdd0f77ce98846d019cf4189b8f0a793cd59e2b42aca1860c537f99dce6da9d0bf674f7c5c483c7e12c07487821d0fc60b78702a039923ef46ae4f5b0240484250d690a6b1533bc8d5cd89e5b5bb78ebe4cb40d4439275e924b80683c6b8833cb503059bd3bcb083aa72bf70d1d2cb4e6d40cd61d7", - "export_key": "55833fcf856af07df1ec4d98a2180ca90227edddf53bca6787cb86f40337290491dec6dbc95efd56e15e7f2bb9bea2c2e683b956b1f85b2f9abce2a87cf61e4b", - "session_key": "8d62e93a5ec5cd0305521bcce9695b3ce23b4713a699bd9e1e102049652bc407fc6579cf4c7f8e5e3dcfaadb73a36c49bc2084b82246c01c630dde63a5bbfb40" -} -"#; -#[cfg(feature = "ristretto255")] -static TEST_VECTOR_RISTRETTO255_P256: &str = r#" -{ - "client_s_pk": "f88bd648ec3275a06d2f64f7f2e35f9b79cef7d6ead6ba05945b700658643e2f", - "client_s_sk": "04e1b7f9448b6913ff7de5e0b4ccc2f6e88eb6ef80963c75f89db0f634cb000b", - "client_e_pk": "907bd6c4d780c85415ce1b9e8cff2a6c10bec716d6eab80cf3f9646469033a3c", - "client_e_sk": "8c0e7d7310db05a12a418c0616c8969855008946702d7d0e2b0b1f10dd24c402", - "server_s_pk": "681525049da7bedd96b863b95f13859b616aa9729b752676dde32513acfb7611", - "server_s_sk": "30aa1bf8df6bf6ed30e7c9579e3bda2804dad268ea2d3bc793173a35e895ad00", - "server_e_pk": "68732765fd7a76511f7c2a50bf7df6efe54efa15b0bfce2ba162ee922c4e0452", - "server_e_sk": "4961b6b17fef0eb216c13c97e5a2c28db78feddbbbdcfe9eaea937c6fb625d05", - "fake_sk": "d3fd635217181a826cb07eaad0d6c722e73731a3c719f26322ccef9d2130990d", + "client_s_pk": "dcddc4b2e2880d52e5e7feb1a960483279ec01322a9459a38617fe279328ea73", + "client_s_sk": "0429abf73dd54603a2517d43963092191b3bfa703d6f96e5c3ab07032af09306", + "client_e_pk": "f4078829250cbe512a46d47f607bcbd11f55d257c2758968f0a2fe052f153f23", + "client_e_sk": "44effcb2a3e3cdf444c73964afc454513b42b19b5fe9de78bafec9d6d152b808", + "server_s_pk": "d20495860077399f2ae24565bfafb29f41602805bda05323663a1b9a2f74532e", + "server_s_sk": "c40c8d1af35aa1aeb16539eda98e17dc2eecfa9e21938c286eb5c04d03a3d90c", + "server_e_pk": "3868e17fa3a9ea40b8099b94265b41f6989a7790b99525a6ebe6d8da02151517", + "server_e_sk": "6f11607b6c7493cb14935f2af3ea6d35368564840d3e13d0b8b85619ce5cb309", + "fake_sk": "d027dc1c2c5fd2abe413d4603a31c5f5af7798dcb8a349ddff1dba22619e3106", "credential_identifier": "637265644964656e746966696572", "id_u": "696455", "id_s": "696453", "password": "70617373776f7264", - "blinding_factor": "ce2a220c656632c5bb630351bf2bc9258631acd226c5ecb1686aa82ea5baf308", - "oprf_seed": "3d108c5667216961a69098fc9a94294cd8761aa4af76c51ea35df3a06f2139f6", - "masking_nonce": "ef9aebb14f7f965ac8fcba0418a83340646747cb00d056b57f7ba2671945728ce3648bf46c6d2b21890ad09c25142e57360cea1300ed7d74dc0580e61fa5b5e7", - "envelope_nonce": "23abd8c07fec3913673426fd49f4d2832c29855b5846fea5ffa6d91ede58f6ac", - "client_nonce": "dff3b604d150842e692aa20fd0621ba8718581fd6fa4a3409108bba35d5f7bdc", - "server_nonce": "e3d70b5657db6fa047f106843a746091c602d2c2e8280d9ac8994cf39bf93d30", + "blinding_factor": "2f4d3b99b3239f14c02937cd9c5928b72e792923c392f32259d38db66b378c09", + "oprf_seed": "a4fd682676da261afc2d1f6c2b4d173bee9b591de7b6a125a95cd6a129c582abfb47c58cb8519300c41993c4f65f3bc998857839782e81853a9b4222bbd0af51", + "masking_nonce": "84fee2957ecedff1f417fb7b9cc033a27cc2f23f346c22933121ec902c563d8ebe92eec260c4c48f11f560a20896334f11598174313af77b6c06b5aebe4dc8bc", + "envelope_nonce": "52cf21f9aa91b105dbacbf986c2f2ffc18c2c876ebbe753991eeb6018986c25d", + "client_nonce": "61c78d68faafff73962fe5938a6e51cf0d142f682055c6935da551d9c0c1f5e0", + "server_nonce": "3803f1c7e9fc0859f9d82c0a5dc853191c9cc7ecb4b8901d5eae9cb545210dbd", "context": "636f6e74657874", - "registration_request": "03ae0926f45e0b5efab9e15e6acddd7dd4bdbf15b1accccbae1927d5450532229a", - "registration_response": "03f2a9e0737a10e41a5501f853d2401a89a7c8c626926e6899205357a7d971c238681525049da7bedd96b863b95f13859b616aa9729b752676dde32513acfb7611", - "registration_upload": "7e7ea08bc8cceb5d89b7ceb8e91deadb721a2ad684272510e85570acb9563451ad667e253cfd587092cfc3a788aec8b0cf3e248d84cc7ff98e7d5488736deb3704e1b7f9448b6913ff7de5e0b4ccc2f6e88eb6ef80963c75f89db0f634cb000bfc47ba0ccf49efab4a706d72cf038a01c6f32fa4fa10a30c6ce94df37a86504f", - "credential_request": "03ae0926f45e0b5efab9e15e6acddd7dd4bdbf15b1accccbae1927d5450532229adff3b604d150842e692aa20fd0621ba8718581fd6fa4a3409108bba35d5f7bdc907bd6c4d780c85415ce1b9e8cff2a6c10bec716d6eab80cf3f9646469033a3c", - "credential_response": "03f2a9e0737a10e41a5501f853d2401a89a7c8c626926e6899205357a7d971c238ef9aebb14f7f965ac8fcba0418a83340646747cb00d056b57f7ba2671945728cb166cbc26eadb074abec8888288bb157ba6e995e4983277dde3a8b164e78efcf261a0a2ae4dcbb379a1e651b128bf356108a2be9e10f5e0d95f5e51c748b890b96e6304f8380ee71f623e3bfde447ee58bb60e40281e44f8496e5a799c24506f4961b6b17fef0eb216c13c97e5a2c28db78feddbbbdcfe9eaea937c6fb625d05c0b7b235a518f55c3026b2bc375841f35c3b2e1fc381c3963b721a97d34d887ea4dfb155d59da8ad912aac17df06e6a21b118cac0cfd15903f0c20658fa717b4", - "credential_finalization": "10653ec75b594a7401ffcde895d463002c3eac839f0343ac779fa9210e4782dc", - "client_registration_state": "ce2a220c656632c5bb630351bf2bc9258631acd226c5ecb1686aa82ea5baf30803ae0926f45e0b5efab9e15e6acddd7dd4bdbf15b1accccbae1927d5450532229a", - "client_login_state": "ce2a220c656632c5bb630351bf2bc9258631acd226c5ecb1686aa82ea5baf30803ae0926f45e0b5efab9e15e6acddd7dd4bdbf15b1accccbae1927d5450532229adff3b604d150842e692aa20fd0621ba8718581fd6fa4a3409108bba35d5f7bdc907bd6c4d780c85415ce1b9e8cff2a6c10bec716d6eab80cf3f9646469033a3c8c0e7d7310db05a12a418c0616c8969855008946702d7d0e2b0b1f10dd24c402dff3b604d150842e692aa20fd0621ba8718581fd6fa4a3409108bba35d5f7bdc", - "server_login_state": "2b6792d84ae19d64f39ae233b54ce79ab8793f9648c24f4bd22df7b4f9e4e6e77fe5ead3ce6faf1d05cbc64518cfe259cfe522b381eadc79019c0c81f613233d91910ea0c4c286eeec89dd2ceec93478f936454f4f41206c75407862150cdf3a", - "password_file": "7e7ea08bc8cceb5d89b7ceb8e91deadb721a2ad684272510e85570acb9563451ad667e253cfd587092cfc3a788aec8b0cf3e248d84cc7ff98e7d5488736deb3704e1b7f9448b6913ff7de5e0b4ccc2f6e88eb6ef80963c75f89db0f634cb000bfc47ba0ccf49efab4a706d72cf038a01c6f32fa4fa10a30c6ce94df37a86504f", - "export_key": "b776d68ad88a7534f571625727ce09a13ff203b9c26e16da9aaa1b7698cd1645", - "session_key": "91910ea0c4c286eeec89dd2ceec93478f936454f4f41206c75407862150cdf3a" -} -"#; - -#[cfg(feature = "ristretto255")] -static TEST_VECTOR_RISTRETTO255_P384: &str = r#" -{ - "client_s_pk": "86a1adb5a45e87b1cb92f082a5bf5890e9e21e2d78d4773ab7f0d021664b7b69", - "client_s_sk": "950ac3b5fcca8fbcc740e24a9f0a0703bf06c1e345459cb662bed0ae91f10904", - "client_e_pk": "d697f15ff9e34fd51a2a8980995503d17bd11cbb0407d51502138f384f908112", - "client_e_sk": "c320ee0eb5eef9e6e00872cef1196e362d20712ae9da185e7466397324a72907", - "server_s_pk": "d0433b254df7a9952f281f10b86d9c4cc14faef3a3c67943a01b208782da620e", - "server_s_sk": "94985ed3d85392c7957c53b9f24ab138acbdbba80357c79eeccea19602434b0d", - "server_e_pk": "00ea32a0e605deb301bc73b4df661100d7de331c6e4548b9e5dbf02872fe7529", - "server_e_sk": "e4d2a0ea0adf9edb4a8d7e0d236ea9022bdcae7d7c24665928c7c9e765ffe700", - "fake_sk": "26e8e0bf9739b54dafab24a3454cceef1b3c61b0b6e521dc5cba404722517101", - "credential_identifier": "637265644964656e746966696572", - "id_u": "696455", - "id_s": "696453", - "password": "70617373776f7264", - "blinding_factor": "454092e5dcb20854d987421466835f4a270bcaffeae8e094a0cd1c4f636946b90bb5d8d0cc2bddfcde1bc97042021043", - "oprf_seed": "e4d402280ebe5718f2b2887ef5595a6b2020f6fb983b5f117ab7db986e2fdca9675b4bc94ff4db6cd249810ff08bb760", - "masking_nonce": "ed6dd7938ad35abd1088e892d55706ea3394d88351e18b6574b7b2931210e5b6320a60040a96d8a68f8ca197dc77c9072964e0a267eb4d51bf6327d40ec3091f", - "envelope_nonce": "866f1e43f59ab3076f7ffa80e3d180d74dfe472a4399378477927ac88e99483c", - "client_nonce": "c4eb516c8f385cabe449e30bd55975cb8c73b8cd4121e392202c95dc1ca58ff6", - "server_nonce": "7eba5738ead262ae3288e908cc31126d8755b79471e34a0fed7bda22abdf830b", - "context": "636f6e74657874", - "registration_request": "031032c75bd6d20572956af17c27c8a628f493993903e8a2dbd4db1b069f2dacbf05767428f0e4c58150af7d6577c42cc1", - "registration_response": "024fbffd6d812d62d98009ac0277c0740e3245e98bf3c62a8dda34152b350b8a74f34fb5677b848b45e982d663ee7ae522d0433b254df7a9952f281f10b86d9c4cc14faef3a3c67943a01b208782da620e", - "registration_upload": "82961e5ba6f42e3dede98b0eb333668f768df6e28335896e1d1c764d45b26101937f31c8f82cda4be30080d8edeefdce8d43a11a8dc089111f48d173d9a057fa35dc0dfe0a59457a6bfec84298d5e4d8950ac3b5fcca8fbcc740e24a9f0a0703bf06c1e345459cb662bed0ae91f1090468008a29cf8f061e01bdc0940a04bee4a49391c2eb3a10552254f3904e2b374a2018fd6153e948d7bb74e47de4b3765e", - "credential_request": "031032c75bd6d20572956af17c27c8a628f493993903e8a2dbd4db1b069f2dacbf05767428f0e4c58150af7d6577c42cc1c4eb516c8f385cabe449e30bd55975cb8c73b8cd4121e392202c95dc1ca58ff6d697f15ff9e34fd51a2a8980995503d17bd11cbb0407d51502138f384f908112", - "credential_response": "024fbffd6d812d62d98009ac0277c0740e3245e98bf3c62a8dda34152b350b8a74f34fb5677b848b45e982d663ee7ae522ed6dd7938ad35abd1088e892d55706ea3394d88351e18b6574b7b2931210e5b631a1b6b837aa901a6016382e5174dc0afe05c4c382066c68a4712a9472382b22e0f41eec742cfb4fb44606388b40c4460b87996048768e54f2d130cabead02de5e564ca78adb2f72c45c966cf8feadeecbbefbdab76b21474a1513c098a61e2fb00c6b3e23b248d9d95740d44b81e54ae4d2a0ea0adf9edb4a8d7e0d236ea9022bdcae7d7c24665928c7c9e765ffe700bac9e8a7cec2359871b91d1f87d975888ff28262c2520d729a48f27e6c8f722b7b778392ded7de3648a63e312aaca0dfdac3177583b016d64ee3735f983e2b1dbe622fa1f92d9a38fe55550948416592", - "credential_finalization": "17a0cf86d1021759062b89f802a798b5d2492f7373462e1b75d6197a21d599e1f16b0fafad97ba72b0ad69683e69a145", - "client_registration_state": "454092e5dcb20854d987421466835f4a270bcaffeae8e094a0cd1c4f636946b90bb5d8d0cc2bddfcde1bc97042021043031032c75bd6d20572956af17c27c8a628f493993903e8a2dbd4db1b069f2dacbf05767428f0e4c58150af7d6577c42cc1", - "client_login_state": "454092e5dcb20854d987421466835f4a270bcaffeae8e094a0cd1c4f636946b90bb5d8d0cc2bddfcde1bc97042021043031032c75bd6d20572956af17c27c8a628f493993903e8a2dbd4db1b069f2dacbf05767428f0e4c58150af7d6577c42cc1c4eb516c8f385cabe449e30bd55975cb8c73b8cd4121e392202c95dc1ca58ff6d697f15ff9e34fd51a2a8980995503d17bd11cbb0407d51502138f384f908112c320ee0eb5eef9e6e00872cef1196e362d20712ae9da185e7466397324a72907c4eb516c8f385cabe449e30bd55975cb8c73b8cd4121e392202c95dc1ca58ff6", - "server_login_state": "1ac407a2442a2b126afd56a7790d790c1dcbd16b3d9d89963267f26c798a0266d896e8c1daa912d5933be902cfa301e42f1fe785b8429087cc492f9e8731139628530254e4524a0df9a6840748dc8bd12b65bf3141f09a696b55760bd4f65fc3e952e42d4d61618bd93459e43b4ee699eba8d9d3ed3c0c31bd605b654e9fc289a87799c43267570e7644c16436463fd0", - "password_file": "82961e5ba6f42e3dede98b0eb333668f768df6e28335896e1d1c764d45b26101937f31c8f82cda4be30080d8edeefdce8d43a11a8dc089111f48d173d9a057fa35dc0dfe0a59457a6bfec84298d5e4d8950ac3b5fcca8fbcc740e24a9f0a0703bf06c1e345459cb662bed0ae91f1090468008a29cf8f061e01bdc0940a04bee4a49391c2eb3a10552254f3904e2b374a2018fd6153e948d7bb74e47de4b3765e", - "export_key": "6507d9329bb8fb8468d7fbf89781f02e3d56e887aa8cd0e56b622bb9b2cf78e079000936c0cbacdf3acbae65b929f143", - "session_key": "e952e42d4d61618bd93459e43b4ee699eba8d9d3ed3c0c31bd605b654e9fc289a87799c43267570e7644c16436463fd0" + "registration_request": "0029a6bfe36ad951c8180cd030870a8eaac946d7a0a8f6838b90273cd363553f", + "registration_response": "a2ff5ff073aa3ae6e8c1341cb10d0fe6822c902f254b40648523c456ce511f60d20495860077399f2ae24565bfafb29f41602805bda05323663a1b9a2f74532e", + "registration_upload": "94ddf2dd8051a97accbff76b961f475be5499153176c4e7673009f5471e82d452e44248ec8495c0622e895633ee23ab365a99eb86c422095b5e6687922b436cc23397830983684f1b7e0a6c828b4be843416ea3d666751741446a17b798836220429abf73dd54603a2517d43963092191b3bfa703d6f96e5c3ab07032af0930630f910034ee42f3650979f34c60116c8df87ab2014a8028719b7af16933757a1364a0a8dba5e31702d4ecd8bb0089963c8c7c806633106ec01f21d2c1f0e7c6d", + "credential_request": "0029a6bfe36ad951c8180cd030870a8eaac946d7a0a8f6838b90273cd363553f61c78d68faafff73962fe5938a6e51cf0d142f682055c6935da551d9c0c1f5e0f4078829250cbe512a46d47f607bcbd11f55d257c2758968f0a2fe052f153f23", + "credential_response": "a2ff5ff073aa3ae6e8c1341cb10d0fe6822c902f254b40648523c456ce511f6084fee2957ecedff1f417fb7b9cc033a27cc2f23f346c22933121ec902c563d8e6611595c09b73c4d0b376bff1e0f6170e741932a2fcc46eea41f0a25fcbc9b3776b3cd7caf89abb4e12051add84020e78bf66fdf085bf7bece614996aab5e003572942c0d2adb246190bac44854418aa91b97f21676ee6081cc392fbfa69a8b4310231dbdcc334d7236c3b29c1e68c6053694c70636941db4773f0de31b807d66f11607b6c7493cb14935f2af3ea6d35368564840d3e13d0b8b85619ce5cb309224143ae3d5f41168405da956adf330323607e9cfeccf142344926bfc456d221363994a0ad737282c8130e3e695f119bb549a0a1d4bcfe43877badbd1376c22d2357648f2c5d10eb4871ce565caa12943390ab4c4f39e8a21ef8dd58325d80c6", + "credential_finalization": "8d9d27b4b02011d4fd0c0712a66d870ff1477f564459fdb9710778129f7415fa1ffdf878838bd5886482a8fad35e7fe76f072fd58d755a3b417ab3b5546d8db7", + "client_registration_state": "2f4d3b99b3239f14c02937cd9c5928b72e792923c392f32259d38db66b378c090029a6bfe36ad951c8180cd030870a8eaac946d7a0a8f6838b90273cd363553f", + "client_login_state": "2f4d3b99b3239f14c02937cd9c5928b72e792923c392f32259d38db66b378c090029a6bfe36ad951c8180cd030870a8eaac946d7a0a8f6838b90273cd363553f61c78d68faafff73962fe5938a6e51cf0d142f682055c6935da551d9c0c1f5e0f4078829250cbe512a46d47f607bcbd11f55d257c2758968f0a2fe052f153f2344effcb2a3e3cdf444c73964afc454513b42b19b5fe9de78bafec9d6d152b80861c78d68faafff73962fe5938a6e51cf0d142f682055c6935da551d9c0c1f5e0", + "server_login_state": "a1ea9f94d030c645d25fa27e6b5c711cb392878042639ad7c3b14bdc8030ab6bfbbf1dd7b20dad15f07ac6a1cd62f13aa34eb903984d0836dc1de6a8cb66058920841cdfd8f3e28d52a50964109166b049f624b492879313ee506599d96962048872e2fa61c711e9f37f37b984048b3a29969e8686b9e21f1ce0a4e151e6f1a1f72c738d5eab793d8e9d2ec660bf49fff9a4faff5a984a10607caa260e4b94f767d47e9336d554b778ca41671d498d262f36c8874b035ecc954ed3baa8031ac7", + "password_file": "94ddf2dd8051a97accbff76b961f475be5499153176c4e7673009f5471e82d452e44248ec8495c0622e895633ee23ab365a99eb86c422095b5e6687922b436cc23397830983684f1b7e0a6c828b4be843416ea3d666751741446a17b798836220429abf73dd54603a2517d43963092191b3bfa703d6f96e5c3ab07032af0930630f910034ee42f3650979f34c60116c8df87ab2014a8028719b7af16933757a1364a0a8dba5e31702d4ecd8bb0089963c8c7c806633106ec01f21d2c1f0e7c6d", + "export_key": "69b3d2fa20b4b93b18fdb8dae139af6a5a210a8d40ed107fe0d76bd76aedc1d791c6c948eba8aa1750217c3021e7c07657569152120d4dd9928a22f4d904fbf8", + "session_key": "f72c738d5eab793d8e9d2ec660bf49fff9a4faff5a984a10607caa260e4b94f767d47e9336d554b778ca41671d498d262f36c8874b035ecc954ed3baa8031ac7" } "#; static TEST_VECTOR_P256: &str = r#" { - "client_s_pk": "032d82f5e7db19c5f87db1cb296d5f847315e98aa4ae2f14cb94fe9fefae5b23a1", - "client_s_sk": "4c2bd02fd037cfe6aa8aa243bbf0419c6f4196565470192554bdf3da966ae1d5", - "client_e_pk": "03b2ee310f831c43b6ecf8683ab3a0f903f4c54d42b5851652667d24a051805e54", - "client_e_sk": "11fd841fa4c27ed5849632ce256a242c526f1f828e170a68800fa4a7a9c93047", - "server_s_pk": "022cc9aadeaed45bdae85464af1512614edde6adf97c1407d6721e5cd1a985734a", - "server_s_sk": "e6334d73a9a34212886d4c4b7368df72f06a90b2887e5632f0eadad4cc8c9d3d", - "server_e_pk": "03ca02f4d31f1e66624dc21864e410876f2dc8fdcfff031090f170736d73060a10", - "server_e_sk": "6a6b22ac2bc7bd6401cc2e42f588a4550651cbd30d9529b69ebb88d7b073e6a2", - "fake_sk": "8362d70183ab78942b21ae3cba95f1edb5d314fb2f2afa49a452222a02f6dcc4", - "credential_identifier": "637265644964656e746966696572", - "id_u": "696455", - "id_s": "696453", - "password": "70617373776f7264", - "blinding_factor": "87700138241d25149a2ca6fd9a27e7f9d71a8e718fe1c411862a975cdb17a413", - "oprf_seed": "8b10b0445efce9c59e6e5a39f89961722fba14a809068620b9d77433bafb254e", - "masking_nonce": "52b2cf34ba108ffd2ef1e516585d845b90e34af198f379b6465744f5812274680c5dc1dca7e6a73a4dd48159cbd4b35913ff51bac2605a63563602e681aeb171", - "envelope_nonce": "f97a0c9a7de14b073531d24ba6d7893191a2724fffa6fe242099c17c6640e210", - "client_nonce": "4c5dbddfb063ecba7fd528c0caec52893ef206bf86362dafb27fe13d96e0b538", - "server_nonce": "fab1f9fa3f0356fc5d9b766ea3bdd53884ab38bac8371842d047a3b815c79428", - "context": "636f6e74657874", - "registration_request": "030e9bc97e025d9b5eacf7e76b16ada9a568401c509d2d1c507914c56d820be7ea", - "registration_response": "03dc5d4ba61011266879896966f26fde5e188a5d30df17deca56d5e227efbc8102022cc9aadeaed45bdae85464af1512614edde6adf97c1407d6721e5cd1a985734a", - "registration_upload": "035153b60a0f66ddf3d45d00c6bf6506a0898e6d438f1f73fbec916d538f6b43b042eaa5fe4bb07b55cce02bdc53225886bff138edf3a57a7f28d256d52b1755c84c2bd02fd037cfe6aa8aa243bbf0419c6f4196565470192554bdf3da966ae1d5489d88b7908412724d6c28f209a1c45ff7d509cbdb67b017c08802a4532e04d5", - "credential_request": "030e9bc97e025d9b5eacf7e76b16ada9a568401c509d2d1c507914c56d820be7ea4c5dbddfb063ecba7fd528c0caec52893ef206bf86362dafb27fe13d96e0b53803b2ee310f831c43b6ecf8683ab3a0f903f4c54d42b5851652667d24a051805e54", - "credential_response": "03dc5d4ba61011266879896966f26fde5e188a5d30df17deca56d5e227efbc810252b2cf34ba108ffd2ef1e516585d845b90e34af198f379b6465744f5812274682cc3c3b734abf18e0ee058a9983f91017022b220d76a7bea6a99e7a7ca8bce9dfe0d670272cdfe25136f9bf00b4607a79133c37f367da3e8b9ead9059f40a2bca60b7d99ba5a2557de3be49de1b62e5771a2855d1fbce37ffbf403ca5fa3a37c3b6a6b22ac2bc7bd6401cc2e42f588a4550651cbd30d9529b69ebb88d7b073e6a203e0f0020d7d9a024e799db237b7dedc4faa8a4a8ce17e93ff490ea66ebc654ba67c17359620d1e627a528c40c961d55d77de2882a9c510ea920974f1ddc97f3c5", - "credential_finalization": "a6836d9d17ed9a5e7c562002058f0a68e1c41925f7736e959965811b6e3e0783", - "client_registration_state": "87700138241d25149a2ca6fd9a27e7f9d71a8e718fe1c411862a975cdb17a413030e9bc97e025d9b5eacf7e76b16ada9a568401c509d2d1c507914c56d820be7ea", - "client_login_state": "87700138241d25149a2ca6fd9a27e7f9d71a8e718fe1c411862a975cdb17a413030e9bc97e025d9b5eacf7e76b16ada9a568401c509d2d1c507914c56d820be7ea4c5dbddfb063ecba7fd528c0caec52893ef206bf86362dafb27fe13d96e0b53803b2ee310f831c43b6ecf8683ab3a0f903f4c54d42b5851652667d24a051805e5411fd841fa4c27ed5849632ce256a242c526f1f828e170a68800fa4a7a9c930474c5dbddfb063ecba7fd528c0caec52893ef206bf86362dafb27fe13d96e0b538", - "server_login_state": "f7954aa457f509c7695b9e3313a7a445086cb7c0340f75249544d638fe2faba161395f0bfaeb1f56bfb8c93b56b5cb77e5e63c15d328e7e5bb4310e92cb2cdd867e4fa4ba1fdae0282a7b8dadb9bb30081ff2fd351c3ff24dac160d46e3192cb", - "password_file": "035153b60a0f66ddf3d45d00c6bf6506a0898e6d438f1f73fbec916d538f6b43b042eaa5fe4bb07b55cce02bdc53225886bff138edf3a57a7f28d256d52b1755c84c2bd02fd037cfe6aa8aa243bbf0419c6f4196565470192554bdf3da966ae1d5489d88b7908412724d6c28f209a1c45ff7d509cbdb67b017c08802a4532e04d5", - "export_key": "dfaad05e13c091a4cd11d9342bbf361111bfd7ae0b09866175a6c76403afef15", - "session_key": "67e4fa4ba1fdae0282a7b8dadb9bb30081ff2fd351c3ff24dac160d46e3192cb" -} -"#; - -static TEST_VECTOR_P256_P384: &str = r#" -{ - "client_s_pk": "02ffaa7a9ad8d8fbdf51462333be3baf795e927626afc30a825299b2738be56e64", - "client_s_sk": "867143397117121b3cf8bbbdbb577e7a3ec3de33a5d052e6ea5e736d8da5243a", - "client_e_pk": "02d71ac13b7c461a0aff3ffcf6fb43961f3cc78d159a88190e11814cf8c1c47e63", - "client_e_sk": "e48b752d3f498fbd8e605e95a076f342574b6d6717483fe11a8f8bb1f7f404a9", - "server_s_pk": "03b0c19cb4a9c38a4f8dfd3108d346153612258eda0a918a66898ead514a087484", - "server_s_sk": "799ec708dff22260a940b1daab1bf246f7dc0b3ef36edf5e325e4783ed580b15", - "server_e_pk": "0266a3ee38dd097628288b9f12ddcd8ba2d581dd3f390bc82c88019fb6da84b4ab", - "server_e_sk": "2d40040888e6eabc3ef1192abe45de7e72de591e88f9cb85624f6fe69a829abe", - "fake_sk": "1f63b1381351cdee56bb69a649210a0e401946033210a1d1abb310ee84b057be", - "credential_identifier": "637265644964656e746966696572", - "id_u": "696455", - "id_s": "696453", - "password": "70617373776f7264", - "blinding_factor": "898b728c633b5f335da29527ae279122049cc0a48adde3de699707f9008e58808383b39014554696359c1ff9198092cf", - "oprf_seed": "a681bb60cbc5f65264fbdd29b487fb7eff1bc1b1fad69ba6dad7d802714251fcadd91cbddb9d203be691c99be04dd3a9", - "masking_nonce": "596d13dbdaf0a67f38ab3560f1a8ad539f6879365d2499c35c61822ab457656b5d3102a21c019920324671b47f0c86e6d573179babcd8b87980804a0cec8655c", - "envelope_nonce": "027b3fe224cd45ea4a88125341fb12f903c36665fcfd9f86e20e91b094e935b3", - "client_nonce": "86c1a1f3bf1872e0f19ce42ca68f4e69c0c7fa2bcd0f9728af650b849f35995d", - "server_nonce": "f649bf73c6e0625c8c204a300b6da5f9efcd182634df70175e6cfeb74bbde7ed", - "context": "636f6e74657874", - "registration_request": "03b9f9c8b76887dd8c74246c02bf77a29af14cb5ba2b02e13992db2c8c87f48068c040a9898dca0d4122e42ccf65219522", - "registration_response": "038fe2c1e3b7d968e312b48077edd6545550fcabfdfa25b9420c78c8331dc413028fe973e15270b96673c101ce98c944c303b0c19cb4a9c38a4f8dfd3108d346153612258eda0a918a66898ead514a087484", - "registration_upload": "02e07f9bd7377e8275dd95713f4a8de1a13699f61359b69095cfcada7efbb1ab72b8ff9db6b14b4f8bcb1bf6978cf1b02ce7c75af8d63433d6a75caa620ad851cde67df132e8e71a92c2f6cc137c09ddfd867143397117121b3cf8bbbdbb577e7a3ec3de33a5d052e6ea5e736d8da5243a4f30fd6be311843b3b8309d41a0a11f5f1d42eadc5539959457a6eed12d4adfb599fe45a546effd7dca5dcac5b5ff498", - "credential_request": "03b9f9c8b76887dd8c74246c02bf77a29af14cb5ba2b02e13992db2c8c87f48068c040a9898dca0d4122e42ccf6521952286c1a1f3bf1872e0f19ce42ca68f4e69c0c7fa2bcd0f9728af650b849f35995d02d71ac13b7c461a0aff3ffcf6fb43961f3cc78d159a88190e11814cf8c1c47e63", - "credential_response": "038fe2c1e3b7d968e312b48077edd6545550fcabfdfa25b9420c78c8331dc413028fe973e15270b96673c101ce98c944c3596d13dbdaf0a67f38ab3560f1a8ad539f6879365d2499c35c61822ab457656b967df0a08fb74ca0bbbb915587e55808699b877c9d9f7370e0ba290f3d95e175d66fb98adf8f3aff5b9c06a5dd2a7b5d20a2a76a4f2dc6ef5a67113461a85a03174b585c78445c7a6b1438edd882f75cb56e380f4447e3d366430ca3f2ef372e439b5bb7ac2e1f9dc5b3487232e60a1ddf2d40040888e6eabc3ef1192abe45de7e72de591e88f9cb85624f6fe69a829abe033f366e71bf3f7573a431bac0b35aa60db23b40d2003af7d8eb5f55940b75af3e62ea7b191b1f5b9fae34bb92f0c10b06b95918e784f4afb06c846c254113bdfb3a5b5ca81890dc601dfdb80fabb3865d", - "credential_finalization": "188fe8130fab154ddf481a80349f50685d160e6e1db4d11acdff51e1b5d617032e8a62b39e43116f2ffc3651df61995b", - "client_registration_state": "898b728c633b5f335da29527ae279122049cc0a48adde3de699707f9008e58808383b39014554696359c1ff9198092cf03b9f9c8b76887dd8c74246c02bf77a29af14cb5ba2b02e13992db2c8c87f48068c040a9898dca0d4122e42ccf65219522", - "client_login_state": "898b728c633b5f335da29527ae279122049cc0a48adde3de699707f9008e58808383b39014554696359c1ff9198092cf03b9f9c8b76887dd8c74246c02bf77a29af14cb5ba2b02e13992db2c8c87f48068c040a9898dca0d4122e42ccf6521952286c1a1f3bf1872e0f19ce42ca68f4e69c0c7fa2bcd0f9728af650b849f35995d02d71ac13b7c461a0aff3ffcf6fb43961f3cc78d159a88190e11814cf8c1c47e63e48b752d3f498fbd8e605e95a076f342574b6d6717483fe11a8f8bb1f7f404a986c1a1f3bf1872e0f19ce42ca68f4e69c0c7fa2bcd0f9728af650b849f35995d", - "server_login_state": "6c196b4c6cd855c215852c5c11fd1590038eb9d7c69adc062777e3fed1464526d6a8aafd04e9a5845b32bc92bab852520200c994e54b7c3a8844c75c7952d1c0d2cf5232bd3fe6fa24d7b74e6373ccf66d48ead98331257efc320a16864908f4fce34bf2c26ec5f73072d3522d3b42306dfde8ce0b6827dff1202bd1ca11e767d758b4237c30e30d8878db1ebd4bb595", - "password_file": "02e07f9bd7377e8275dd95713f4a8de1a13699f61359b69095cfcada7efbb1ab72b8ff9db6b14b4f8bcb1bf6978cf1b02ce7c75af8d63433d6a75caa620ad851cde67df132e8e71a92c2f6cc137c09ddfd867143397117121b3cf8bbbdbb577e7a3ec3de33a5d052e6ea5e736d8da5243a4f30fd6be311843b3b8309d41a0a11f5f1d42eadc5539959457a6eed12d4adfb599fe45a546effd7dca5dcac5b5ff498", - "export_key": "431c7293c534c3a555c36ac8b665130066c667b26f86403b3b3e1f06c5e941447f52976265a234fcb0edf4bdef99aaff", - "session_key": "fce34bf2c26ec5f73072d3522d3b42306dfde8ce0b6827dff1202bd1ca11e767d758b4237c30e30d8878db1ebd4bb595" -} -"#; - -#[cfg(feature = "ristretto255")] -static TEST_VECTOR_P256_RISTRETTO255: &str = r#" -{ - "client_s_pk": "027e83df2e0b7380bb430352afc9326a63cd53d6bf6955b60114ae56a9ada8a005", - "client_s_sk": "125dee3f99fd11e6dfc10f3269010644abbe1676856c1fd28c3f1c11fb12e8a9", - "client_e_pk": "02e1a67fc34629e5d0bc6c7d2873673e873514114e15a72a27e71fde337351ab79", - "client_e_sk": "3ba3bfd9cf3b5970a7557260fbd9c1f5480ad2434f3ca788bf0e298e3adb1728", - "server_s_pk": "0363418a22f5e2d041a3cc49ac195bb72c484fe2422756874eea2502b1f37265f2", - "server_s_sk": "9ca7d0b89c84808c6a3a234383f2a400171d0362fd9cd66874a812b29309aea7", - "server_e_pk": "02d3da0962e20af7c63624aff08fcf98f622cdc75d1c475bdec059064cb176da41", - "server_e_sk": "7c7aea17291d0c297fc2685c2876b0b57a67b91dfa7d20edce1872341c86a74c", - "fake_sk": "2fb1ab3f8edf772701cc7c2a4773ac7441fc17157c00132d0bc4df63703953c3", + "client_s_pk": "024233c7da16965cf8dd009c16d6da1fb30678e1a77a8bed62ee4ab0ff19398df8", + "client_s_sk": "7b37ca3a844e38d48f199a982cf584b8377a06c3b0d82075da71c29d7d067a15", + "client_e_pk": "028a5cfff38ac26a0287940c0d0ca4cca86c2de48a0371cb668e4a47047ee407f2", + "client_e_sk": "3b97e770cbf587cfdedcc07d4ed0ee393645c36ee4505d13542061fd1e4075b1", + "server_s_pk": "03e5fd5f2d9a767013c18a9f3848c187ce4b832419420019289888fff4ccd3e105", + "server_s_sk": "344ad6c7f5426b17b06816601d61d2b828d9193d0ac71d4ff457b927d713f61a", + "server_e_pk": "03361978ce9712ef7b94b42b58d9ea705b3f846ca63c0f99375aaff06b995bc04b", + "server_e_sk": "9b226d6b94f4df66246f1fdc57a77333bf29e28b561343a747845a83c89d9974", + "fake_sk": "ec7f397fa39804a8be9559ebe5666c583813b5c0d199150a308408b5cc7d1ad3", "credential_identifier": "637265644964656e746966696572", "id_u": "696455", "id_s": "696453", "password": "70617373776f7264", - "blinding_factor": "5b4e8ccffa209c8df0ec71d0d1092de288ae05e472e71f9f95ff8d4b34a45a0f", - "oprf_seed": "a519f2078900c38d7764481978296720f9b02b472e5aa5e08a32ec1d72c23dc2e3fbd680d367668ce032f45c214aa4efe76b4722f487732aed6c4063a5ab067b", - "masking_nonce": "4e3843835669dac4e6875c1627391e2a5589d4f4a3cfb507f0956c16566feb62692db88b2fbaf002a729a31afecbc016e06b004b11c8f9f53d10430c51db1c9f", - "envelope_nonce": "d9d3327bd827540d1e5f267605c222cd154c5da6dadd43845d8498c58420fc06", - "client_nonce": "246142ff274fe7c3385f6268e7e9c0c1ae2804c664308cec59d2cd0e5af683a4", - "server_nonce": "4f9277be8c0deeccb8c67c5312332ea8fc268360c9a46603c2f5f06f94e45f37", + "blinding_factor": "7f765e59c9005b407dd9d9c80c9b6870bf34d723b463c9ef1bf37062f3a32932", + "oprf_seed": "6e2dbc907c0e8e6ac9b25e9786bce93b2b7c611efbbfe8f0ac6cc49a367f1b53", + "masking_nonce": "fc65e1213c391fc03baabad6f4fb2435d1f4143fd55362a77f6505a848198e72790e68a3d7e699187e7765b018e29330b1aa559c4b01681e3f9f1a122c88cfc7", + "envelope_nonce": "990e155dcd76335a870f03898bc52ce7c206d2a9fba98023d524c9e5eaeeb8f1", + "client_nonce": "1c5ac2e0c8134298298d6fbb27e2a30161548e0ab40b3e1f93fd048893290823", + "server_nonce": "28fb86796e386659fc1be72ecc9452928c864dae3c0bc407694c15b97303b8fd", "context": "636f6e74657874", - "registration_request": "0ca151ef38b3b82f1b2166b6627671943ae8371b207dadfc4c4ccbc93db0fc51", - "registration_response": "ca2757e756faaed5e3956fff22ed9d7f5e7114856b11753b3f84f904831d8c290363418a22f5e2d041a3cc49ac195bb72c484fe2422756874eea2502b1f37265f2", - "registration_upload": "0273a4a83ef4a4c014623a59d3188370e4592b0c1d2d695dda98a07339a1536e77c5aab89c3434cfb25289d087d3f35680d82a3eaf34b539317a82a219652e2bc1b151f423e945eab65a598624a9328265f91a8e69f5975c7517905db6091894b2125dee3f99fd11e6dfc10f3269010644abbe1676856c1fd28c3f1c11fb12e8a90944628ebe4b83026cca4f2b719ab0e836c01f42bc854a2262f7f0cfcf83b026426371c91a3a3f6ebc47225e092b76fb54636aec37618815f2ba0f9da6290def", - "credential_request": "0ca151ef38b3b82f1b2166b6627671943ae8371b207dadfc4c4ccbc93db0fc51246142ff274fe7c3385f6268e7e9c0c1ae2804c664308cec59d2cd0e5af683a402e1a67fc34629e5d0bc6c7d2873673e873514114e15a72a27e71fde337351ab79", - "credential_response": "ca2757e756faaed5e3956fff22ed9d7f5e7114856b11753b3f84f904831d8c294e3843835669dac4e6875c1627391e2a5589d4f4a3cfb507f0956c16566feb624c697ec15f81508a6d26927d6240ec09672cc5c6afefba3e6ad828b722c2f13ad1814ee338fbe739ce915c8c77e65a0c1c6baf42e96474997c9eaf8a3c828bf609f60be9d98b30e4d86b14717b16929839e77583d990205a05689ac46773e83e6b35f95770c9c5919484c4e9bed34a85d1ee7db3f9914329f9f559bbed677f8a457c7aea17291d0c297fc2685c2876b0b57a67b91dfa7d20edce1872341c86a74c02c44f9047c059de10dc36ce904b3f1754dbee6b1e0657a194d563db45348198b3448dc365a3112a25c17fd5d02837cb4cb342ca831ba383b61ca684f9afdad1dab235ecd48f3c093bce9ca95449a1b26f7f2cb51b882ee5757ab3b99a078e0670", - "credential_finalization": "156511d3bed0e04bb931e21d4e01203ecb8035c8f2a13203a6d7c76156bd98c70161ec4dd434a0da576d7841483d2d6468e2d2df6b046a132a13a148be9f2ed9", - "client_registration_state": "5b4e8ccffa209c8df0ec71d0d1092de288ae05e472e71f9f95ff8d4b34a45a0f0ca151ef38b3b82f1b2166b6627671943ae8371b207dadfc4c4ccbc93db0fc51", - "client_login_state": "5b4e8ccffa209c8df0ec71d0d1092de288ae05e472e71f9f95ff8d4b34a45a0f0ca151ef38b3b82f1b2166b6627671943ae8371b207dadfc4c4ccbc93db0fc51246142ff274fe7c3385f6268e7e9c0c1ae2804c664308cec59d2cd0e5af683a402e1a67fc34629e5d0bc6c7d2873673e873514114e15a72a27e71fde337351ab793ba3bfd9cf3b5970a7557260fbd9c1f5480ad2434f3ca788bf0e298e3adb1728246142ff274fe7c3385f6268e7e9c0c1ae2804c664308cec59d2cd0e5af683a4", - "server_login_state": "00f0c2c254202ccf13ae33839e39a895a23778a8063334ba699cc4157646951fac5da2dc3363fc5cf051157b5f092c1d662ebe258211b02a051335aed2372387e8de8436dcd35b59eed28f6ca2cd4a0e969456e435393fabd0aa6b5e437018c49697c130b7075c7bc3deedb60ead5dd3b4b1f1cd8a86586f26fb1fca907bf27c9c97cc96869f519d4139e5ed967f4b82cee172a06c72702699d194ee49424bf11f73bf6ea75fe40712b3e9c7ae85328a02dacb453f7a95820836026f20dd4815", - "password_file": "0273a4a83ef4a4c014623a59d3188370e4592b0c1d2d695dda98a07339a1536e77c5aab89c3434cfb25289d087d3f35680d82a3eaf34b539317a82a219652e2bc1b151f423e945eab65a598624a9328265f91a8e69f5975c7517905db6091894b2125dee3f99fd11e6dfc10f3269010644abbe1676856c1fd28c3f1c11fb12e8a90944628ebe4b83026cca4f2b719ab0e836c01f42bc854a2262f7f0cfcf83b026426371c91a3a3f6ebc47225e092b76fb54636aec37618815f2ba0f9da6290def", - "export_key": "47c8aeb7e4b5fcb65728f8b2b07e7d0112496c3e72e5ecb17f00794e90d00fb4e4a9f8f2dccfdd19df8302e3c38d2b7f819ff373c3c829e34705e54dd95fcb09", - "session_key": "9c97cc96869f519d4139e5ed967f4b82cee172a06c72702699d194ee49424bf11f73bf6ea75fe40712b3e9c7ae85328a02dacb453f7a95820836026f20dd4815" + "registration_request": "02626e2a7d0a3a65c5ce26319ffdcd8f12749597288d5a3f056a85061d440b3134", + "registration_response": "024881b1756686787aa2c9379842b3c043be2bc2160f8399388566df186aca076203e5fd5f2d9a767013c18a9f3848c187ce4b832419420019289888fff4ccd3e105", + "registration_upload": "02b2c2080e85eb9be5fce9af315ebbd582b97a888bc38db41eb3ff89d150094c4ee1897cecbb1eb404c07cb336778480ce59b45be07417b62c6065509d743081bd7b37ca3a844e38d48f199a982cf584b8377a06c3b0d82075da71c29d7d067a15290f38d81d8afca3b0b9f8fd39d43695c3ff00c9cc65dffa80c81d4346c4c231", + "credential_request": "02626e2a7d0a3a65c5ce26319ffdcd8f12749597288d5a3f056a85061d440b31341c5ac2e0c8134298298d6fbb27e2a30161548e0ab40b3e1f93fd048893290823028a5cfff38ac26a0287940c0d0ca4cca86c2de48a0371cb668e4a47047ee407f2", + "credential_response": "024881b1756686787aa2c9379842b3c043be2bc2160f8399388566df186aca0762fc65e1213c391fc03baabad6f4fb2435d1f4143fd55362a77f6505a848198e725bc35e08a2b8eca1fd54f864f551bbb26aca647e8a7fa7865d9da84c3cb9aa9e7c88a0643d3c2d83f722bc0f961bcfbe08b041e6010fd42e070411df6a00032b38a649251a11fcdade4133d9392a83163150617d97f66304bd2cd82b8dea34003b9b226d6b94f4df66246f1fdc57a77333bf29e28b561343a747845a83c89d997402dd41500c28354a2b4c2e99723d4e2c663032803766576eca885ba1e16c141093e3f50476135f37f2f0973be22ab0723f264bc54b48c8b7814f578c20145b1a62", + "credential_finalization": "4a4dc7da190d96ca9a464e97fd87caac8a6a8284dca988723392c4ff55e9ee19", + "client_registration_state": "7f765e59c9005b407dd9d9c80c9b6870bf34d723b463c9ef1bf37062f3a3293202626e2a7d0a3a65c5ce26319ffdcd8f12749597288d5a3f056a85061d440b3134", + "client_login_state": "7f765e59c9005b407dd9d9c80c9b6870bf34d723b463c9ef1bf37062f3a3293202626e2a7d0a3a65c5ce26319ffdcd8f12749597288d5a3f056a85061d440b31341c5ac2e0c8134298298d6fbb27e2a30161548e0ab40b3e1f93fd048893290823028a5cfff38ac26a0287940c0d0ca4cca86c2de48a0371cb668e4a47047ee407f23b97e770cbf587cfdedcc07d4ed0ee393645c36ee4505d13542061fd1e4075b11c5ac2e0c8134298298d6fbb27e2a30161548e0ab40b3e1f93fd048893290823", + "server_login_state": "c084be73543caee016de23f6987e9d9db9ce8a39490127388f7cfc8d73f7c37ba5ebebd95e175ba698748629e95da35b2750f870919bdeb0a80b5ac8988517f366adf6480ea66dec3384cf202fa979bb3501e0cc4c8cea8a268d5561cd45ce95", + "password_file": "02b2c2080e85eb9be5fce9af315ebbd582b97a888bc38db41eb3ff89d150094c4ee1897cecbb1eb404c07cb336778480ce59b45be07417b62c6065509d743081bd7b37ca3a844e38d48f199a982cf584b8377a06c3b0d82075da71c29d7d067a15290f38d81d8afca3b0b9f8fd39d43695c3ff00c9cc65dffa80c81d4346c4c231", + "export_key": "d8e44930ad9ae7e1e5d83dbc9b5fd51b814280864aa10e39e62aa07c72458c86", + "session_key": "66adf6480ea66dec3384cf202fa979bb3501e0cc4c8cea8a268d5561cd45ce95" } "#; -static TEST_VECTOR_P384: &str = r#" -{ - "client_s_pk": "02d30caa7523fe782794a4dafdc34b236b3ef01a887ed6f705ff4644cb06df4140cfeaeeeb123d8a4394c485cf6c930fab", - "client_s_sk": "26f4f688d5c314da59d08a7672d444ff48c3580fd02ed9998a3906d507c506bf7059f166bec930032afc7fa59fdc6455", - "client_e_pk": "022d5b9d95e3686a8274435bf61414a0a371bd1351760fed07da6b281a419aef32c1b9b1eab59222111198d30ed63c7cbd", - "client_e_sk": "319076296bb7ce07bd9d383d7bfc6544222b99938e0ec627e7e284391f55e6a98b076a7843f383cbe802a907584fd271", - "server_s_pk": "03801a686045ee201b54f8367fc5a3ce577a5310b6431eadbf4abbf2f87213cf8b3853875f7f7badb10d029fe0c6f1cad4", - "server_s_sk": "209af74445ade701f4a99011c8e7304e3914ef9101fd92ea8b62d8ae6220a446cf544ca0eaf22552a21b149fc5e12008", - "server_e_pk": "021fdb138cd5b99a905285673be1b62085de588b4921ea35f3188aa6d4a57159d072ebda60a163996641473cd82e917633", - "server_e_sk": "061bc6ed455e852e8ad7eaf6836bbf061642043e48aef18416575071dc976577296eca9902af72c0d59e324e96abf34e", - "fake_sk": "3232e916073a895b65040efcec1a4038bf2fc4c41f8ae2e66bbccc5cf9ce8e31ca84e609b29af7207556452a4ebcf023", - "credential_identifier": "637265644964656e746966696572", - "id_u": "696455", - "id_s": "696453", - "password": "70617373776f7264", - "blinding_factor": "6522c4e1432f30cdf2d3ad20ddb2677ef444a9447ccb643992a545ed1c9a8c255af28ec952ff87046256a0d942c4be48", - "oprf_seed": "0b2ab841c8c79a53710e424a768939d9a36fc5baffc4fad5e8731736c831b3750f61010140ef62708b58dbc0734c4228", - "masking_nonce": "3df9ef31bbf2e58364690728a86862b5bb9b6cfb874631006b3fc8da98e13c4a196cf0ae225742a918be575c1f98c5c54ccaa679c55693834d2d7e0ad7374f29", - "envelope_nonce": "b358bd034c790212f83b8b9d2f1373a5067314392e244606292856afc9020405", - "client_nonce": "c14909f325841eed32aae25899d84c7044c2223e58a18f715977df310e2c2e7d", - "server_nonce": "8c4e71dab0435f22238d5e1ae8686d694ca8f6f0131ad5e106b6a909a53de050", - "context": "636f6e74657874", - "registration_request": "03182483430a1dcccd138466a63f05f523e44f2d0078fd9f21d0c3e145137437ca75f187d38d0d2b806b0c1f21fde2207f", - "registration_response": "0256a3f872e6307d2b7c93aee4573a3d18a61ac0cff31d5e2de354f36728663d4f491a040d1b88f2abd7594f2e5cd130fa03801a686045ee201b54f8367fc5a3ce577a5310b6431eadbf4abbf2f87213cf8b3853875f7f7badb10d029fe0c6f1cad4", - "registration_upload": "03c8c502f79257e6d92cbfe79767b539fd4e0dbec4fc6543bf9191587986a6e205b899f38ee12a383420488a69d6ce104478ee84a8c4031e77d13a8a8d42041d78ff48e67a970e399d4333812ae0579fa18b2eebcdf6c6fd3f1d180bca053c941726f4f688d5c314da59d08a7672d444ff48c3580fd02ed9998a3906d507c506bf915bdbf6215beb014ea81a290fa38804957f72f2b7473bf33d7e7cecf84f3edf5c67aeebae6b538c6a629a9046719966", - "credential_request": "03182483430a1dcccd138466a63f05f523e44f2d0078fd9f21d0c3e145137437ca75f187d38d0d2b806b0c1f21fde2207fc14909f325841eed32aae25899d84c7044c2223e58a18f715977df310e2c2e7d022d5b9d95e3686a8274435bf61414a0a371bd1351760fed07da6b281a419aef32c1b9b1eab59222111198d30ed63c7cbd", - "credential_response": "0256a3f872e6307d2b7c93aee4573a3d18a61ac0cff31d5e2de354f36728663d4f491a040d1b88f2abd7594f2e5cd130fa3df9ef31bbf2e58364690728a86862b5bb9b6cfb874631006b3fc8da98e13c4a42035f0afefe847d522d37a6a7e40965f1c81ebfda02b4632df08d7f8136ed222dcf9c723cefa9deb7fb60a4df1682bf9ff2906db5af47728b8ca3815ce820c4677787e631a39e6912ba7705a634c251bf420771a9cac8436a2b53b524b60f9e0047d97bad37d741e5abaf710b9c81bff8ed6d84a319c62dcbab952221e0e9d9511642043e48aef18416575071dc976577296eca9902af72c0d59e324e96abf34e025a82f2ecec7de30ae500fe0efc1b9b6bf925d0ec00b2e21e8a446acc37f063f5f77703d6cc87c3c688f4430fd8c6875a8abe86e344e263b4a450dd7a4684f26052c244defcec09768c6d305b73e09d8e9135228d98c8b84cc586d8cff97bb675", - "credential_finalization": "8c0e0cf31d1490a4678994bc4f47e8a5e1b4380d770881d000370ad8c5ef3ffd2e8d7f6101e9411e453a367a65ff146d", - "client_registration_state": "6522c4e1432f30cdf2d3ad20ddb2677ef444a9447ccb643992a545ed1c9a8c255af28ec952ff87046256a0d942c4be4803182483430a1dcccd138466a63f05f523e44f2d0078fd9f21d0c3e145137437ca75f187d38d0d2b806b0c1f21fde2207f", - "client_login_state": "6522c4e1432f30cdf2d3ad20ddb2677ef444a9447ccb643992a545ed1c9a8c255af28ec952ff87046256a0d942c4be4803182483430a1dcccd138466a63f05f523e44f2d0078fd9f21d0c3e145137437ca75f187d38d0d2b806b0c1f21fde2207fc14909f325841eed32aae25899d84c7044c2223e58a18f715977df310e2c2e7d022d5b9d95e3686a8274435bf61414a0a371bd1351760fed07da6b281a419aef32c1b9b1eab59222111198d30ed63c7cbd319076296bb7ce07bd9d383d7bfc6544222b99938e0ec627e7e284391f55e6a98b076a7843f383cbe802a907584fd271c14909f325841eed32aae25899d84c7044c2223e58a18f715977df310e2c2e7d", - "server_login_state": "79814d2b3ba60f503d5ac2a71cf10e66ef8f0d3af2cfcb20898415721147c48458b752bbd88d86c3399addfe7e1adca52f32055b893d59fb1b4c16b8bca49a6c425cb713061ea35d73472b9a70059f9007e0e881d934ae2d2f8b2cfd2a2ea2607aa2592bc9b387e4776df01efd287465a729a66b17550afd9a540536c437e89084d101d66afbf0be092f4b0ab1167ac4", - "password_file": "03c8c502f79257e6d92cbfe79767b539fd4e0dbec4fc6543bf9191587986a6e205b899f38ee12a383420488a69d6ce104478ee84a8c4031e77d13a8a8d42041d78ff48e67a970e399d4333812ae0579fa18b2eebcdf6c6fd3f1d180bca053c941726f4f688d5c314da59d08a7672d444ff48c3580fd02ed9998a3906d507c506bf915bdbf6215beb014ea81a290fa38804957f72f2b7473bf33d7e7cecf84f3edf5c67aeebae6b538c6a629a9046719966", - "export_key": "b05096e7ff9666fb3845c8ef552b69332b96d3ee63ad46c3da497d0ea85bbe8ee866f7fd606f958ecd08a2100adaa8fa", - "session_key": "7aa2592bc9b387e4776df01efd287465a729a66b17550afd9a540536c437e89084d101d66afbf0be092f4b0ab1167ac4" -} -"#; - -static TEST_VECTOR_P384_P256: &str = r#" -{ - "client_s_pk": "0254911f1d17aee72f5b891cfaeb8d0b0e68e9db9fb25f2dc42d672382f45b01e559639dc93a21a294461318be76144819", - "client_s_sk": "526e10a69a7f9c7ae685defcd8dc4f23f2b668f63cf558c9d76cdb83bbb5b216ef9e91763fa2e015c66ec827316131cc", - "client_e_pk": "03a01066dccb456e0e4a238d7afd1dcc788283154f0f7936295b950b316c66d0f52376b26e64585da98308c1ceea732c93", - "client_e_sk": "6de338c62147b2f5cd9579109b40584768e7dc1ae451f7d566fb28011bc13c180f3f1001a700c59488716b45011ad5e6", - "server_s_pk": "03df5ea7a932ff02124130743543236f3b8de290a1f27c8b9d518112beb72c527a8818a13914cf27c2375f75f832a23093", - "server_s_sk": "fd59eb004849e24eb70cd7d6e1ddcd87afae0743b82f2921c0bfe093831db2f17d031c4d63af482c778002394e3cb9ae", - "server_e_pk": "033b51d2ec7c6d8db890b5dbc0eaf13298ff25eb516249c2f367d84cb45d1717ed55f1b46f8b142ca899d480cc8a493e86", - "server_e_sk": "81443e69a1cc93d7a779235de18be512a0bfc4a2288b16e5323092e54ef4139dac21ed831d34e78e7d03dff908cae373", - "fake_sk": "05ef5e97565fa9fc1f485e4aad8516ad9104533397b2bac011aec371c2e98938a9b09b66fed328d4c9ca7bd1c941792c", - "credential_identifier": "637265644964656e746966696572", - "id_u": "696455", - "id_s": "696453", - "password": "70617373776f7264", - "blinding_factor": "3f3ff410cb7927e1ffe1d1c0f0d2360f49ef04effc2242782f155c858b50c4d6", - "oprf_seed": "9c98df8aaf13048694099325ff6bea1ddee273bf632e192c25fdf4a748d95a91", - "masking_nonce": "e4315a82379378b7d190c95a24d62871ec68b6b47f206d03a9ae0c27e6397556f50ecae65da56ee71155638cfdc932e8ec1997c16a96be1f55631977618c0b09", - "envelope_nonce": "26c52be641cd24569f0b566bb6fc3a8f6490229bac9ffef3345170be8d1135e4", - "client_nonce": "0f0f56edf27a8591093e280f79f6b304a003a4aab3565a59d4c4f6ea1e27e76b", - "server_nonce": "42679ba32e3301bab082c2d9580ea367cd8b737f422315329213c8b0dd5c2254", - "context": "636f6e74657874", - "registration_request": "030d2425e25d95ca6380beac64813feb5b127681fc2d3d37814a453f3815fb28dd", - "registration_response": "02c4610c2be8d4e308b8a31d9f4ea07686631b8237adfd7bbebd8c8c3be951d7d603df5ea7a932ff02124130743543236f3b8de290a1f27c8b9d518112beb72c527a8818a13914cf27c2375f75f832a23093", - "registration_upload": "02120a5aada0251e2a005bddd90a69003b97b8343467a25010e5a5f444c3cfb74ad562c4b4dcb66dc4083a81516e99cf0f4b77b4a187e359ada76ffcc29ba6e895aa3e2b1386be6eed16ad865b92d4f130526e10a69a7f9c7ae685defcd8dc4f23f2b668f63cf558c9d76cdb83bbb5b2162335ec8cc8815e9d4e604a48e1248be2bd92015103fe0396a167d7f5e031c640", - "credential_request": "030d2425e25d95ca6380beac64813feb5b127681fc2d3d37814a453f3815fb28dd0f0f56edf27a8591093e280f79f6b304a003a4aab3565a59d4c4f6ea1e27e76b03a01066dccb456e0e4a238d7afd1dcc788283154f0f7936295b950b316c66d0f52376b26e64585da98308c1ceea732c93", - "credential_response": "02c4610c2be8d4e308b8a31d9f4ea07686631b8237adfd7bbebd8c8c3be951d7d6e4315a82379378b7d190c95a24d62871ec68b6b47f206d03a9ae0c27e6397556e9aa0bfbbab92e92dd3a8e20799eba9ca690e2a7178256c394d413e9ea29321322ca32d89b4988835bc56366def8916684bdf2a06198f9535f898e35736ac1679925faffb6584c2ddf7d38185a095c5a471073142df269826c8a7baadf69ed8a3923d7b2a7073dfb2aeb780b75ab8cc991a0bfc4a2288b16e5323092e54ef4139dac21ed831d34e78e7d03dff908cae3730304fd477b4439cd862643630c4c141dccb9794d02228624d7fe1394c388fbdcdcfc6d522119b53354745e51e114f9ea1d25057b52c5403716ccf21ff0c3c22a946d65d3272add1236b8c8c0d01f801282", - "credential_finalization": "aad107b4b6396ef9ce3233c46992276908c3490026164817aec4b3ee301821a6", - "client_registration_state": "3f3ff410cb7927e1ffe1d1c0f0d2360f49ef04effc2242782f155c858b50c4d6030d2425e25d95ca6380beac64813feb5b127681fc2d3d37814a453f3815fb28dd", - "client_login_state": "3f3ff410cb7927e1ffe1d1c0f0d2360f49ef04effc2242782f155c858b50c4d6030d2425e25d95ca6380beac64813feb5b127681fc2d3d37814a453f3815fb28dd0f0f56edf27a8591093e280f79f6b304a003a4aab3565a59d4c4f6ea1e27e76b03a01066dccb456e0e4a238d7afd1dcc788283154f0f7936295b950b316c66d0f52376b26e64585da98308c1ceea732c936de338c62147b2f5cd9579109b40584768e7dc1ae451f7d566fb28011bc13c180f3f1001a700c59488716b45011ad5e60f0f56edf27a8591093e280f79f6b304a003a4aab3565a59d4c4f6ea1e27e76b", - "server_login_state": "2bee3adc9a7db1e964fd11f6b0a4cc87286762fa7548ab5d3393966f19da7cc5ca72928b4ad955a857ead83fe4a375afb7bb050f8c09c755823d7062e52c37bca3853ad81a963f92049b08f96b940e17cd5f2a8767714c5e28be1c5fa95a8d26", - "password_file": "02120a5aada0251e2a005bddd90a69003b97b8343467a25010e5a5f444c3cfb74ad562c4b4dcb66dc4083a81516e99cf0f4b77b4a187e359ada76ffcc29ba6e895aa3e2b1386be6eed16ad865b92d4f130526e10a69a7f9c7ae685defcd8dc4f23f2b668f63cf558c9d76cdb83bbb5b2162335ec8cc8815e9d4e604a48e1248be2bd92015103fe0396a167d7f5e031c640", - "export_key": "3cf2a36cb8f9df152f797718fbdead0dac400eb45300e6c93fa40c0b42713795", - "session_key": "a3853ad81a963f92049b08f96b940e17cd5f2a8767714c5e28be1c5fa95a8d26" -} -"#; - -#[cfg(feature = "ristretto255")] -static TEST_VECTOR_P384_RISTRETTO255: &str = r#" +#[cfg(all(feature = "curve25519", feature = "ristretto255"))] +static TEST_VECTOR_CURVE25519_RISTRETTO255: &str = r#" { - "client_s_pk": "02cc4db2cf4cd01a188ad2d24f37c13d542253202a15c1967fbc01ff3c67ec3976a09d950be6e61fd331ceee6c73afe071", - "client_s_sk": "90a2c638013427e671591d125152921d0d18a84a6de44fd7b2b58e139b295628c137d26fc8e4b31e3d23e0a886aa70e2", - "client_e_pk": "031c9d7101bd543a64537944c7ffbef579852d03e109386d1cb7d40438a494a3f466daf8ce56866ff94cca71e4c8a4baf4", - "client_e_sk": "6e84980c5aaa6d78d3d634668b9a8427219ebf3da0dbc364d41cf29549c8dbecdcf55c91794b1147ed1f80b3f21aab9a", - "server_s_pk": "0330a19238b845ed798b626d991645d5454b35bdf78c1aaaa8370ca1ee90839bdfeb3022f0967103a9bf7dd65f0bd764e7", - "server_s_sk": "c947228ef3e8f98e14dcf8d44209508133425fa3ecd5b5dea57271b34619ec78503954df1c0d8a17067fdea51568feb0", - "server_e_pk": "035ec4661b6d7d838d34438a683e2260be53e49adf362f7e68e366d4eada87a475c98898f57b38f89777f470f33056a5f5", - "server_e_sk": "91d5f270837a3109f011a0fb1dc05fb26cb6c312dbaf5258d9c731a581e9398134cb0c5cadad0b09aeb1bbb1856973ac", - "fake_sk": "440fc2ef4f616072e5cc984cb49a0a6100d8ba22a002b4a7e88baf000da81acf26399e0cb1277cd55e4cbf0d595714d6", + "client_s_pk": "f535ff1f431781ebdf247ba474600b35900c78bae062b78bca336f93125fae78", + "client_s_sk": "a2965d641d8faac6d78929faaea9d849260374dfbc48fcd8508d619e91549e0f", + "client_e_pk": "41b9b9e40898537c1afc044ea4362a91b0688841a2f8ac7576799ea554b9955c", + "client_e_sk": "3462f1906981bf3849bdda9e4fb11f227aa1ce36715fbab787137d9293877804", + "server_s_pk": "c3bb58d0ab702a78cd49c49ed666445715a3a9031352988fa3b8b5354f234555", + "server_s_sk": "66db13a9043ba998acf4c025817c212a679998aca94e284d92d7a3e624918405", + "server_e_pk": "092c508e525c26d207f26e08f31bc3d3da93280260b959a2b422f61365336266", + "server_e_sk": "a45b6ec2746a0930da83e7be61fec440b8101a6da0057684d552495818945a08", + "fake_sk": "b58d23d86aa0cdc9baf29cf03f6d1362e96980ea2e33b0407dc8e213ef31f40e", "credential_identifier": "637265644964656e746966696572", "id_u": "696455", "id_s": "696453", "password": "70617373776f7264", - "blinding_factor": "18b3146671040f5e23f8df4e40411af98c64f356f34d4abdf8e7023c173a130e", - "oprf_seed": "d79e4976efa4866928d3e4fe7e463ec9e1ed756b67a2b156a991ce8c08b7a5d351d42f6e79416d30cae9032afbdedd4e46a360d3a67a2c088cc4f17f23cf548a", - "masking_nonce": "f28da85667feea48ee90660484e463b5a3e9c26d78ee966919413e28e5e3298314a233fe33720e72f2086e9adafa8f3ed4b994271e764a836572492e0706b6c5", - "envelope_nonce": "b33217f0bfca84df0f5c0e06944d7099ae657138e093e8b8fbd06886ca704f1b", - "client_nonce": "6d6547ddbb040af90fd6fcd961e605ed2eec4c2dee24ae729f5145eaab8c3867", - "server_nonce": "90901fa0e77d2e184ea1cde30eecd25e7c076245fb9ed40dcf2e64249d58c0be", + "blinding_factor": "ddd58385737d8c20704c0cb1a3a966bf34e74f0110fed80f1beff71b5f595c0c", + "oprf_seed": "a73d9a1a8258fb9e07525bc7ec95ec099b781674b1b8af4293062f5f8929ba600ce3e430a1604a6264eb234b6380bcaf7ebfe8c094c6ad512a66d90465ea1b24", + "masking_nonce": "75c3c3c4131c481038ed136f2aa8f73cb721336e8932aec3a4afa7a807bb80b9064711750bf956f5c87b0fbb2237e4a8dce44c5b5a556ee7c9878fff08a7703c", + "envelope_nonce": "2a19eea1b3a01bd1654e550c248e376280920e1512109d6193e6d384d4b9c78a", + "client_nonce": "e211715a5e81960e9645812027b02eb2bf1a29fc7c40706fbf7d89372bdcfff4", + "server_nonce": "d7b113083e27e038199d4d8e536a16d9cacded41a1ab1baf861ee2bbb3c64a08", "context": "636f6e74657874", - "registration_request": "b4ab9b7315e3a66face7d81f24d8e2d538e6a09acb929fa3990d8fe3f5cdc665", - "registration_response": "aa9159f5472d0f32d06205095eeca6cf2bfb402e2174120b1bb2d42719c5f93b0330a19238b845ed798b626d991645d5454b35bdf78c1aaaa8370ca1ee90839bdfeb3022f0967103a9bf7dd65f0bd764e7", - "registration_upload": "02c1c9a0f2a01152ca24c81449e4d86c9d88f2709fc5e8c03c368b8952eae9ef9485a9dc65cf9cee71991266a9c339122601b02d1deee0df0ae3d4cd90cd0ee7b775cecaf73519fa7b1744344dd8f667f566c7fff174152c539fa0e276135862cb2581154db6ce754b594f13c4cdc7649d90a2c638013427e671591d125152921d0d18a84a6de44fd7b2b58e139b2956288a1c235698eb9f64a9b3ff2392a2f927c724a4bd9eac605f445d744614ccd15ed9222d0d0c6a4ba5c3edfa58b2ba386b9cfdb23229c2baf9cd01d30cc6a4267d", - "credential_request": "b4ab9b7315e3a66face7d81f24d8e2d538e6a09acb929fa3990d8fe3f5cdc6656d6547ddbb040af90fd6fcd961e605ed2eec4c2dee24ae729f5145eaab8c3867031c9d7101bd543a64537944c7ffbef579852d03e109386d1cb7d40438a494a3f466daf8ce56866ff94cca71e4c8a4baf4", - "credential_response": "aa9159f5472d0f32d06205095eeca6cf2bfb402e2174120b1bb2d42719c5f93bf28da85667feea48ee90660484e463b5a3e9c26d78ee966919413e28e5e329838f55cc8db1b7a3159515f4f8659424bec2003f52ddc1cacf3375ebc99ce25796776206afc2336e9eac2526801f3dc865ea4f41312342de7f0380a3dbf19d07fca963efbd55279d227397bdd4061f0d6018f8e921568a13a48ead1841adb79e6fccca36e58c831e08ba390d374b54d2ea57872867e522510a5b5acd6e8db6eea17728d8193047d15a92c6b7ccc21f731a286cb6c312dbaf5258d9c731a581e9398134cb0c5cadad0b09aeb1bbb1856973ac02a333fd1a99cd9efdc223198828ceb73535ad7583f8b2d1a660e9111fb90e7d59699c6a59b7222ffef86be508701cfb16327891268981272101c472e0018e8f685976e9fc02a760a05c4260477400092cfb9e57f91c487194cbb6eee9abe2d99957151a0f11bcfee0fe3862012119847c", - "credential_finalization": "4a6ecd34b51d45a77f34f8a959dbac7e507c749ec869eb936d6c591691f74c13c8906a9e02071768eb28f6f0244e9a673c42bdbf326319c5ae93a8837fad2a5b", - "client_registration_state": "18b3146671040f5e23f8df4e40411af98c64f356f34d4abdf8e7023c173a130eb4ab9b7315e3a66face7d81f24d8e2d538e6a09acb929fa3990d8fe3f5cdc665", - "client_login_state": "18b3146671040f5e23f8df4e40411af98c64f356f34d4abdf8e7023c173a130eb4ab9b7315e3a66face7d81f24d8e2d538e6a09acb929fa3990d8fe3f5cdc6656d6547ddbb040af90fd6fcd961e605ed2eec4c2dee24ae729f5145eaab8c3867031c9d7101bd543a64537944c7ffbef579852d03e109386d1cb7d40438a494a3f466daf8ce56866ff94cca71e4c8a4baf46e84980c5aaa6d78d3d634668b9a8427219ebf3da0dbc364d41cf29549c8dbecdcf55c91794b1147ed1f80b3f21aab9a6d6547ddbb040af90fd6fcd961e605ed2eec4c2dee24ae729f5145eaab8c3867", - "server_login_state": "2e28f843e78b3a64e90d4fe4e69e6c905a6f0dc88ec4da004cc6aa83709f5f62631c0359489957187f9bbc1e188a9577cd839e20210ae14da99c921d779a7e7b05542f09b2fa76e5ab43a73b14f3b4be10d14c56271eb1a5a1ee01ef781d220321ca21deaf632855aa442d91f32b6f4d89c5b87cadaf158b93cf71c0c84b7f7ec26fc66b9419dbf492de4a2e9874ef8002c792726b7dc1db770453a5eb1dc94fe245885e7d3aa33ed6e262db3b9344624a5d92b97521a169c78f837d8e5a4f7b", - "password_file": "02c1c9a0f2a01152ca24c81449e4d86c9d88f2709fc5e8c03c368b8952eae9ef9485a9dc65cf9cee71991266a9c339122601b02d1deee0df0ae3d4cd90cd0ee7b775cecaf73519fa7b1744344dd8f667f566c7fff174152c539fa0e276135862cb2581154db6ce754b594f13c4cdc7649d90a2c638013427e671591d125152921d0d18a84a6de44fd7b2b58e139b2956288a1c235698eb9f64a9b3ff2392a2f927c724a4bd9eac605f445d744614ccd15ed9222d0d0c6a4ba5c3edfa58b2ba386b9cfdb23229c2baf9cd01d30cc6a4267d", - "export_key": "d22fbb27898c9d010471f75d5c914cc96543a381e895660e9650f718bbd410c3d1fdee25d251af597cd21bd1b4165861e19bc424dc9cd9c9381cc278fa812b38", - "session_key": "c26fc66b9419dbf492de4a2e9874ef8002c792726b7dc1db770453a5eb1dc94fe245885e7d3aa33ed6e262db3b9344624a5d92b97521a169c78f837d8e5a4f7b" + "registration_request": "1e7066e92f802e894edc3383c84a30d9941dff5ae4bae093aac6249d7307fb4f", + "registration_response": "4ac42b2850dfa252c98ddf441ad4f2d39d195fa6d966326a971a917d9bf2a83dc3bb58d0ab702a78cd49c49ed666445715a3a9031352988fa3b8b5354f234555", + "registration_upload": "18a37ef21ebff958b228f6b0a4aa66764a20b438393a380833dc73bf05da8c4043a1d396008b10207c4a2c6c6c2a1bd1fff443741102e6884eb58236cd27c2c09626b7c2df397a8473337cfb760d4dbdfe8f50a26696d6c41f9f4c2086ab0957a2965d641d8faac6d78929faaea9d849260374dfbc48fcd8508d619e91549e0f1f13d125c3dc2fc99a3fa879d3a914202afae68113902a60a44266febeca8521fab72bcb5fddd144768fc59bcbe759e328b09aeffbfb906627ddfe670342a358", + "credential_request": "1e7066e92f802e894edc3383c84a30d9941dff5ae4bae093aac6249d7307fb4fddd58385737d8c20704c0cb1a3a966bf34e74f0110fed80f1beff71b5f595c0ce3c5ca3e5d685c064f212bdeba8f58804cc2b7c3732cf87f9c541444f1629970", + "credential_response": "4ac42b2850dfa252c98ddf441ad4f2d39d195fa6d966326a971a917d9bf2a83d75c3c3c4131c481038ed136f2aa8f73cb721336e8932aec3a4afa7a807bb80b9d2ce565f318da629a658c9b653853e649ccbe4ce9cd46a904f4352a67140bc9e44ccfb5823a385fd29f7ce9d4711fe8e4b4e050c62c7e041ec2c6bf82e84371c802a360dbdbc9614363ac2830c60624ab77d1de45eef3b15326a988a6862b0315dd5a0a966130f724c2265db5b04a8bf772fb57a5643c05f88daf3b89a6fb0c7d7b113083e27e038199d4d8e536a16d9cacded41a1ab1baf861ee2bbb3c64a084f2de1632c9028867527905d5a84a3dea08ba32b61db5cbc17c104ac09386d7a6b6483a41e1649ec4925eebb3b3f145c4b5abd046f49fd28c6345cb7c81b93aa73f57fcf10b04ad118e6cb532c522547aa379556d0a5f81125c1028a680de0ec", + "credential_finalization": "f9310bbda0fe43f1b6a66ab862ae57e27a7e0753c5039da335e44da00beaab2108c02286fe673ebad2f04ed66d0d891a9f493166af1b1bcddd5950fa9a5d2d73", + "client_registration_state": "ddd58385737d8c20704c0cb1a3a966bf34e74f0110fed80f1beff71b5f595c0c1e7066e92f802e894edc3383c84a30d9941dff5ae4bae093aac6249d7307fb4f", + "client_login_state": "ddd58385737d8c20704c0cb1a3a966bf34e74f0110fed80f1beff71b5f595c0c1e7066e92f802e894edc3383c84a30d9941dff5ae4bae093aac6249d7307fb4fddd58385737d8c20704c0cb1a3a966bf34e74f0110fed80f1beff71b5f595c0ce3c5ca3e5d685c064f212bdeba8f58804cc2b7c3732cf87f9c541444f1629970ba6394b0b2570047a038334a0186080289ba294018dd8cc1c8c2d2010e1b4303ddd58385737d8c20704c0cb1a3a966bf34e74f0110fed80f1beff71b5f595c0c", + "server_login_state": "4c1dc1603f7568dd19dacea6938a2eb0847f365e3733f1d94068648fed318d72dfb05320144e8b25aff7cdaf1ff2f6e23aace1b1d2b48eab23e0bbf315044c54dde886c08fc1bad2f87e6445d2938e4405211e141948a98f8693d3a044a78cc94c0c0f44848825a6a65f6555599c6c133b8cd7e6cd71d0f8f661f10cfd1afbd41c8edc5902c6500ff5529b3fef4a3eeb902a98da7b542f80dbc449b1eaa42bda5c8a5a4486395ca5d34b13312fedba5aaca2039185f514eff22c598b4aecb5c2", + "password_file": "18a37ef21ebff958b228f6b0a4aa66764a20b438393a380833dc73bf05da8c4043a1d396008b10207c4a2c6c6c2a1bd1fff443741102e6884eb58236cd27c2c09626b7c2df397a8473337cfb760d4dbdfe8f50a26696d6c41f9f4c2086ab0957a2965d641d8faac6d78929faaea9d849260374dfbc48fcd8508d619e91549e0f1f13d125c3dc2fc99a3fa879d3a914202afae68113902a60a44266febeca8521fab72bcb5fddd144768fc59bcbe759e328b09aeffbfb906627ddfe670342a358", + "export_key": "42635c7e79ad5b9d3c7c3d60c233a26c0f2c4081c2698a0fde7f40597705c6fd10265d227a6d74f6b77a731945777d19b38e73d53adee9337cb89eb197a08553", + "session_key": "1c8edc5902c6500ff5529b3fef4a3eeb902a98da7b542f80dbc449b1eaa42bda5c8a5a4486395ca5d34b13312fedba5aaca2039185f514eff22c598b4aecb5c2" } "#; #[cfg(feature = "curve25519")] static TEST_VECTOR_CURVE25519_P256: &str = r#" { - "client_s_pk": "38b0b198b9052e984915d69db446e9f3a849a1757326f515931ee09edcdbc961", - "client_s_sk": "40055b17e92514255397f1d41a3dab3ec99e26e59a3aa87e51e57be393f8bd79", - "client_e_pk": "e4aa7ebf12ea0bbbea4cae36dc7fc6487a1d978c776d9dfc99b242352ad02020", - "client_e_sk": "188d93b88f1f0d53e37e23d3cd02739313225730c604bca989ff7b28092e4a6f", - "server_s_pk": "f55eb503c79e571e2f02df2eb26fc7d8eb643f9bbd6e21e2380b146ac4b63015", - "server_s_sk": "e0413670da0428b85919a9bc5224cd1018a22e2ff0d28806b823939fac56a161", - "server_e_pk": "ad21cc835ae87a3b57f3b4a7a33e910119911fb2191d7d2a9886b236b650076f", - "server_e_sk": "f8d2b5904465387c3f9cf701a90c452118236f55b712e577d80ca1d25a8fbb53", - "fake_sk": "506072af99437e36b7a20edabf6f74b9de5bff63b68498b42093eaa3ff217d59", - "credential_identifier": "637265644964656e746966696572", - "id_u": "696455", - "id_s": "696453", - "password": "70617373776f7264", - "blinding_factor": "77f72593b0d5929fad255520968e9c50e23be4435e6a905f76f3bea8f7c27b64", - "oprf_seed": "dc731ad0171dfde4bfecabfc1cdeb4a0290154a8471e638d113ee4982256d9a1", - "masking_nonce": "a0e80933055bd24cb72ff56934bc806238f4b73343ad51a79d310d9aa5b42de9ed163be75585cf084abd740d9f4deea8ce8fa9b5d51ac05d5cf05e2ff7978885", - "envelope_nonce": "badbb8f3e2fce06a7e3b55837b0780808dcee7ac66790a7350a54397cdbc2a6f", - "client_nonce": "4f233bf42d70daef2c8d15f8f1f1dd05c17d42a823729e5e03b95b888ffd292f", - "server_nonce": "a6c2b03c340452bbb0beb83145c9b2def77c20dd9273f9b659e7994767d54a6a", - "context": "636f6e74657874", - "registration_request": "02ff13cea4ee0d08c43547401b92ef22cbee3809a82793f408ce06334b6b68e4a4", - "registration_response": "02523d3ffef8304612b881bd531046ebaa9bc4b2a8907aea0bc04c9cf96234c6bdf55eb503c79e571e2f02df2eb26fc7d8eb643f9bbd6e21e2380b146ac4b63015", - "registration_upload": "8010abb90d3e91b604211096baed17a17870e86184b1235d6b63e03e23ce17235c5cff09c6da8bde2b79f14b65182675bd12e43afefb7180c0293b0c691400c340055b17e92514255397f1d41a3dab3ec99e26e59a3aa87e51e57be393f8bd79379d6e9677361f90c04568ece1ed408c3a4bcfee8d2d51fb37be07cf1ff2dd45", - "credential_request": "02ff13cea4ee0d08c43547401b92ef22cbee3809a82793f408ce06334b6b68e4a44f233bf42d70daef2c8d15f8f1f1dd05c17d42a823729e5e03b95b888ffd292fe4aa7ebf12ea0bbbea4cae36dc7fc6487a1d978c776d9dfc99b242352ad02020", - "credential_response": "02523d3ffef8304612b881bd531046ebaa9bc4b2a8907aea0bc04c9cf96234c6bda0e80933055bd24cb72ff56934bc806238f4b73343ad51a79d310d9aa5b42de90715f6d20ea09505d5fee194b49e0bca9298e609c0edd5b8c809664f0cb1bb2f23e54a172f9b51bacce6cdea6a8c726ef7b5f89e60656777b81d5a46d35a06ccb38baffc1310edb238c576e1131e5727fd675308d58bbf261adea4a8d5ca48b0f8d2b5904465387c3f9cf701a90c452118236f55b712e577d80ca1d25a8fbb53a84a2876fce2b84c8e614654eec37c5108839ecde31e59ff7ecda7c8b54fe935f8f1e6658dc5ec3e6a09d1b1e8061e2aed69c4bed011d9643073774efa449f79", - "credential_finalization": "d00d48e102832a2b524a0c78c860cc2a7f6f51ba7b64167aec2625c298e194e2", - "client_registration_state": "77f72593b0d5929fad255520968e9c50e23be4435e6a905f76f3bea8f7c27b6402ff13cea4ee0d08c43547401b92ef22cbee3809a82793f408ce06334b6b68e4a4", - "client_login_state": "77f72593b0d5929fad255520968e9c50e23be4435e6a905f76f3bea8f7c27b6402ff13cea4ee0d08c43547401b92ef22cbee3809a82793f408ce06334b6b68e4a44f233bf42d70daef2c8d15f8f1f1dd05c17d42a823729e5e03b95b888ffd292fe4aa7ebf12ea0bbbea4cae36dc7fc6487a1d978c776d9dfc99b242352ad02020188d93b88f1f0d53e37e23d3cd02739313225730c604bca989ff7b28092e4a6f4f233bf42d70daef2c8d15f8f1f1dd05c17d42a823729e5e03b95b888ffd292f", - "server_login_state": "bc8e945f9bf279ca6e692eef43108aeedf80a8a3218185e17ebf3d4ce615439af1241c85909d21f186c53031317205e55cecd1a946a8c5f24279a8da6dc22246e0a3ffe2e9ba8378de1889ab273d5e163a354f45f0313040368c17f0928c5a27", - "password_file": "8010abb90d3e91b604211096baed17a17870e86184b1235d6b63e03e23ce17235c5cff09c6da8bde2b79f14b65182675bd12e43afefb7180c0293b0c691400c340055b17e92514255397f1d41a3dab3ec99e26e59a3aa87e51e57be393f8bd79379d6e9677361f90c04568ece1ed408c3a4bcfee8d2d51fb37be07cf1ff2dd45", - "export_key": "0829e4020fc39969675e55a41b666c6a6e90828e4d77ec9cadb2a06960757397", - "session_key": "e0a3ffe2e9ba8378de1889ab273d5e163a354f45f0313040368c17f0928c5a27" -} -"#; - -#[cfg(feature = "curve25519")] -static TEST_VECTOR_CURVE25519_P384: &str = r#" -{ - "client_s_pk": "48f5981857f751260755dda39b0bb9301d289cdcd33e1f67e73be3ef6dc3be1a", - "client_s_sk": "50aca1815bff3bb177b08c8266268de689ceae2d1c531e8b8bc43eec5135be44", - "client_e_pk": "d45cd2abb676ce52929d3acb84d5f28728f151dc38cd9a5563ebe3f5a01c9d3e", - "client_e_sk": "2086a9563d612e810c1577ff8ca15c9bde4bdc9a8b798ffbdc2a8c741f523a7c", - "server_s_pk": "6b4714a941d5ead7b95ef5a8a46931b2e1a70a9bcfafaf46e62f899501334c13", - "server_s_sk": "a0f72a112e1eabac338b8db81ec6351849ce5bc87b18621228574f23cc49e742", - "server_e_pk": "aff17bf2ef5da674aaf387d9a9d703f11a49420b16a0ed737b7273302c9c3f2f", - "server_e_sk": "880bb9e8b1f6cd5cfd33244645594597abe0f6745c14673fe7f7b23093645c6e", - "fake_sk": "68d483d304f72cd4a23b168b205a8dc24b5701dfc0b01beaa06d1b981dfa6a68", - "credential_identifier": "637265644964656e746966696572", - "id_u": "696455", - "id_s": "696453", - "password": "70617373776f7264", - "blinding_factor": "6b5d786310cb26e3fe5db136630c8093ff5c0e02e4592aaa661db37afa3633a685cca5f854e7f4a995637f9a47148c45", - "oprf_seed": "bb6299ef75f1fd683b01fe618c97e76f78d00beeaf89f8d9bd26c4957370c763995903e646d79a1e227792e76f3bab25", - "masking_nonce": "6d5c6727439f651e6bcdd9efc0b94c245eb99dd1f93168a39adb606fa2d10999f0982eb5d81ba9d6137e9a3dd67137079f85fa26337a34920644c2876e359ba0", - "envelope_nonce": "f0763b1b82e7ef64ff776c9c54c904fca0daff3ccb3c5491ed0572dde5d80b43", - "client_nonce": "de803700c352584a1acb7dad14ad0b0f3dd9f705cc5d7d116525655b1488aa4e", - "server_nonce": "b223d9c59395281d0c1a0ca400239a13c654b574e009f2fa17c5c0b1bbe122df", - "context": "636f6e74657874", - "registration_request": "021479a9b9259fd3468c21a845ae0394f7ae3799eaec2071a704de76a8842650396f5cdf675fce44c576273caa0f0ef91f", - "registration_response": "03aba676b07a6ee5d7f377bc6d63bd44181ff54a2b2e855dc6acafab8a9eefcd907add6d5a727f9b4ed2371f1b634709566b4714a941d5ead7b95ef5a8a46931b2e1a70a9bcfafaf46e62f899501334c13", - "registration_upload": "0e1968eb57014818e1a47db69ffc2e6bd43413fe50724a0f2e66b0bbe00c5968abbc8ddf519182bc468fbd10aba973679e7bf15a3e892dd654ac44e182b5e98b19f191ddd7116c820646da8be696b74450aca1815bff3bb177b08c8266268de689ceae2d1c531e8b8bc43eec5135be44c61537ea762ad6c261d760b4a62f812776e6080b270454f250b7a038519b004883883d61431cf5a579c276997d145473", - "credential_request": "021479a9b9259fd3468c21a845ae0394f7ae3799eaec2071a704de76a8842650396f5cdf675fce44c576273caa0f0ef91fde803700c352584a1acb7dad14ad0b0f3dd9f705cc5d7d116525655b1488aa4ed45cd2abb676ce52929d3acb84d5f28728f151dc38cd9a5563ebe3f5a01c9d3e", - "credential_response": "03aba676b07a6ee5d7f377bc6d63bd44181ff54a2b2e855dc6acafab8a9eefcd907add6d5a727f9b4ed2371f1b634709566d5c6727439f651e6bcdd9efc0b94c245eb99dd1f93168a39adb606fa2d10999a439ad64da556f040fc4b1830ec5f2eb687f0428ba6922790261799bf57da9170c3dc0b4fafcc0d5c29369bf0a0cb5b2c45be562bd2f5916995f4305016814fcfb91a1a7a0ce6e9a838459243bc3f97f8409d7850cdb1898995e8f604ef2d3f5b517103ae49c7295e184908524105e5a880bb9e8b1f6cd5cfd33244645594597abe0f6745c14673fe7f7b23093645c6e7a62bf93aba31ac9fa1cf47d544296b394f332be17ebe261dc877a52925a522ceff4305ad5d438eac1c18eeb41806f132972edc808a6d61d2916a5079dccb7036df014ced5e1e997fd0f261f2e352210", - "credential_finalization": "87f513c31cd2b9cf2925aa837f94830451dd7e77c992a4553be03975c5ebf267a4d2cee9107c070a6d36a080d5382050", - "client_registration_state": "6b5d786310cb26e3fe5db136630c8093ff5c0e02e4592aaa661db37afa3633a685cca5f854e7f4a995637f9a47148c45021479a9b9259fd3468c21a845ae0394f7ae3799eaec2071a704de76a8842650396f5cdf675fce44c576273caa0f0ef91f", - "client_login_state": "6b5d786310cb26e3fe5db136630c8093ff5c0e02e4592aaa661db37afa3633a685cca5f854e7f4a995637f9a47148c45021479a9b9259fd3468c21a845ae0394f7ae3799eaec2071a704de76a8842650396f5cdf675fce44c576273caa0f0ef91fde803700c352584a1acb7dad14ad0b0f3dd9f705cc5d7d116525655b1488aa4ed45cd2abb676ce52929d3acb84d5f28728f151dc38cd9a5563ebe3f5a01c9d3e2086a9563d612e810c1577ff8ca15c9bde4bdc9a8b798ffbdc2a8c741f523a7cde803700c352584a1acb7dad14ad0b0f3dd9f705cc5d7d116525655b1488aa4e", - "server_login_state": "372da5d4c6d77a4fb44434763763edce2d6b83f72097c725c91aae2ff35a42d5954d68fb3cb2e62cbfc1aae56c5c275a5589be237d12cb26f934e78173539d1a48026c1ce9b7d3af0673bdf5088304464103037ccc6358fb87fba80e5b8b1596f51996af62e3d8091418b330cf334522719051d9f5adb904ce2fd2216a1e69fa71c245df8762e6d90d179f6b45ddee4c", - "password_file": "0e1968eb57014818e1a47db69ffc2e6bd43413fe50724a0f2e66b0bbe00c5968abbc8ddf519182bc468fbd10aba973679e7bf15a3e892dd654ac44e182b5e98b19f191ddd7116c820646da8be696b74450aca1815bff3bb177b08c8266268de689ceae2d1c531e8b8bc43eec5135be44c61537ea762ad6c261d760b4a62f812776e6080b270454f250b7a038519b004883883d61431cf5a579c276997d145473", - "export_key": "fb264c2b17768a2d567fe50b42ae3895f367f8c26c01e1d66491667d1971811d295af553a92bf8895499a90818721bc8", - "session_key": "f51996af62e3d8091418b330cf334522719051d9f5adb904ce2fd2216a1e69fa71c245df8762e6d90d179f6b45ddee4c" -} -"#; - -#[cfg(all(feature = "curve25519", feature = "ristretto255"))] -static TEST_VECTOR_CURVE25519_RISTRETTO255: &str = r#" -{ - "client_s_pk": "363782085dc9ce45941b115cbca3b7ec9edca78b1a1577b1e38f45257db10c47", - "client_s_sk": "f814cf6d954ce49ba9f7d08057fa0532a6f3f26015e6b840f699abb2ff6d3e61", - "client_e_pk": "39d8880879a8d2e59f79bb9e3c2764295ac555fbf55a313dfe833dbfd0492e1b", - "client_e_sk": "20138f08d643dec02a1a7712a2dafaf2fc84b5b0b100f400dc79cc177aa04c52", - "server_s_pk": "2a5ae7873d58cae6380a31e9bb05139569b6788157fd831a86a0b24817e20e47", - "server_s_sk": "088119352422e4c69bec2b9dbe2981547cfbb6a50000885c1f0daa183f62dc5a", - "server_e_pk": "95ed39658ea9dcd4a0faf9592d516221039d40830a5e5c00811bad7c239a6019", - "server_e_sk": "78b4f265e4c44bde1e29235a298565e70ce9213f6e80bf17ca539cf38e801545", - "fake_sk": "18e90cf8c31de503cb9dda3dbc702965b7dee7d1484a7f01a85dd8aae577864f", + "client_s_pk": "984c4d0154f43c559a6e9c11e53899796c14df117333d23415e6271694fad424", + "client_s_sk": "2b3e92c34952a4c3deb75b18f9096d22256f54819f608e181720da0d48590108", + "client_e_pk": "679d88f27a93d9a53ff507f56fd9ef726605e5b62f6584fe62b88115c30fec42", + "client_e_sk": "2f56650f9b56744b174e5ac45714559d515ed4487e71c5da7608015adc2cde09", + "server_s_pk": "9a90ad9a25286cdde32ee8028538f4a83cedcca0fc9a3e53412a0454926e834d", + "server_s_sk": "d327ef3da05a7f92e2a60c43194b124f0b8e4d7aa2cfb9d94b66ed19021b8409", + "server_e_pk": "4962df96cfa3cadf6dbf7ac56e2e5a7d6e8515645df41bf01e479c6298a19002", + "server_e_sk": "d9fec8c73c59b5f9ceea74cf32a3de88cbc0c31e6b769137d876053aa0800d04", + "fake_sk": "0e0289c3530bfd4c79ca732b87e71227b8dcb36a552c652bf601da293887710a", "credential_identifier": "637265644964656e746966696572", "id_u": "696455", "id_s": "696453", "password": "70617373776f7264", - "blinding_factor": "9d0ccae042dd9cf119313ba1681b32577fd3405d1d1b063cdbb4bede1782780d", - "oprf_seed": "432646fd0cd923ba8c94e5ef119ade9b554d74322f1dd0363b89c122139886d6e15de59bed3d1763509fb0aa7f389aad1fc94dfeaf98ca38f03d88fe072bb56f", - "masking_nonce": "67470c894da0aa7310fe5348bfa58aad824e21dec080afbd3d9925be73291d31c65b7b3bda7d01782d3b48c79c94b56820d005a77a92fe9a93dd72eb1432064d", - "envelope_nonce": "109c0d52194e20d434558b22cd5957dfc10f6123029a8215ab956ac617ce2030", - "client_nonce": "bfd99626a535067869df816d1896f7407b8589ef8d553422b55682b1305e1912", - "server_nonce": "914e71cb6641c8f34cf5bc7c1f0aa091cda4acba1ea00e4dc0f638751b0fc51f", + "blinding_factor": "9c0bc8990211537292deb41e9fcd040961d49091fbe65d1bb59e383277bb25eb", + "oprf_seed": "1bc1978fa716b5f9034f63d04aed6721e1671d862e482a7b8ec24e9911972d6a", + "masking_nonce": "ea49e91d388abfde7a79628609ca387ec24d1566ed95044aba000db31c97e8f432462af38aa60e5ce7c32d34604e5c121cefc8297671bdf71a966ecdb3bc5a2f", + "envelope_nonce": "997f10d36ebeffa5083d8b534794a62e957764ddb3c09825a68133d33df3c661", + "client_nonce": "1d191eb4375568db766e64b378df66f7076b642a46cf708919e5deab6b48d236", + "server_nonce": "f861a3400dd011365ef09f2634290d5268b9d45fc8da91b0ed815e623a688529", "context": "636f6e74657874", - "registration_request": "ea550f244163c4643ee2055f2c8d71c16de90eac9091ba7830bdaf1116f26245", - "registration_response": "60bddc35d89a7ddd0cac9033930c20008152fa131e1658b9540675da55b9ec2f2a5ae7873d58cae6380a31e9bb05139569b6788157fd831a86a0b24817e20e47", - "registration_upload": "848d316d978d6f23b9910a8c1d38ba25c3ecb932500a2fce369532dd23d4d96f786b66a08ba667941c2df7876960a888afedcb174fd3b092ee3d3d5d4cca3a09a9c814b8211cf8c76b47dcdf43a7684a04c151565a5f470b7b7ef251af4a7234f814cf6d954ce49ba9f7d08057fa0532a6f3f26015e6b840f699abb2ff6d3e61ad7b596ad41fdd9d83dce933936475d4a9942c3a02504bb2aff07b53fd21601c600eae15cb46e38609fcc42aa84402df182e3837e3e6579bd56b39dced7b2b90", - "credential_request": "ea550f244163c4643ee2055f2c8d71c16de90eac9091ba7830bdaf1116f26245bfd99626a535067869df816d1896f7407b8589ef8d553422b55682b1305e191239d8880879a8d2e59f79bb9e3c2764295ac555fbf55a313dfe833dbfd0492e1b", - "credential_response": "60bddc35d89a7ddd0cac9033930c20008152fa131e1658b9540675da55b9ec2f67470c894da0aa7310fe5348bfa58aad824e21dec080afbd3d9925be73291d311e2c7ded740a4e877a46f9ce3de36b47d8df2a6d367f5bf6969971769c031e14977c80b0229187f28920e21d81a2d35dc962eb942522ef344e6f54caaf831f452013ddb1ddb1a0ab839846d20dad7a8fb21b739f8cbe5001168bcab7b509899a5b9a0259d3c91e4b8b2316e228612086efd0bc2d3af3a3471a0a627348b6111378b4f265e4c44bde1e29235a298565e70ce9213f6e80bf17ca539cf38e801545b90d704cc69eefd36b223c3fbfa934baeacb845da2e6cc9b097d77c49a2cc6585ea732c3a6bc71b3502053627f293e5fbd30f10ced8506b71f9a371eb99d739b856325235c5633d6f138674e9774539dc3fef6dfc389cc40682ab53e7e7a4139", - "credential_finalization": "a399820723647257ee945cc7ebb8d4e4295d7cb5039152b226f048ffa551dba512a82bb58b5240546d4217b065cc077e5d312ad5943fac507e89136e8d86d020", - "client_registration_state": "9d0ccae042dd9cf119313ba1681b32577fd3405d1d1b063cdbb4bede1782780dea550f244163c4643ee2055f2c8d71c16de90eac9091ba7830bdaf1116f26245", - "client_login_state": "9d0ccae042dd9cf119313ba1681b32577fd3405d1d1b063cdbb4bede1782780dea550f244163c4643ee2055f2c8d71c16de90eac9091ba7830bdaf1116f26245bfd99626a535067869df816d1896f7407b8589ef8d553422b55682b1305e191239d8880879a8d2e59f79bb9e3c2764295ac555fbf55a313dfe833dbfd0492e1b20138f08d643dec02a1a7712a2dafaf2fc84b5b0b100f400dc79cc177aa04c52bfd99626a535067869df816d1896f7407b8589ef8d553422b55682b1305e1912", - "server_login_state": "353a2f9da6867c1092c5d76c955a9d31d38c1f2b8e36789db99fcf7d2c8b80d1550622cd4342c3115f4d3cebb08ecd06a4372fef6a694ea26afa0b6b1106a22fc32c478826167cf97c3dbf8d5ccb08cfb809c8dae83fff45dc94c626795822d5a830c8e5788dfef06981bdb6839cd2ab06a83ec28daa256f9933909d0db6528531977c21609847312aa424536b1b9ce5efeda0a27a127ab60112a8e7fafd80edf2d2b37a55fda89f696fd288fcfa4634a908a1c0daecdb85d6a9fbb894743b1b", - "password_file": "848d316d978d6f23b9910a8c1d38ba25c3ecb932500a2fce369532dd23d4d96f786b66a08ba667941c2df7876960a888afedcb174fd3b092ee3d3d5d4cca3a09a9c814b8211cf8c76b47dcdf43a7684a04c151565a5f470b7b7ef251af4a7234f814cf6d954ce49ba9f7d08057fa0532a6f3f26015e6b840f699abb2ff6d3e61ad7b596ad41fdd9d83dce933936475d4a9942c3a02504bb2aff07b53fd21601c600eae15cb46e38609fcc42aa84402df182e3837e3e6579bd56b39dced7b2b90", - "export_key": "70a22e875296165db438ad81e8c965533edcbed32268515bec41736a5472fc75c3b091a7db670798e6db6f0acc1b26b9a67e4fdee0819ed4af6b1672d8c37510", - "session_key": "31977c21609847312aa424536b1b9ce5efeda0a27a127ab60112a8e7fafd80edf2d2b37a55fda89f696fd288fcfa4634a908a1c0daecdb85d6a9fbb894743b1b" + "registration_request": "02cadf5b02d05f65bf053761947c54ff9c52a32e64d8ba40d406eee86f86ac8f63", + "registration_response": "027746a0843ddcf383f24981d1605c354d69d6434149a3396caf667d816bc581c59a90ad9a25286cdde32ee8028538f4a83cedcca0fc9a3e53412a0454926e834d", + "registration_upload": "eb59650e50b056798293da46391143455a5c97ebff75d221976f32c150eb3e3f2ee763032e75976fba490d56539e7d29106024c262c7c08135ddb378392189142b3e92c34952a4c3deb75b18f9096d22256f54819f608e181720da0d48590108e9cc437cb299cf10fc8de53172ba891cf9c094b1b339dbd8a18282ef98137765", + "credential_request": "02cadf5b02d05f65bf053761947c54ff9c52a32e64d8ba40d406eee86f86ac8f639c0bc8990211537292deb41e9fcd040961d49091fbe65d1bb59e383277bb25ebc9bab2dbddaa4984ee8669b527b4edd2a56fa187a457480088c37e75f1835903", + "credential_response": "027746a0843ddcf383f24981d1605c354d69d6434149a3396caf667d816bc581c5ea49e91d388abfde7a79628609ca387ec24d1566ed95044aba000db31c97e8f436bcf21522e3fb43d01f3916cb7af262cbb7a87836f4b75eeae64c861c12eddb6fbe7448b8c87db4916fd6e2807c21429ab04495d3b48aeb36a03335e2c66bc01e4aa1e32c4974a016f065daab0cc0facd3ed7bf955eb2882f1e8016ae8a31dcf861a3400dd011365ef09f2634290d5268b9d45fc8da91b0ed815e623a688529dd126f42ce1494ebf2ece4f509d111a8ff72a1e7ca2ac15478069901c51a4a1db4aaba8cc5b9ef025dc650a5b07d8db9fd060cbf27b8b4640e2e6bca872d4380", + "credential_finalization": "923474270342f186a41a23e5572c2583f5387f8e847381a5fd94917aa33a3655", + "client_registration_state": "9c0bc8990211537292deb41e9fcd040961d49091fbe65d1bb59e383277bb25eb02cadf5b02d05f65bf053761947c54ff9c52a32e64d8ba40d406eee86f86ac8f63", + "client_login_state": "9c0bc8990211537292deb41e9fcd040961d49091fbe65d1bb59e383277bb25eb02cadf5b02d05f65bf053761947c54ff9c52a32e64d8ba40d406eee86f86ac8f639c0bc8990211537292deb41e9fcd040961d49091fbe65d1bb59e383277bb25ebc9bab2dbddaa4984ee8669b527b4edd2a56fa187a457480088c37e75f1835903583c4e5353c1cfc928a4975d1423ec85b72a06bc4d728ecfff81c501c5fbfc069c0bc8990211537292deb41e9fcd040961d49091fbe65d1bb59e383277bb25eb", + "server_login_state": "3c6cc54d29f32745040e127c8c5e606f431cdefccf214452d30182850d50300061c4876da2632558184289431e51e81a2ed1defe4460fa621f4169ff0e0fdd90c315d7a845a902fd4146c13d228d7a0e3d0cf138bd42969fae5e7b0e032e5f4e", + "password_file": "eb59650e50b056798293da46391143455a5c97ebff75d221976f32c150eb3e3f2ee763032e75976fba490d56539e7d29106024c262c7c08135ddb378392189142b3e92c34952a4c3deb75b18f9096d22256f54819f608e181720da0d48590108e9cc437cb299cf10fc8de53172ba891cf9c094b1b339dbd8a18282ef98137765", + "export_key": "5e8338e5f129bddb19dd5d85494c8b6fe25d0f739c6c38b1c71a183832e8120f", + "session_key": "c315d7a845a902fd4146c13d228d7a0e3d0cf138bd42969fae5e7b0e032e5f4e" } "#; @@ -1060,46 +678,16 @@ fn generate_test_vectors() -> Result<(), ProtocolError> { { let parameters = generate_parameters::()?; println!("Ristretto255: {}", stringify_test_vectors(¶meters)); - - let parameters = generate_parameters::()?; - println!( - "Ristretto255 P-256: {}", - stringify_test_vectors(¶meters) - ); - - let parameters = generate_parameters::()?; - println!( - "Ristretto255 P-384: {}", - stringify_test_vectors(¶meters) - ); } let parameters = generate_parameters::()?; println!("P-256: {}", stringify_test_vectors(¶meters)); - let parameters = generate_parameters::()?; - println!("P-256 P-384: {}", stringify_test_vectors(¶meters)); - - #[cfg(feature = "ristretto255")] - { - let parameters = generate_parameters::()?; - println!( - "P-256 Ristretto255: {}", - stringify_test_vectors(¶meters) - ); - } - - let parameters = generate_parameters::()?; - println!("P-384: {}", stringify_test_vectors(¶meters)); - - let parameters = generate_parameters::()?; - println!("P-384 P-256: {}", stringify_test_vectors(¶meters)); - - #[cfg(feature = "ristretto255")] + #[cfg(all(feature = "curve25519", feature = "ristretto255"))] { - let parameters = generate_parameters::()?; + let parameters = generate_parameters::()?; println!( - "P-384 Ristretto255: {}", + "Curve25519 Ristretto255: {}", stringify_test_vectors(¶meters) ); } @@ -1108,18 +696,6 @@ fn generate_test_vectors() -> Result<(), ProtocolError> { { let parameters = generate_parameters::()?; println!("Curve25519 P-256: {}", stringify_test_vectors(¶meters)); - - let parameters = generate_parameters::()?; - println!("Curve25519 P-384: {}", stringify_test_vectors(¶meters)); - } - - #[cfg(all(feature = "curve25519", feature = "ristretto255"))] - { - let parameters = generate_parameters::()?; - println!( - "Curve25519 Ristretto255: {}", - stringify_test_vectors(¶meters) - ); } Ok(()) @@ -1156,24 +732,11 @@ fn test_registration_request() -> Result<(), ProtocolError> { #[cfg(feature = "ristretto255")] inner::(TEST_VECTOR_RISTRETTO255)?; - #[cfg(feature = "ristretto255")] - inner::(TEST_VECTOR_RISTRETTO255_P256)?; - #[cfg(feature = "ristretto255")] - inner::(TEST_VECTOR_RISTRETTO255_P384)?; inner::(TEST_VECTOR_P256)?; - inner::(TEST_VECTOR_P256_P384)?; - #[cfg(feature = "ristretto255")] - inner::(TEST_VECTOR_P256_RISTRETTO255)?; - inner::(TEST_VECTOR_P384)?; - inner::(TEST_VECTOR_P384_P256)?; - #[cfg(feature = "ristretto255")] - inner::(TEST_VECTOR_P384_RISTRETTO255)?; - #[cfg(feature = "curve25519")] - inner::(TEST_VECTOR_CURVE25519_P256)?; - #[cfg(feature = "curve25519")] - inner::(TEST_VECTOR_CURVE25519_P384)?; #[cfg(all(feature = "curve25519", feature = "ristretto255"))] inner::(TEST_VECTOR_CURVE25519_RISTRETTO255)?; + #[cfg(feature = "curve25519")] + inner::(TEST_VECTOR_CURVE25519_P256)?; Ok(()) } @@ -1214,24 +777,11 @@ fn test_serialization() -> Result<(), ProtocolError> { #[cfg(feature = "ristretto255")] inner::(TEST_VECTOR_RISTRETTO255)?; - #[cfg(feature = "ristretto255")] - inner::(TEST_VECTOR_RISTRETTO255_P256)?; - #[cfg(feature = "ristretto255")] - inner::(TEST_VECTOR_RISTRETTO255_P384)?; inner::(TEST_VECTOR_P256)?; - inner::(TEST_VECTOR_P256_P384)?; - #[cfg(feature = "ristretto255")] - inner::(TEST_VECTOR_P256_RISTRETTO255)?; - inner::(TEST_VECTOR_P384)?; - inner::(TEST_VECTOR_P384_P256)?; - #[cfg(feature = "ristretto255")] - inner::(TEST_VECTOR_P384_RISTRETTO255)?; - #[cfg(feature = "curve25519")] - inner::(TEST_VECTOR_CURVE25519_P256)?; - #[cfg(feature = "curve25519")] - inner::(TEST_VECTOR_CURVE25519_P384)?; #[cfg(all(feature = "curve25519", feature = "ristretto255"))] inner::(TEST_VECTOR_CURVE25519_RISTRETTO255)?; + #[cfg(feature = "curve25519")] + inner::(TEST_VECTOR_CURVE25519_P256)?; Ok(()) } @@ -1277,24 +827,11 @@ fn test_registration_response() -> Result<(), ProtocolError> { #[cfg(feature = "ristretto255")] inner::(TEST_VECTOR_RISTRETTO255)?; - #[cfg(feature = "ristretto255")] - inner::(TEST_VECTOR_RISTRETTO255_P256)?; - #[cfg(feature = "ristretto255")] - inner::(TEST_VECTOR_RISTRETTO255_P384)?; inner::(TEST_VECTOR_P256)?; - inner::(TEST_VECTOR_P256_P384)?; - #[cfg(feature = "ristretto255")] - inner::(TEST_VECTOR_P256_RISTRETTO255)?; - inner::(TEST_VECTOR_P384)?; - inner::(TEST_VECTOR_P384_P256)?; - #[cfg(feature = "ristretto255")] - inner::(TEST_VECTOR_P384_RISTRETTO255)?; - #[cfg(feature = "curve25519")] - inner::(TEST_VECTOR_CURVE25519_P256)?; - #[cfg(feature = "curve25519")] - inner::(TEST_VECTOR_CURVE25519_P384)?; #[cfg(all(feature = "curve25519", feature = "ristretto255"))] inner::(TEST_VECTOR_CURVE25519_RISTRETTO255)?; + #[cfg(feature = "curve25519")] + inner::(TEST_VECTOR_CURVE25519_P256)?; Ok(()) } @@ -1353,24 +890,11 @@ fn test_registration_upload() -> Result<(), ProtocolError> { #[cfg(feature = "ristretto255")] inner::(TEST_VECTOR_RISTRETTO255)?; - #[cfg(feature = "ristretto255")] - inner::(TEST_VECTOR_RISTRETTO255_P256)?; - #[cfg(feature = "ristretto255")] - inner::(TEST_VECTOR_RISTRETTO255_P384)?; inner::(TEST_VECTOR_P256)?; - inner::(TEST_VECTOR_P256_P384)?; - #[cfg(feature = "ristretto255")] - inner::(TEST_VECTOR_P256_RISTRETTO255)?; - inner::(TEST_VECTOR_P384)?; - inner::(TEST_VECTOR_P384_P256)?; - #[cfg(feature = "ristretto255")] - inner::(TEST_VECTOR_P384_RISTRETTO255)?; - #[cfg(feature = "curve25519")] - inner::(TEST_VECTOR_CURVE25519_P256)?; - #[cfg(feature = "curve25519")] - inner::(TEST_VECTOR_CURVE25519_P384)?; #[cfg(all(feature = "curve25519", feature = "ristretto255"))] inner::(TEST_VECTOR_CURVE25519_RISTRETTO255)?; + #[cfg(feature = "curve25519")] + inner::(TEST_VECTOR_CURVE25519_P256)?; Ok(()) } @@ -1410,24 +934,11 @@ fn test_password_file() -> Result<(), ProtocolError> { #[cfg(feature = "ristretto255")] inner::(TEST_VECTOR_RISTRETTO255)?; - #[cfg(feature = "ristretto255")] - inner::(TEST_VECTOR_RISTRETTO255_P256)?; - #[cfg(feature = "ristretto255")] - inner::(TEST_VECTOR_RISTRETTO255_P384)?; inner::(TEST_VECTOR_P256)?; - inner::(TEST_VECTOR_P256_P384)?; - #[cfg(feature = "ristretto255")] - inner::(TEST_VECTOR_P256_RISTRETTO255)?; - inner::(TEST_VECTOR_P384)?; - inner::(TEST_VECTOR_P384_P256)?; - #[cfg(feature = "ristretto255")] - inner::(TEST_VECTOR_P384_RISTRETTO255)?; - #[cfg(feature = "curve25519")] - inner::(TEST_VECTOR_CURVE25519_P256)?; - #[cfg(feature = "curve25519")] - inner::(TEST_VECTOR_CURVE25519_P384)?; #[cfg(all(feature = "curve25519", feature = "ristretto255"))] inner::(TEST_VECTOR_CURVE25519_RISTRETTO255)?; + #[cfg(feature = "curve25519")] + inner::(TEST_VECTOR_CURVE25519_P256)?; Ok(()) } @@ -1475,24 +986,11 @@ fn test_credential_request() -> Result<(), ProtocolError> { #[cfg(feature = "ristretto255")] inner::(TEST_VECTOR_RISTRETTO255)?; - #[cfg(feature = "ristretto255")] - inner::(TEST_VECTOR_RISTRETTO255_P256)?; - #[cfg(feature = "ristretto255")] - inner::(TEST_VECTOR_RISTRETTO255_P384)?; inner::(TEST_VECTOR_P256)?; - inner::(TEST_VECTOR_P256_P384)?; - #[cfg(feature = "ristretto255")] - inner::(TEST_VECTOR_P256_RISTRETTO255)?; - inner::(TEST_VECTOR_P384)?; - inner::(TEST_VECTOR_P384_P256)?; - #[cfg(feature = "ristretto255")] - inner::(TEST_VECTOR_P384_RISTRETTO255)?; - #[cfg(feature = "curve25519")] - inner::(TEST_VECTOR_CURVE25519_P256)?; - #[cfg(feature = "curve25519")] - inner::(TEST_VECTOR_CURVE25519_P384)?; #[cfg(all(feature = "curve25519", feature = "ristretto255"))] inner::(TEST_VECTOR_CURVE25519_RISTRETTO255)?; + #[cfg(feature = "curve25519")] + inner::(TEST_VECTOR_CURVE25519_P256)?; Ok(()) } @@ -1567,24 +1065,11 @@ fn test_credential_response() -> Result<(), ProtocolError> { #[cfg(feature = "ristretto255")] inner::(TEST_VECTOR_RISTRETTO255)?; - #[cfg(feature = "ristretto255")] - inner::(TEST_VECTOR_RISTRETTO255_P256)?; - #[cfg(feature = "ristretto255")] - inner::(TEST_VECTOR_RISTRETTO255_P384)?; inner::(TEST_VECTOR_P256)?; - inner::(TEST_VECTOR_P256_P384)?; - #[cfg(feature = "ristretto255")] - inner::(TEST_VECTOR_P256_RISTRETTO255)?; - inner::(TEST_VECTOR_P384)?; - inner::(TEST_VECTOR_P384_P256)?; - #[cfg(feature = "ristretto255")] - inner::(TEST_VECTOR_P384_RISTRETTO255)?; - #[cfg(feature = "curve25519")] - inner::(TEST_VECTOR_CURVE25519_P256)?; - #[cfg(feature = "curve25519")] - inner::(TEST_VECTOR_CURVE25519_P384)?; #[cfg(all(feature = "curve25519", feature = "ristretto255"))] inner::(TEST_VECTOR_CURVE25519_RISTRETTO255)?; + #[cfg(feature = "curve25519")] + inner::(TEST_VECTOR_CURVE25519_P256)?; Ok(()) } @@ -1623,7 +1108,7 @@ fn test_credential_finalization() -> Result<(), ProtocolError> { assert_eq!( hex::encode(¶meters.server_s_pk), - hex::encode(&client_login_finish_result.server_s_pk.serialize()) + hex::encode(client_login_finish_result.server_s_pk.serialize()) ); assert_eq!( hex::encode(¶meters.session_key), @@ -1643,24 +1128,11 @@ fn test_credential_finalization() -> Result<(), ProtocolError> { #[cfg(feature = "ristretto255")] inner::(TEST_VECTOR_RISTRETTO255)?; - #[cfg(feature = "ristretto255")] - inner::(TEST_VECTOR_RISTRETTO255_P256)?; - #[cfg(feature = "ristretto255")] - inner::(TEST_VECTOR_RISTRETTO255_P384)?; inner::(TEST_VECTOR_P256)?; - inner::(TEST_VECTOR_P256_P384)?; - #[cfg(feature = "ristretto255")] - inner::(TEST_VECTOR_P256_RISTRETTO255)?; - inner::(TEST_VECTOR_P384)?; - inner::(TEST_VECTOR_P384_P256)?; - #[cfg(feature = "ristretto255")] - inner::(TEST_VECTOR_P384_RISTRETTO255)?; - #[cfg(feature = "curve25519")] - inner::(TEST_VECTOR_CURVE25519_P256)?; - #[cfg(feature = "curve25519")] - inner::(TEST_VECTOR_CURVE25519_P384)?; #[cfg(all(feature = "curve25519", feature = "ristretto255"))] inner::(TEST_VECTOR_CURVE25519_RISTRETTO255)?; + #[cfg(feature = "curve25519")] + inner::(TEST_VECTOR_CURVE25519_P256)?; Ok(()) } @@ -1693,24 +1165,11 @@ fn test_server_login_finish() -> Result<(), ProtocolError> { #[cfg(feature = "ristretto255")] inner::(TEST_VECTOR_RISTRETTO255)?; - #[cfg(feature = "ristretto255")] - inner::(TEST_VECTOR_RISTRETTO255_P256)?; - #[cfg(feature = "ristretto255")] - inner::(TEST_VECTOR_RISTRETTO255_P384)?; inner::(TEST_VECTOR_P256)?; - inner::(TEST_VECTOR_P256_P384)?; - #[cfg(feature = "ristretto255")] - inner::(TEST_VECTOR_P256_RISTRETTO255)?; - inner::(TEST_VECTOR_P384)?; - inner::(TEST_VECTOR_P384_P256)?; - #[cfg(feature = "ristretto255")] - inner::(TEST_VECTOR_P384_RISTRETTO255)?; - #[cfg(feature = "curve25519")] - inner::(TEST_VECTOR_CURVE25519_P256)?; - #[cfg(feature = "curve25519")] - inner::(TEST_VECTOR_CURVE25519_P384)?; #[cfg(all(feature = "curve25519", feature = "ristretto255"))] inner::(TEST_VECTOR_CURVE25519_RISTRETTO255)?; + #[cfg(feature = "curve25519")] + inner::(TEST_VECTOR_CURVE25519_P256)?; Ok(()) } @@ -1793,24 +1252,11 @@ where fn test_complete_flow_success() -> Result<(), ProtocolError> { #[cfg(feature = "ristretto255")] test_complete_flow::(b"good password", b"good password")?; - #[cfg(feature = "ristretto255")] - test_complete_flow::(b"good password", b"good password")?; - #[cfg(feature = "ristretto255")] - test_complete_flow::(b"good password", b"good password")?; test_complete_flow::(b"good password", b"good password")?; - test_complete_flow::(b"good password", b"good password")?; - #[cfg(feature = "ristretto255")] - test_complete_flow::(b"good password", b"good password")?; - test_complete_flow::(b"good password", b"good password")?; - test_complete_flow::(b"good password", b"good password")?; - #[cfg(feature = "ristretto255")] - test_complete_flow::(b"good password", b"good password")?; - #[cfg(feature = "curve25519")] - test_complete_flow::(b"good password", b"good password")?; - #[cfg(feature = "curve25519")] - test_complete_flow::(b"good password", b"good password")?; #[cfg(all(feature = "curve25519", feature = "ristretto255"))] test_complete_flow::(b"good password", b"good password")?; + #[cfg(feature = "curve25519")] + test_complete_flow::(b"good password", b"good password")?; Ok(()) } @@ -1819,24 +1265,11 @@ fn test_complete_flow_success() -> Result<(), ProtocolError> { fn test_complete_flow_fail() -> Result<(), ProtocolError> { #[cfg(feature = "ristretto255")] test_complete_flow::(b"good password", b"bad password")?; - #[cfg(feature = "ristretto255")] - test_complete_flow::(b"good password", b"bad password")?; - #[cfg(feature = "ristretto255")] - test_complete_flow::(b"good password", b"bad password")?; test_complete_flow::(b"good password", b"bad password")?; - test_complete_flow::(b"good password", b"bad password")?; - #[cfg(feature = "ristretto255")] - test_complete_flow::(b"good password", b"bad password")?; - test_complete_flow::(b"good password", b"bad password")?; - test_complete_flow::(b"good password", b"bad password")?; - #[cfg(feature = "ristretto255")] - test_complete_flow::(b"good password", b"bad password")?; - #[cfg(feature = "curve25519")] - test_complete_flow::(b"good password", b"bad password")?; - #[cfg(feature = "curve25519")] - test_complete_flow::(b"good password", b"bad password")?; #[cfg(all(feature = "curve25519", feature = "ristretto255"))] test_complete_flow::(b"good password", b"bad password")?; + #[cfg(feature = "curve25519")] + test_complete_flow::(b"good password", b"bad password")?; Ok(()) } @@ -1869,24 +1302,11 @@ fn test_zeroize_client_registration_start() -> Result<(), ProtocolError> { #[cfg(feature = "ristretto255")] inner::()?; - #[cfg(feature = "ristretto255")] - inner::()?; - #[cfg(feature = "ristretto255")] - inner::()?; inner::()?; - inner::()?; - #[cfg(feature = "ristretto255")] - inner::()?; - inner::()?; - inner::()?; - #[cfg(feature = "ristretto255")] - inner::()?; - #[cfg(feature = "curve25519")] - inner::()?; - #[cfg(feature = "curve25519")] - inner::()?; #[cfg(all(feature = "curve25519", feature = "ristretto255"))] inner::()?; + #[cfg(feature = "curve25519")] + inner::()?; Ok(()) } @@ -1930,24 +1350,11 @@ fn test_zeroize_client_registration_finish() -> Result<(), ProtocolError> { #[cfg(feature = "ristretto255")] inner::()?; - #[cfg(feature = "ristretto255")] - inner::()?; - #[cfg(feature = "ristretto255")] - inner::()?; inner::()?; - inner::()?; - #[cfg(feature = "ristretto255")] - inner::()?; - inner::()?; - inner::()?; - #[cfg(feature = "ristretto255")] - inner::()?; - #[cfg(feature = "curve25519")] - inner::()?; - #[cfg(feature = "curve25519")] - inner::()?; #[cfg(all(feature = "curve25519", feature = "ristretto255"))] inner::()?; + #[cfg(feature = "curve25519")] + inner::()?; Ok(()) } @@ -2000,24 +1407,11 @@ fn test_zeroize_server_registration_finish() -> Result<(), ProtocolError> { #[cfg(feature = "ristretto255")] inner::()?; - #[cfg(feature = "ristretto255")] - inner::()?; - #[cfg(feature = "ristretto255")] - inner::()?; inner::()?; - inner::()?; - #[cfg(feature = "ristretto255")] - inner::()?; - inner::()?; - inner::()?; - #[cfg(feature = "ristretto255")] - inner::()?; - #[cfg(feature = "curve25519")] - inner::()?; - #[cfg(feature = "curve25519")] - inner::()?; #[cfg(all(feature = "curve25519", feature = "ristretto255"))] inner::()?; + #[cfg(feature = "curve25519")] + inner::()?; Ok(()) } @@ -2069,24 +1463,11 @@ fn test_zeroize_client_login_start() -> Result<(), ProtocolError> { #[cfg(feature = "ristretto255")] inner::()?; - #[cfg(feature = "ristretto255")] - inner::()?; - #[cfg(feature = "ristretto255")] - inner::()?; inner::()?; - inner::()?; - #[cfg(feature = "ristretto255")] - inner::()?; - inner::()?; - inner::()?; - #[cfg(feature = "ristretto255")] - inner::()?; - #[cfg(feature = "curve25519")] - inner::()?; - #[cfg(feature = "curve25519")] - inner::()?; #[cfg(all(feature = "curve25519", feature = "ristretto255"))] inner::()?; + #[cfg(feature = "curve25519")] + inner::()?; Ok(()) } @@ -2146,24 +1527,11 @@ fn test_zeroize_server_login_start() -> Result<(), ProtocolError> { #[cfg(feature = "ristretto255")] inner::()?; - #[cfg(feature = "ristretto255")] - inner::()?; - #[cfg(feature = "ristretto255")] - inner::()?; inner::()?; - inner::()?; - #[cfg(feature = "ristretto255")] - inner::()?; - inner::()?; - inner::()?; - #[cfg(feature = "ristretto255")] - inner::()?; - #[cfg(feature = "curve25519")] - inner::()?; - #[cfg(feature = "curve25519")] - inner::()?; #[cfg(all(feature = "curve25519", feature = "ristretto255"))] inner::()?; + #[cfg(feature = "curve25519")] + inner::()?; Ok(()) } @@ -2249,24 +1617,11 @@ fn test_zeroize_client_login_finish() -> Result<(), ProtocolError> { #[cfg(feature = "ristretto255")] inner::()?; - #[cfg(feature = "ristretto255")] - inner::()?; - #[cfg(feature = "ristretto255")] - inner::()?; inner::()?; - inner::()?; - #[cfg(feature = "ristretto255")] - inner::()?; - inner::()?; - inner::()?; - #[cfg(feature = "ristretto255")] - inner::()?; - #[cfg(feature = "curve25519")] - inner::()?; - #[cfg(feature = "curve25519")] - inner::()?; #[cfg(all(feature = "curve25519", feature = "ristretto255"))] inner::()?; + #[cfg(feature = "curve25519")] + inner::()?; Ok(()) } @@ -2334,24 +1689,11 @@ fn test_zeroize_server_login_finish() -> Result<(), ProtocolError> { #[cfg(feature = "ristretto255")] inner::()?; - #[cfg(feature = "ristretto255")] - inner::()?; - #[cfg(feature = "ristretto255")] - inner::()?; inner::()?; - inner::()?; - #[cfg(feature = "ristretto255")] - inner::()?; - inner::()?; - inner::()?; - #[cfg(feature = "ristretto255")] - inner::()?; - #[cfg(feature = "curve25519")] - inner::()?; - #[cfg(feature = "curve25519")] - inner::()?; #[cfg(all(feature = "curve25519", feature = "ristretto255"))] inner::()?; + #[cfg(feature = "curve25519")] + inner::()?; Ok(()) } @@ -2400,24 +1742,11 @@ fn test_scalar_always_nonzero() -> Result<(), ProtocolError> { #[cfg(feature = "ristretto255")] inner::()?; - #[cfg(feature = "ristretto255")] - inner::()?; - #[cfg(feature = "ristretto255")] - inner::()?; inner::()?; - inner::()?; - #[cfg(feature = "ristretto255")] - inner::()?; - inner::()?; - inner::()?; - #[cfg(feature = "ristretto255")] - inner::()?; - #[cfg(feature = "curve25519")] - inner::()?; - #[cfg(feature = "curve25519")] - inner::()?; #[cfg(all(feature = "curve25519", feature = "ristretto255"))] inner::()?; + #[cfg(feature = "curve25519")] + inner::()?; Ok(()) } @@ -2471,24 +1800,11 @@ fn test_reflected_value_error_registration() -> Result<(), ProtocolError> { #[cfg(feature = "ristretto255")] inner::()?; - #[cfg(feature = "ristretto255")] - inner::()?; - #[cfg(feature = "ristretto255")] - inner::()?; inner::()?; - inner::()?; - #[cfg(feature = "ristretto255")] - inner::()?; - inner::()?; - inner::()?; - #[cfg(feature = "ristretto255")] - inner::()?; - #[cfg(feature = "curve25519")] - inner::()?; - #[cfg(feature = "curve25519")] - inner::()?; #[cfg(all(feature = "curve25519", feature = "ristretto255"))] inner::()?; + #[cfg(feature = "curve25519")] + inner::()?; Ok(()) } @@ -2561,24 +1877,11 @@ fn test_reflected_value_error_login() -> Result<(), ProtocolError> { #[cfg(feature = "ristretto255")] inner::()?; - #[cfg(feature = "ristretto255")] - inner::()?; - #[cfg(feature = "ristretto255")] - inner::()?; inner::()?; - inner::()?; - #[cfg(feature = "ristretto255")] - inner::()?; - inner::()?; - inner::()?; - #[cfg(feature = "ristretto255")] - inner::()?; - #[cfg(feature = "curve25519")] - inner::()?; - #[cfg(feature = "curve25519")] - inner::()?; #[cfg(all(feature = "curve25519", feature = "ristretto255"))] inner::()?; + #[cfg(feature = "curve25519")] + inner::()?; Ok(()) } diff --git a/src/tests/opaque_vectors.rs b/src/tests/opaque_vectors.rs index 3a0668d6..ec5795ca 100644 --- a/src/tests/opaque_vectors.rs +++ b/src/tests/opaque_vectors.rs @@ -6,8 +6,8 @@ // of this source tree. You may select, at your option, one of the above-listed // licenses. -//! The OPAQUE test vectors taken from https://github.com/cfrg/draft-irtf-cfrg-opaque/blob/master/draft-irtf-cfrg-opaque.md, -//! which are presented in https://www.ietf.org/archive/id/draft-irtf-cfrg-opaque-08.txt +//! The OPAQUE test vectors taken from , +//! which are presented in pub(crate) static VECTORS: &str = r#" ## Real Test Vectors {#real-vectors} @@ -17,7 +17,7 @@ pub(crate) static VECTORS: &str = r#" #### Configuration ~~~ -OPRF: ristretto255-SHA512 +OPRF: 0001 Hash: SHA512 KSF: Identity KDF: HKDF-SHA512 @@ -52,10 +52,10 @@ server_nonce: 71cd9960ecef2fe0d0f7494986fa3d8b2bb01963537e60efb13981e 138e3d4a1 client_nonce: da7e07376d6d6f034cfa9bb537d11b8c6b4238c334333d1f0aebb38 0cae6a6cc -server_public_keyshare: c8c39f573135474c51660b02425bca633e339cec4e1ac -c69c94dd48497fe4028 -client_public_keyshare: 0c3a00c961fead8a16f818929cc976f0475e4f7235193 -18b96f4947a7a5f9663 +server_keyshare: c8c39f573135474c51660b02425bca633e339cec4e1acc69c94d +d48497fe4028 +client_keyshare: 0c3a00c961fead8a16f818929cc976f0475e4f723519318b96f4 +947a7a5f9663 server_private_keyshare: 2e842960258a95e28bcfef489cffd19d8ec99cc1375d 840f96936da7dbb0b40d client_private_keyshare: 22c919134c9bdd9dc0c5ef3450f18b54820f43f646a9 @@ -69,64 +69,64 @@ b0790308 #### Intermediate Values ~~~ -client_public_key: 2ec892bdbf9b3e2ea834be9eb11f5d187e64ba661ec041c0a3 -b66db8b7d6cc30 -auth_key: 6cd32316f18d72a9a927a83199fa030663a38ce0c11fbaef82aa9003773 -0494fc555c4d49506284516edd1628c27965b7555a4ebfed2223199f6c67966dde822 -randomized_password: aac48c25ab036e30750839d31d6e73007344cb1155289fb7 -d329beb932e9adeea73d5d5c22a0ce1952f8aba6d66007615cd1698d4ac85ef1fcf15 -0031d1435d9 +client_public_key: 8e5e5c04b2154336fa52ac691eb6df5f59ec7315b8467b0bba +1ed4f413043b44 +auth_key: e1ff65c196e1c4b4bf46361798eec479b318831329680f33b4f77ad49d8 +c6e6ef49d87082d654d21f2e36454582353fefc23c07637bd8ca4aa88a4461ea96d6c +randomized_pwd: 4386bf4b83db06f47672fd60b4cface554558da7be3c616c56b2e +d29b544d1b50bc45893b1c05d8d6866a9bbe91395e4704740be58728e8872352f56d5 +319f8f envelope: ac13171b2f17bc2c74997f0fce1e1f35bec6b91fe2e12dbd323d23ba7a3 -8dfecb9dbe7d48cf714fc3533becab6faf60b783c94d258477eb74ecc453413bf61c5 -3fd58f0fb3c1175410b674c02e1b59b2d729a865b709db3dc4ee2bb45703d5a8 -handshake_secret: 562564da0d4efdc73cb6efbb454388dabfa5052d4e7e83f4d02 -40c5afd8352881e762755c2f1a9110e36b05fe770f0f48658489c9730dcd365e6c2d4 -049c8fe3 -server_mac_key: 59473632c53a647f9f4ab4d6c3b81e241dd9cb19ca05f0eabed7e -593f0407ff57e7f060621e5e48d5291be600a1959fbecbc26d4a7157bd227a993c37b -645f73 -client_mac_key: f2d019bad603b45b2ac50376279a0a37d097723b5405aa4fb20a5 -9f60cdbdd52ec043372cedcdbbdb634c54483e1be51a88d13a5798180acb84c10b129 -7069fd -oprf_key: 5d4c6a8b7c7138182afb4345d1fae6a9f18a1744afbcc3854f8f5a2b4b4 -c6d05 +8dfec8e8bde8d4eb9e171240b3d2dfb43ef93efe5cd15412614b3df11ecb58890047e +2fa31c283e7c58c40495226cfa0ed7756e493431b85c464aad7fdaaf1ab41ac7 +handshake_secret: 885a0a7bd8e704d8fc26f62b8657f8c5d01ffb35b27ad538493 +968dcf6dba7a2d42d404d6ed6a87805a030ffafe791fb69fd044c1ac152ee0ee78853 +cebb0700 +server_mac_key: d29e33eb506fbf199c818d1300e7253404a7d5de9c660a90f79af +e4cc15da2ae31e511c6eb1c4df95f47c9759606732781a3d1884a4d53cba690bdb9e9 +ac4d7c +client_mac_key: 4d4d4c4b8b35501876ed01d07f5718357ff720163b84813b1bde4 +f3b6ca3e1de744a267e3d145e6095a0e5b1617714e10af7e10093d0ba8dd115e6bdb1 +f5ccd9 +oprf_key: 6c246eaa55e47d0490ffa8a6f784e803eed9384a250458def36a2acebf1 +5c905 ~~~ #### Output Values ~~~ -registration_request: 5059ff249eb1551b7ce4991f3336205bde44a105a032e74 -7d21bf382e75f7a71 -registration_response: 7408a268083e03abc7097fc05b587834539065e86fb0c7 -b6342fcf5e01e5b019b2fe7af9f48cc502d016729d2fe25cdd433f2c4bc904660b2a3 +registration_request: 62235332ae15911d69812e9eeb6ac8fe4fa0ffc7590831d +5c5e1631e01049276 +registration_response: 6268d13fea98ebc8e6b88d0b3cc8a78d2ac8fa8efc741c +d2e966940c52c31c71b2fe7af9f48cc502d016729d2fe25cdd433f2c4bc904660b2a3 82c9b79df1a78 -registration_upload: 2ec892bdbf9b3e2ea834be9eb11f5d187e64ba661ec041c0 -a3b66db8b7d6cc301ac5844383c7708077dea41cbefe2fa15724f449e535dd7dd562e -66f5ecfb95864eadddec9db5874959905117dad40a4524111849799281fefe3c51fa8 -2785c5ac13171b2f17bc2c74997f0fce1e1f35bec6b91fe2e12dbd323d23ba7a38dfe -cb9dbe7d48cf714fc3533becab6faf60b783c94d258477eb74ecc453413bf61c53fd5 -8f0fb3c1175410b674c02e1b59b2d729a865b709db3dc4ee2bb45703d5a8 -KE1: c4dedb0ba6ed5d965d6f250fbe554cd45cba5dfcce3ce836e4aee778aa3cd44d +registration_upload: 8e5e5c04b2154336fa52ac691eb6df5f59ec7315b8467b0b +ba1ed4f413043b449afea0ddedbbce5c083c5d5d02aa5218bcc7100f541d841bb5974 +f084f7aa0b929399feb39efd17e13ce1035cbb23251da3b5126a574b239c7b73519d8 +847e2fac13171b2f17bc2c74997f0fce1e1f35bec6b91fe2e12dbd323d23ba7a38dfe +c8e8bde8d4eb9e171240b3d2dfb43ef93efe5cd15412614b3df11ecb58890047e2fa3 +1c283e7c58c40495226cfa0ed7756e493431b85c464aad7fdaaf1ab41ac7 +KE1: 1670c409ebb699a6012629451d218d42a34eddba1d2978536c45e199c60a0b4e da7e07376d6d6f034cfa9bb537d11b8c6b4238c334333d1f0aebb380cae6a6cc0c3a0 0c961fead8a16f818929cc976f0475e4f723519318b96f4947a7a5f9663 -KE2: 7e308140890bcde30cbcea28b01ea1ecfbd077cff62c4def8efa075aabcbb471 -38fe59af0df2c79f57b8780278f5ae47355fe1f817119041951c80f612fdfc6dd6ec6 -0bcdb26dc455ddf3e718f1020490c192d70dfc7e403981179d8073d1146a4f9aa1ced -4e4cd984c657eb3b54ced3848326f70331953d91b02535af44d9fe0610f003be80cb2 -098357928c8ea17bb065af33095f39d4e0b53b1687f02d522d96bad4ca354293d5c40 -1177ccbd302cf565b96c327f71bc9eaf2890675d2fbb71cd9960ecef2fe0d0f749498 +KE2: 36b4d06f413b72004392d7359cd6a998c667533203d6a671afe81ca09a282f72 +38fe59af0df2c79f57b8780278f5ae47355fe1f817119041951c80f612fdfc6d378cc +6b0113bf0b6afd9e0728e62ba793d5d25bb97794c154d036bf09c98c472368bffc4e3 +5b7dc48f5a32dd3fede3b9e563f7a170d0e082d02c0a105cdf1ee0ea1928202076ff3 +7ce174f2c669d52d8adc424e925a3bc9a4ca5ce16d9b7a1791ff7e47a0d2fa42424e5 +476f8cfa7bb20b2796ad877295a996ffcb049313f4e971cd9960ecef2fe0d0f749498 6fa3d8b2bb01963537e60efb13981e138e3d4a1c8c39f573135474c51660b02425bca -633e339cec4e1acc69c94dd48497fe40287f33611c2cf0eef57adbf48942737d9421e -6b20e4b9d6e391d4168bf4bf96ea57aa42ad41c977605e027a9ef706a349f4b2919fe -3562c8e86c4eeecf2f9457d4 -KE3: df9a13cd256091f90f0fcb2ef6b3411e4aebff07bb0813299c0ec7f5dedd33a7 -681231a001a82f1dece1777921f42abfeee551ee34392e1c9743c5cc1dc1ef8c -export_key: 1ef15b4fa99e8a852412450ab78713aad30d21fa6966c9b8c9fb3262a -970dc62950d4dd4ed62598229b1b72794fc0335199d9f7fcc6eaedde92cc04870e63f -16 -session_key: 8a0f9f4928fc0c3b5bb261c4b7b3997600405424a8128632e85a5667 -b4b742484ed791933971be6d3fcf2b23c56b8e8f7e7edcae19a03b8fd87f5999fce12 -9d2 +633e339cec4e1acc69c94dd48497fe402848f3b062916ea7666973222944dabe1027e +5bea84b1b5d46dab64b1c6eda3170d4c9adba8afa61eb4153061d528b39102f32ecda +7d7625dbc229e6630a607e03 +KE3: 4e23f0f84a5261918a7fc23bf1978a935cf4e320d56984079f8c7f4a54847b9e +979f519928c5898927cf6aa8d51ac42dc2d0f5840956caa3a34dbc55ce74415f +export_key: 403a270110164ae0de7ea77c6824343211e8c1663ccaedde908dc9acf +661039a379c8ac7e4b0cb23a8d1375ae94a772f91536de131d9d86633cb9445f773df +ac +session_key: d2dea308255aa3cecf72bcd6ac96ff7ab2e8bad0494b90180ad340b7 +d8942a36ee358e76c372790d4a5c1ac900997ea2abbf35f2d65510f8dfd668e593b8e +1fe ~~~ ### OPAQUE-3DH Real Test Vector 2 @@ -134,7 +134,7 @@ b4b742484ed791933971be6d3fcf2b23c56b8e8f7e7edcae19a03b8fd87f5999fce12 #### Configuration ~~~ -OPRF: ristretto255-SHA512 +OPRF: 0001 Hash: SHA512 KSF: Identity KDF: HKDF-SHA512 @@ -171,10 +171,10 @@ server_nonce: 71cd9960ecef2fe0d0f7494986fa3d8b2bb01963537e60efb13981e 138e3d4a1 client_nonce: da7e07376d6d6f034cfa9bb537d11b8c6b4238c334333d1f0aebb38 0cae6a6cc -server_public_keyshare: c8c39f573135474c51660b02425bca633e339cec4e1ac -c69c94dd48497fe4028 -client_public_keyshare: 0c3a00c961fead8a16f818929cc976f0475e4f7235193 -18b96f4947a7a5f9663 +server_keyshare: c8c39f573135474c51660b02425bca633e339cec4e1acc69c94d +d48497fe4028 +client_keyshare: 0c3a00c961fead8a16f818929cc976f0475e4f723519318b96f4 +947a7a5f9663 server_private_keyshare: 2e842960258a95e28bcfef489cffd19d8ec99cc1375d 840f96936da7dbb0b40d client_private_keyshare: 22c919134c9bdd9dc0c5ef3450f18b54820f43f646a9 @@ -188,64 +188,64 @@ b0790308 #### Intermediate Values ~~~ -client_public_key: 2ec892bdbf9b3e2ea834be9eb11f5d187e64ba661ec041c0a3 -b66db8b7d6cc30 -auth_key: 6cd32316f18d72a9a927a83199fa030663a38ce0c11fbaef82aa9003773 -0494fc555c4d49506284516edd1628c27965b7555a4ebfed2223199f6c67966dde822 -randomized_password: aac48c25ab036e30750839d31d6e73007344cb1155289fb7 -d329beb932e9adeea73d5d5c22a0ce1952f8aba6d66007615cd1698d4ac85ef1fcf15 -0031d1435d9 +client_public_key: 8e5e5c04b2154336fa52ac691eb6df5f59ec7315b8467b0bba +1ed4f413043b44 +auth_key: e1ff65c196e1c4b4bf46361798eec479b318831329680f33b4f77ad49d8 +c6e6ef49d87082d654d21f2e36454582353fefc23c07637bd8ca4aa88a4461ea96d6c +randomized_pwd: 4386bf4b83db06f47672fd60b4cface554558da7be3c616c56b2e +d29b544d1b50bc45893b1c05d8d6866a9bbe91395e4704740be58728e8872352f56d5 +319f8f envelope: ac13171b2f17bc2c74997f0fce1e1f35bec6b91fe2e12dbd323d23ba7a3 -8dfec1ac902dc5589e9a5f0de56ad685ea8486210ef41449cd4d8712828913c5d2b68 -0b2b3af4a26c765cff329bfb66d38ecf1d6cfa9e7a73c222c6efe0d9520f7d7c -handshake_secret: bc2abaa979af9cbb6859856b7d5d201a038fbdfa7e10f11d131 -d3f8f6fc3b263bde4db6d2d9207d4648ff80415a276d5f157f9d37a3eade559db2e5f -3fa026b2 -server_mac_key: 2420461c589866700b08c8818cbf390c872629a14cf32a264dad3 -375f85f33188c8f04bdb71880b2d4613187a0e416808ab62b45858b88319882602371 -ef5f75 -client_mac_key: 156e4ab0b9f71ef994bbbb73928e6d14d7335cf9561f113d61ac6 -b41fab35f9c72fe827d3c4d7dd91d8398ee619810e4f9286e6b32f329eb6b1476ce18 -fa8500 -oprf_key: 5d4c6a8b7c7138182afb4345d1fae6a9f18a1744afbcc3854f8f5a2b4b4 -c6d05 +8dfec43084457c1ffa561c8f37fbad1b8de6c41e6df200e6ebe15d5ce4243fa973ef3 +e480644e56a6de865cc4d3d9e20e0510e63474e2b11f4b4c8f665cc439cc2d7d +handshake_secret: 19d0d9f286f44f573dd61435690b0359c3a70e5c363ba4819ac +fa113b0ddeab603f322185812ddcdd2abbfba77933cd5c3430ea6591e99c30a19884a +80d25dab +server_mac_key: 5096c1f1b295521bc8c5aeba462fc11e123eb710899f164dab737 +45f55f42b27a31f810efb06fc56890f3635a18f3f8c9ef7881f32a251a5f5a7354c82 +70f257 +client_mac_key: 1c284c2a22bfb415a5091c94726dd02ae9adb12d28db5207a87be +0c3f75c1c37df549315f51e0dd2053271a477a45bf0adbc246f7f7e47e201785b6429 +e93a84 +oprf_key: 6c246eaa55e47d0490ffa8a6f784e803eed9384a250458def36a2acebf1 +5c905 ~~~ #### Output Values ~~~ -registration_request: 5059ff249eb1551b7ce4991f3336205bde44a105a032e74 -7d21bf382e75f7a71 -registration_response: 7408a268083e03abc7097fc05b587834539065e86fb0c7 -b6342fcf5e01e5b019b2fe7af9f48cc502d016729d2fe25cdd433f2c4bc904660b2a3 +registration_request: 62235332ae15911d69812e9eeb6ac8fe4fa0ffc7590831d +5c5e1631e01049276 +registration_response: 6268d13fea98ebc8e6b88d0b3cc8a78d2ac8fa8efc741c +d2e966940c52c31c71b2fe7af9f48cc502d016729d2fe25cdd433f2c4bc904660b2a3 82c9b79df1a78 -registration_upload: 2ec892bdbf9b3e2ea834be9eb11f5d187e64ba661ec041c0 -a3b66db8b7d6cc301ac5844383c7708077dea41cbefe2fa15724f449e535dd7dd562e -66f5ecfb95864eadddec9db5874959905117dad40a4524111849799281fefe3c51fa8 -2785c5ac13171b2f17bc2c74997f0fce1e1f35bec6b91fe2e12dbd323d23ba7a38dfe -c1ac902dc5589e9a5f0de56ad685ea8486210ef41449cd4d8712828913c5d2b680b2b -3af4a26c765cff329bfb66d38ecf1d6cfa9e7a73c222c6efe0d9520f7d7c -KE1: c4dedb0ba6ed5d965d6f250fbe554cd45cba5dfcce3ce836e4aee778aa3cd44d +registration_upload: 8e5e5c04b2154336fa52ac691eb6df5f59ec7315b8467b0b +ba1ed4f413043b449afea0ddedbbce5c083c5d5d02aa5218bcc7100f541d841bb5974 +f084f7aa0b929399feb39efd17e13ce1035cbb23251da3b5126a574b239c7b73519d8 +847e2fac13171b2f17bc2c74997f0fce1e1f35bec6b91fe2e12dbd323d23ba7a38dfe +c43084457c1ffa561c8f37fbad1b8de6c41e6df200e6ebe15d5ce4243fa973ef3e480 +644e56a6de865cc4d3d9e20e0510e63474e2b11f4b4c8f665cc439cc2d7d +KE1: 1670c409ebb699a6012629451d218d42a34eddba1d2978536c45e199c60a0b4e da7e07376d6d6f034cfa9bb537d11b8c6b4238c334333d1f0aebb380cae6a6cc0c3a0 0c961fead8a16f818929cc976f0475e4f723519318b96f4947a7a5f9663 -KE2: 7e308140890bcde30cbcea28b01ea1ecfbd077cff62c4def8efa075aabcbb471 -38fe59af0df2c79f57b8780278f5ae47355fe1f817119041951c80f612fdfc6dd6ec6 -0bcdb26dc455ddf3e718f1020490c192d70dfc7e403981179d8073d1146a4f9aa1ced -4e4cd984c657eb3b54ced3848326f70331953d91b02535af44d9fea502150b67fe367 -95dd8914f164e49f81c7688a38928372134b7dccd50e09f8fed9518b7b2f94835b3c4 -fe4c8475e7513f20eb97ff0568a39caee3fd6251876f71cd9960ecef2fe0d0f749498 +KE2: 36b4d06f413b72004392d7359cd6a998c667533203d6a671afe81ca09a282f72 +38fe59af0df2c79f57b8780278f5ae47355fe1f817119041951c80f612fdfc6d378cc +6b0113bf0b6afd9e0728e62ba793d5d25bb97794c154d036bf09c98c472368bffc4e3 +5b7dc48f5a32dd3fede3b9e563f7a170d0e082d02c0a105cdf1ee0279ab2faaf30bb2 +722ef0dbb4c66632703c736dc6aeb163c467a60e0abb09bf4d4d49c1c65f522667cb4 +b6da94faa9d7835ad67e8e3198afb4e64d6fb06bc35371cd9960ecef2fe0d0f749498 6fa3d8b2bb01963537e60efb13981e138e3d4a1c8c39f573135474c51660b02425bca -633e339cec4e1acc69c94dd48497fe4028c463164503598ea84fab9005b9cd51b7bb3 -206fb22a412e8a86b9cb6ffca18f5ea6b4c24fdc94865e8bf74248e6be15b85b16041 -40ffad2175f9518452d381af -KE3: a86ece659d90525e2476aa1756d313b067581cb7b0643b97be6b8ab8d0f10843 -57e514ecfaff9dc18f6cca37da630545f0048393f16bc175eb819653ebc45b60 -export_key: 1ef15b4fa99e8a852412450ab78713aad30d21fa6966c9b8c9fb3262a -970dc62950d4dd4ed62598229b1b72794fc0335199d9f7fcc6eaedde92cc04870e63f -16 -session_key: 0968e91efeb702d6aa09023a9a79803332d8bd3442a79b8ad09490b9 -267161013bf475bed945238a5e976ef7d7de7ff41ae30439fe2fc39758fb3e56f2683 -e60 +633e339cec4e1acc69c94dd48497fe4028dfe19d6cf6d292ae99a497f9ba41702a194 +5f5d9f3ab60ea801b5a691098c7af74956a5e1324322877b6d399583670e54dc90752 +5235fd47c8e396fab340beed +KE3: 824fe89731cd47062819165662cd1c42c4b2d2321bd062e637fdd0361b0dad03 +02bd5e9a9d02c72452dc65298bf330071e061b8bb4e1c8762a350d99c8c003ac +export_key: 403a270110164ae0de7ea77c6824343211e8c1663ccaedde908dc9acf +661039a379c8ac7e4b0cb23a8d1375ae94a772f91536de131d9d86633cb9445f773df +ac +session_key: 5ea9a76f5f5cc59ba7871012836947c946f8c303cc94e048cdc83ada +c89db7187cf5c718ffdd7cb6d8c3005dc0f77814d5f26011b584f9622c649a357cb17 +a4c ~~~ ### OPAQUE-3DH Real Test Vector 3 @@ -253,243 +253,7 @@ e60 #### Configuration ~~~ -OPRF: ristretto255-SHA512 -Hash: SHA512 -KSF: Identity -KDF: HKDF-SHA512 -MAC: HMAC-SHA512 -Group: curve25519 -Context: 4f50415155452d504f43 -Nh: 64 -Npk: 32 -Nsk: 32 -Nm: 64 -Nx: 64 -Nok: 32 -~~~ - -#### Input Values - -~~~ -oprf_seed: a78342ab84d3d30f08d5a9630c79bf311c31ed7f85d9d4959bf492ec67 -a0eec8a67dfbf4497248eebd49e878aab173e5e4ff76354288fdd53e949a5f7c9f7f1 -b -credential_identifier: 31323334 -password: 436f7272656374486f72736542617474657279537461706c65 -envelope_nonce: 40d6b67fdd7da7c49894750754514dbd2070a407166bd2a5237cc -a9bf44d6e0b -masking_nonce: 38fe59af0df2c79f57b8780278f5ae47355fe1f817119041951c80 -f612fdfc6d -server_private_key: c06139381df63bfc91c850db0b9cfbec7a62e86d80040a41a -a7725bf0e79d564 -server_public_key: a41e28269b4e97a66468cc00c5a57753e192e1527669897706 -88aa90486ef031 -server_nonce: 71cd9960ecef2fe0d0f7494986fa3d8b2bb01963537e60efb13981e -138e3d4a1 -client_nonce: da7e07376d6d6f034cfa9bb537d11b8c6b4238c334333d1f0aebb38 -0cae6a6cc -server_public_keyshare: 41f55f0bef355cfb34ccd468fdacad75865ee7efef95f -4cb6c25d477f7205026 -client_public_keyshare: 10a83b9117d3798cb2957fbdb0268a0d63dbf9d66bde5 -c00c78affd80026c911 -server_private_keyshare: 00a4f54206eef1ba2f615bc0aa285cb22f26d1153b5b -40a1e85ff80da12f986f -client_private_keyshare: 80850a697b42a505f5b68fcdafce8c31f0af2b581f06 -3cf1091933541936304b -blind_registration: c575731ffe1cb0ca5ba63b42c4699767b8b9ab78ba39316ee -04baddb2034a70a -blind_login: 6ecc102d2e7a7cf49617aad7bbe188556792d4acd60a1a8a8d2b65d4 -b0790308 -~~~ - -#### Intermediate Values - -~~~ -client_public_key: 0936ea94ab030ec332e29050d266c520e916731a052d05ced7 -e0cfe751142b48 -auth_key: 7e880ab484f750e80e6f839d975aff476070ce65066d85ea62523d1d576 -4739d91307fac47186a4ab935e6a5c7f70cb47faa9473311947502c022cc67ae9440c -randomized_password: 3a602c295a9c323d9362fe286f104567ed6862b25dbe30fa -da844f19e41cf40047424b7118e15dc2c1a815a70fea5c8de6c30aa61440cd4b4b5e8 -f3963fbb2e1 -envelope: 40d6b67fdd7da7c49894750754514dbd2070a407166bd2a5237cca9bf44 -d6e0b20c1e81fef28e92e897ca8287d49a55075b47c3988ff0fff367d79a3e350ccac -150b4a3ff48b4770c8e84e437b3d4e68d2b95833f7788f7eb93fa6a8afb85ecb -handshake_secret: 6936d2b78f13d865997dd37c42c741dfe4c0297199e55d7f889 -1fa4771ed2357e990b44faec69733c607b7541442b5f27ea01513b4f0b84545e0ff75 -81ea7764 -server_mac_key: 62a11be878ecfcbd7c8875e86a0f479befcb4b1742480c9ac2d2a -5fa8d9e96c3bf60edb953ba15e32dc3e2cba60029c0c61481fdc7a80946f596b77fff -6b18ee -client_mac_key: e646055bf0a395c6c7c61078dabe0f0026ec6ba079ddb70f11ec9 -ba41e5ff70e37a87d8fbeca11d7dc22e2aacf2828de6e1d776b451fa1bd4419b0a6b5 -9cc353 -oprf_key: 62ef7f7d9506a14600c34f642aaf6ef8019cc82a6755db4fded5248ea14 -6030a -~~~ - -#### Output Values - -~~~ -registration_request: 26f3dbfd76b8e5f85b4da604f42889a7d4b1bc919f65538 -1a67de02c59fd5436 -registration_response: 506e8f1b89c098fb89b5b6210a05f7898cafdaea221761 -e8d5272fc39e0f9f08a41e28269b4e97a66468cc00c5a57753e192e15276698977068 -8aa90486ef031 -registration_upload: 0936ea94ab030ec332e29050d266c520e916731a052d05ce -d7e0cfe751142b486d23c6ed818882f9bdfdcf91389fcbc0b7a3faf92bd0bd6be4a1e -7730277b694fc7c6ba327fbe786af18487688e0f7c148bbd54dc2fc80c28e7a976d9e -f53c3540d6b67fdd7da7c49894750754514dbd2070a407166bd2a5237cca9bf44d6e0 -b20c1e81fef28e92e897ca8287d49a55075b47c3988ff0fff367d79a3e350ccac150b -4a3ff48b4770c8e84e437b3d4e68d2b95833f7788f7eb93fa6a8afb85ecb -KE1: c4dedb0ba6ed5d965d6f250fbe554cd45cba5dfcce3ce836e4aee778aa3cd44d -da7e07376d6d6f034cfa9bb537d11b8c6b4238c334333d1f0aebb380cae6a6cc10a83 -b9117d3798cb2957fbdb0268a0d63dbf9d66bde5c00c78affd80026c911 -KE2: 9a0e5a1514f62e005ea098b0d8cf6750e358c4389e6add1c52aed9500fa19d00 -38fe59af0df2c79f57b8780278f5ae47355fe1f817119041951c80f612fdfc6d22cc3 -1127d6f0096755be3c3d2dd6287795c317aeea10c9485bf4f419a786642c19a8f151c -eb5e8767d175248c62c017de94057398d28bf0ed00d1b50ee4f812fd9afddf98af8cd -58067ca43b0633b6cadd0e9d987f89623fed4d3583bdf6910c425600e90dab3c6b351 -3188a465461a67f6bbc47aeba808f7f7e2c6d66f5c3271cd9960ecef2fe0d0f749498 -6fa3d8b2bb01963537e60efb13981e138e3d4a141f55f0bef355cfb34ccd468fdacad -75865ee7efef95f4cb6c25d477f720502601bd116f3cb70f03d9cbc25d5606b8c5764 -a1b9b11b28f2cbbd5630a836f9dbb2e7e8914639bca0fb9c99d58d42dfe3057cfe881 -491b1d0812948aa4a7a7c7f7 -KE3: 93a3c0da12392ad5336962e340b7c44ed445a67d61dae7bc5e2ccf891f6e9fac -6596f93350d3d559f7bbb182376a07ec7377e7966b7cc549fb8d0b6fb575f157 -export_key: 9dec51d6d0f6ce7e4345f10961053713b07310cc2e45872f57bbd2fe5 -070fdf0fb5b77c7ddaa2f3dc5c35132df7417ad7fefe0f690ad266e5a54a21d045c9c -38 -session_key: a30c5ad775d0bc9aeb47757cc68a9332cb3acb7fc332ca07ba96d707 -1847e492c8de3541997f97a605eb9b60cde6feb8dc57322e60ec42ae78c87a2e215e2 -77f -~~~ - -### OPAQUE-3DH Real Test Vector 4 - -#### Configuration - -~~~ -OPRF: ristretto255-SHA512 -Hash: SHA512 -KSF: Identity -KDF: HKDF-SHA512 -MAC: HMAC-SHA512 -Group: curve25519 -Context: 4f50415155452d504f43 -Nh: 64 -Npk: 32 -Nsk: 32 -Nm: 64 -Nx: 64 -Nok: 32 -~~~ - -#### Input Values - -~~~ -client_identity: 616c696365 -server_identity: 626f62 -oprf_seed: a78342ab84d3d30f08d5a9630c79bf311c31ed7f85d9d4959bf492ec67 -a0eec8a67dfbf4497248eebd49e878aab173e5e4ff76354288fdd53e949a5f7c9f7f1 -b -credential_identifier: 31323334 -password: 436f7272656374486f72736542617474657279537461706c65 -envelope_nonce: 40d6b67fdd7da7c49894750754514dbd2070a407166bd2a5237cc -a9bf44d6e0b -masking_nonce: 38fe59af0df2c79f57b8780278f5ae47355fe1f817119041951c80 -f612fdfc6d -server_private_key: c06139381df63bfc91c850db0b9cfbec7a62e86d80040a41a -a7725bf0e79d564 -server_public_key: a41e28269b4e97a66468cc00c5a57753e192e1527669897706 -88aa90486ef031 -server_nonce: 71cd9960ecef2fe0d0f7494986fa3d8b2bb01963537e60efb13981e -138e3d4a1 -client_nonce: da7e07376d6d6f034cfa9bb537d11b8c6b4238c334333d1f0aebb38 -0cae6a6cc -server_public_keyshare: 41f55f0bef355cfb34ccd468fdacad75865ee7efef95f -4cb6c25d477f7205026 -client_public_keyshare: 10a83b9117d3798cb2957fbdb0268a0d63dbf9d66bde5 -c00c78affd80026c911 -server_private_keyshare: 00a4f54206eef1ba2f615bc0aa285cb22f26d1153b5b -40a1e85ff80da12f986f -client_private_keyshare: 80850a697b42a505f5b68fcdafce8c31f0af2b581f06 -3cf1091933541936304b -blind_registration: c575731ffe1cb0ca5ba63b42c4699767b8b9ab78ba39316ee -04baddb2034a70a -blind_login: 6ecc102d2e7a7cf49617aad7bbe188556792d4acd60a1a8a8d2b65d4 -b0790308 -~~~ - -#### Intermediate Values - -~~~ -client_public_key: 0936ea94ab030ec332e29050d266c520e916731a052d05ced7 -e0cfe751142b48 -auth_key: 7e880ab484f750e80e6f839d975aff476070ce65066d85ea62523d1d576 -4739d91307fac47186a4ab935e6a5c7f70cb47faa9473311947502c022cc67ae9440c -randomized_password: 3a602c295a9c323d9362fe286f104567ed6862b25dbe30fa -da844f19e41cf40047424b7118e15dc2c1a815a70fea5c8de6c30aa61440cd4b4b5e8 -f3963fbb2e1 -envelope: 40d6b67fdd7da7c49894750754514dbd2070a407166bd2a5237cca9bf44 -d6e0bb4c0eab6143959a650c5f6b32acf162b1fbe95bb36c5c4f99df53865c4d3537d -69061d80522d772cd0efdbe91f817f6bf7259a56e20b4eb9cbe9443702f4b759 -handshake_secret: f5b8fa77a67e638114899eca80c3549aa2c8e277a3412bccbe0 -a7e3943a5798d1e5ede2a847144759b17eb253f2f65efcccf82fe7b5f26e17175713d -be845786 -server_mac_key: a8cdc5647342743be8ae6fc51e7105651b16bcb5fe4913834e7c2 -139dbc06d84c75215e7e84e1785f431c925844eb8c9c0d14959239422368166f41485 -e7847a -client_mac_key: b326230809ee373101e8b387aa33a865f7afa375f8c3e5a8fb592 -b2e89e3117ccae85b0440421c75eb38a4ca4bde9355a549179b84748e21a3e378a3eb -538e37 -oprf_key: 62ef7f7d9506a14600c34f642aaf6ef8019cc82a6755db4fded5248ea14 -6030a -~~~ - -#### Output Values - -~~~ -registration_request: 26f3dbfd76b8e5f85b4da604f42889a7d4b1bc919f65538 -1a67de02c59fd5436 -registration_response: 506e8f1b89c098fb89b5b6210a05f7898cafdaea221761 -e8d5272fc39e0f9f08a41e28269b4e97a66468cc00c5a57753e192e15276698977068 -8aa90486ef031 -registration_upload: 0936ea94ab030ec332e29050d266c520e916731a052d05ce -d7e0cfe751142b486d23c6ed818882f9bdfdcf91389fcbc0b7a3faf92bd0bd6be4a1e -7730277b694fc7c6ba327fbe786af18487688e0f7c148bbd54dc2fc80c28e7a976d9e -f53c3540d6b67fdd7da7c49894750754514dbd2070a407166bd2a5237cca9bf44d6e0 -bb4c0eab6143959a650c5f6b32acf162b1fbe95bb36c5c4f99df53865c4d3537d6906 -1d80522d772cd0efdbe91f817f6bf7259a56e20b4eb9cbe9443702f4b759 -KE1: c4dedb0ba6ed5d965d6f250fbe554cd45cba5dfcce3ce836e4aee778aa3cd44d -da7e07376d6d6f034cfa9bb537d11b8c6b4238c334333d1f0aebb380cae6a6cc10a83 -b9117d3798cb2957fbdb0268a0d63dbf9d66bde5c00c78affd80026c911 -KE2: 9a0e5a1514f62e005ea098b0d8cf6750e358c4389e6add1c52aed9500fa19d00 -38fe59af0df2c79f57b8780278f5ae47355fe1f817119041951c80f612fdfc6d22cc3 -1127d6f0096755be3c3d2dd6287795c317aeea10c9485bf4f419a786642c19a8f151c -eb5e8767d175248c62c017de94057398d28bf0ed00d1b50ee4f812699bff7663be3c5 -d59de94d8e7e58817c7da005b39c25d25555c929e1c5cf6c1b82837b1367c839aab56 -a422c0d97719426a79a16f9869cf852100597b23b5a071cd9960ecef2fe0d0f749498 -6fa3d8b2bb01963537e60efb13981e138e3d4a141f55f0bef355cfb34ccd468fdacad -75865ee7efef95f4cb6c25d477f7205026816ce1eb529f8f3c6cec676d8c08f5ca760 -c4322016850f329c4a2fb07364768a11a5380564d4cbceae511c873627c22c9ee9f05 -488278de0fcf646f0825efdd -KE3: f6325cf6a7bd808fca69d54546ef61f2b5ec62fe8b96ca3c9b3e054841ab35ae -552bc5d8eea5ec840f56578be2cd2c30b52fa03266a2f4518cf764d9ced467ec -export_key: 9dec51d6d0f6ce7e4345f10961053713b07310cc2e45872f57bbd2fe5 -070fdf0fb5b77c7ddaa2f3dc5c35132df7417ad7fefe0f690ad266e5a54a21d045c9c -38 -session_key: 867930cba2b9988acfbe8289bffff728f7c799153be737c8a915ed98 -647a7bc7a7f5f9c03deb797d36eda54de6015683a60e08f34e746e37514c4714d0644 -99f -~~~ - -### OPAQUE-3DH Real Test Vector 5 - -#### Configuration - -~~~ -OPRF: P256-SHA256 +OPRF: 0003 Hash: SHA256 KSF: Identity KDF: HKDF-SHA256 @@ -523,10 +287,10 @@ server_nonce: 71cd9960ecef2fe0d0f7494986fa3d8b2bb01963537e60efb13981e 138e3d4a1 client_nonce: ab3d33bde0e93eda72392346a7a73051110674bbf6b1b7ffab8be4f 91fdaeeb1 -server_public_keyshare: 020e67941e94deba835214421d2d8c90de9b0f7f925d1 -1e2032ce19b1832ae8e0f -client_public_keyshare: 03493f36ca12467d1f5eaaabea67ca31377c4869c1e9a -62346b6f01a991624b95d +server_keyshare: 020e67941e94deba835214421d2d8c90de9b0f7f925d11e2032c +e19b1832ae8e0f +client_keyshare: 03493f36ca12467d1f5eaaabea67ca31377c4869c1e9a62346b6 +f01a991624b95d server_private_keyshare: 9addab838c920fa7044f3a46b91ecaea24b0e7203992 8ee7d4c37a5b9bc17349 client_private_keyshare: 89d5a7e18567f255748a86beac13913df755a5adf776 @@ -540,61 +304,61 @@ blind_login: c497fddf6056d241e6cf9fb7ac37c384f49b357a221eb0a802c989b9 #### Intermediate Values ~~~ -client_public_key: 02dc91b178ba2c4bbf9b9403fca25457b906a7f507e59b6e70 -3031e09114ba2be0 -auth_key: 5bd4be1602516092dc5078f8d699f5721dc1720a49fb80d8e5c16377abd -0987b -randomized_password: 06be0a1a51d56557a3adad57ba29c5510565dcd8b5078fa3 -19151b9382258fb0 +client_public_key: 03763748cc2dfe4f6f80f8e4f3087b2d2222a7c9ba7d3c3aa8 +e89c4975eed0999f +auth_key: 1fa6020180e18dde869f4f8363fc1b6841dbbc9fc9d258ece830af7efc2 +5abdb +randomized_pwd: 4138e29dc8398d8c83b89129cb29ee5dc962fcb5fb2dca25981cb +351b83e0546 envelope: a921f2a014513bd8a90e477a629794e89fec12d12206dde662ebdcf6567 -0e51fe155412cb432898eda63529c3b2633521f770cccbd25d7548a4e20665a45e65a -handshake_secret: c59197dd9269abfdb3037ea1c203a97627e2c0aa142000d1c3f -06a2c8713077d -server_mac_key: a431a5c1d3cb5772cbc66af0c2851e23dd9ad153a0c8b99081c7d -0d543173fde -client_mac_key: 7329ffd54df21db5532fce8794fca78b505fef9397aad28a424f6 -ea3f97c51ca -oprf_key: 2dfb5cb9aa1476093be74ca0d43e5b02862a05f5d6972614d7433acdc66 -f7f31 +0e51fc82109537121d7c39d96f3e04732e1f0b8cc55d98bb4e5968ace317de1d42c3d +handshake_secret: 21c9ee3561e6924110d86f99a624fe2fdc1aeea03f1b17c279f +b94da851e3686 +server_mac_key: 87cab7092d3219b613459ea1ec2973be054367b331937d6973181 +2f418425082 +client_mac_key: 9dffe56b53981e86b37553beedb5d2226465a02d75d577bacef82 +9775494bd93 +oprf_key: 59984c44639e303cd46912ce722fc7d042023f25e264a3775667ea63c30 +add69 ~~~ #### Output Values ~~~ -registration_request: 029e949a29cfa0bf7c1287333d2fb3dc586c41aa652f507 -0d26a5315a1b50229f8 -registration_response: 0350d3694c00978f00a5ce7cd08a00547e4ab5fb5fc2b2 -f6717cdaa6c89136efef035f40ff9cf88aa1f5cd4fe5fd3da9ea65a4923a5594f84fd +registration_request: 0271e8fd723a873d16ddbda1d3700b9a42eca179ba09a8f +c2a2e40a8142fa35fe0 +registration_response: 03c6fe2c086fa5333a15c5718ddda1f15a61e9ea9a0c4a +36f5f0dfe4f090250a70035f40ff9cf88aa1f5cd4fe5fd3da9ea65a4923a5594f84fd 9f2092d6067784874 -registration_upload: 02dc91b178ba2c4bbf9b9403fca25457b906a7f507e59b6e -703031e09114ba2be07f0ed53532d3ae8e505ecc70d42d2b814b6b0e48156def71ea0 -29148b2803aafa921f2a014513bd8a90e477a629794e89fec12d12206dde662ebdcf6 -5670e51fe155412cb432898eda63529c3b2633521f770cccbd25d7548a4e20665a45e -65a -KE1: 037342f0bcb3ecea754c1e67576c86aa90c1de3875f390ad599a26686cdfee6e -07ab3d33bde0e93eda72392346a7a73051110674bbf6b1b7ffab8be4f91fdaeeb1034 +registration_upload: 03763748cc2dfe4f6f80f8e4f3087b2d2222a7c9ba7d3c3a +a8e89c4975eed0999f5b042a53415b5db1161dacf9f9ef0c30ed6b0179038e5e8e5a0 +aa087c8bc0753a921f2a014513bd8a90e477a629794e89fec12d12206dde662ebdcf6 +5670e51fc82109537121d7c39d96f3e04732e1f0b8cc55d98bb4e5968ace317de1d42 +c3d +KE1: 036514cf26a2578f1a45ea8faf540e52b237236ee97dc54948eca7b7f71ba9e1 +29ab3d33bde0e93eda72392346a7a73051110674bbf6b1b7ffab8be4f91fdaeeb1034 93f36ca12467d1f5eaaabea67ca31377c4869c1e9a62346b6f01a991624b95d -KE2: 0246da9fe4d41d5ba69faa6c509a1d5bafd49a48615a47a8dd4b0823cc147648 -1138fe59af0df2c79f57b8780278f5ae47355fe1f817119041951c80f612fdfc6d2f0 -c547f70deaeca54d878c14c1aa5e1ab405dec833777132eea905c2fbb12504a67dcbe -0e66740c76b62c13b04a38a77926e19072953319ec65e41f9bfd2ae2687bd3348bfe3 -3cb0bb9864fdb3b307f7dd68a17f3f150074a0bfc830ab889717d71cd9960ecef2fe0 +KE2: 036ebcb79716cf2ecd0b3e5f3141709f72feb7369d2de41c61e0fa5695e78385 +3e38fe59af0df2c79f57b8780278f5ae47355fe1f817119041951c80f612fdfc6d286 +5751562662eea8de000fdfd4cd1bf506b137d12f28bffaf11a0d720c6ddfe532b2aff +31acb0a8fbb89de1e29cc5a93a33f2e259cf59ad6c88a473d5f056aeb2b6b5eb03a0e +21e32a309373ed45506c3f58bf3d9978925cbf35b337e8ae220be71cd9960ecef2fe0 d0f7494986fa3d8b2bb01963537e60efb13981e138e3d4a1020e67941e94deba83521 -4421d2d8c90de9b0f7f925d11e2032ce19b1832ae8e0fb5166145361a2c344d9737dd -5c826fede3bbfafa418ad379ce4fa65fbb15db6e -KE3: 272d04758b2b436bf0239ba7b9bd0a1686a9b6542ceaaf08732054beda956498 -export_key: c3c9a1b0e33ac84dd83d0b7e8af6794e17e7a3caadff289fbd9dc769a -853c64b -session_key: a224790a010afc0a3f37e23c1b7a5cb7f9e73e3d9a924116510d97d8 -0e2a1e0c +4421d2d8c90de9b0f7f925d11e2032ce19b1832ae8e0fb6eda25f9a67e3930e862860 +02b8dd8b6339ddfdbaebaefe205fe474fb66884d +KE3: 4fd2178c39492f816796db05aa2400204944d6bc5ed4a1e4d7b8b24b9f1894bc +export_key: 00e1f2a1613c78183ec5127f805d320f31ce5dfef70d78f64d327d6c6 +e325ae1 +session_key: e39ed0c2a0b551bad5e9e8bb7017c66918d514b6412a4e30d4cac7a7 +08d35646 ~~~ -### OPAQUE-3DH Real Test Vector 6 +### OPAQUE-3DH Real Test Vector 4 #### Configuration ~~~ -OPRF: P256-SHA256 +OPRF: 0003 Hash: SHA256 KSF: Identity KDF: HKDF-SHA256 @@ -630,10 +394,10 @@ server_nonce: 71cd9960ecef2fe0d0f7494986fa3d8b2bb01963537e60efb13981e 138e3d4a1 client_nonce: ab3d33bde0e93eda72392346a7a73051110674bbf6b1b7ffab8be4f 91fdaeeb1 -server_public_keyshare: 020e67941e94deba835214421d2d8c90de9b0f7f925d1 -1e2032ce19b1832ae8e0f -client_public_keyshare: 03493f36ca12467d1f5eaaabea67ca31377c4869c1e9a -62346b6f01a991624b95d +server_keyshare: 020e67941e94deba835214421d2d8c90de9b0f7f925d11e2032c +e19b1832ae8e0f +client_keyshare: 03493f36ca12467d1f5eaaabea67ca31377c4869c1e9a62346b6 +f01a991624b95d server_private_keyshare: 9addab838c920fa7044f3a46b91ecaea24b0e7203992 8ee7d4c37a5b9bc17349 client_private_keyshare: 89d5a7e18567f255748a86beac13913df755a5adf776 @@ -647,53 +411,53 @@ blind_login: c497fddf6056d241e6cf9fb7ac37c384f49b357a221eb0a802c989b9 #### Intermediate Values ~~~ -client_public_key: 02dc91b178ba2c4bbf9b9403fca25457b906a7f507e59b6e70 -3031e09114ba2be0 -auth_key: 5bd4be1602516092dc5078f8d699f5721dc1720a49fb80d8e5c16377abd -0987b -randomized_password: 06be0a1a51d56557a3adad57ba29c5510565dcd8b5078fa3 -19151b9382258fb0 +client_public_key: 03763748cc2dfe4f6f80f8e4f3087b2d2222a7c9ba7d3c3aa8 +e89c4975eed0999f +auth_key: 1fa6020180e18dde869f4f8363fc1b6841dbbc9fc9d258ece830af7efc2 +5abdb +randomized_pwd: 4138e29dc8398d8c83b89129cb29ee5dc962fcb5fb2dca25981cb +351b83e0546 envelope: a921f2a014513bd8a90e477a629794e89fec12d12206dde662ebdcf6567 -0e51f4d7773a36a208a866301dbb2858e40dc5638017527cf91aef32d3848eebe0971 -handshake_secret: 0ee4a82c4a34992f72bfbcb5d2ce64044477dfe200b9d8c92bf -1759b219b3485 -server_mac_key: 77ebd7511216a51e9c2f3368ce6c1e40513f24b6f42085ef18e7f -737b427aab5 -client_mac_key: e48e2064cf570dbd18eb42550d4459c58ac4ae4e28881d1aefbab -d668f7f1df9 -oprf_key: 2dfb5cb9aa1476093be74ca0d43e5b02862a05f5d6972614d7433acdc66 -f7f31 +0e51f6f7b04d6f92795c9bdb72da5ebe7745b8a6c38fc64c391b1be60b4f49ff2ce67 +handshake_secret: 2bbe0da5102418c041884e9d42e62c946255138d74ea3d69acd +013bf2240c849 +server_mac_key: 2b23b08101bbecc22352f1580cd73c1678affdca160ec8cfccbe0 +e808029d192 +client_mac_key: e279a0b44ae7c1ffb57e7cf179369c6282a18e38e6d1d070eee81 +a44062d59e5 +oprf_key: 59984c44639e303cd46912ce722fc7d042023f25e264a3775667ea63c30 +add69 ~~~ #### Output Values ~~~ -registration_request: 029e949a29cfa0bf7c1287333d2fb3dc586c41aa652f507 -0d26a5315a1b50229f8 -registration_response: 0350d3694c00978f00a5ce7cd08a00547e4ab5fb5fc2b2 -f6717cdaa6c89136efef035f40ff9cf88aa1f5cd4fe5fd3da9ea65a4923a5594f84fd +registration_request: 0271e8fd723a873d16ddbda1d3700b9a42eca179ba09a8f +c2a2e40a8142fa35fe0 +registration_response: 03c6fe2c086fa5333a15c5718ddda1f15a61e9ea9a0c4a +36f5f0dfe4f090250a70035f40ff9cf88aa1f5cd4fe5fd3da9ea65a4923a5594f84fd 9f2092d6067784874 -registration_upload: 02dc91b178ba2c4bbf9b9403fca25457b906a7f507e59b6e -703031e09114ba2be07f0ed53532d3ae8e505ecc70d42d2b814b6b0e48156def71ea0 -29148b2803aafa921f2a014513bd8a90e477a629794e89fec12d12206dde662ebdcf6 -5670e51f4d7773a36a208a866301dbb2858e40dc5638017527cf91aef32d3848eebe0 -971 -KE1: 037342f0bcb3ecea754c1e67576c86aa90c1de3875f390ad599a26686cdfee6e -07ab3d33bde0e93eda72392346a7a73051110674bbf6b1b7ffab8be4f91fdaeeb1034 +registration_upload: 03763748cc2dfe4f6f80f8e4f3087b2d2222a7c9ba7d3c3a +a8e89c4975eed0999f5b042a53415b5db1161dacf9f9ef0c30ed6b0179038e5e8e5a0 +aa087c8bc0753a921f2a014513bd8a90e477a629794e89fec12d12206dde662ebdcf6 +5670e51f6f7b04d6f92795c9bdb72da5ebe7745b8a6c38fc64c391b1be60b4f49ff2c +e67 +KE1: 036514cf26a2578f1a45ea8faf540e52b237236ee97dc54948eca7b7f71ba9e1 +29ab3d33bde0e93eda72392346a7a73051110674bbf6b1b7ffab8be4f91fdaeeb1034 93f36ca12467d1f5eaaabea67ca31377c4869c1e9a62346b6f01a991624b95d -KE2: 0246da9fe4d41d5ba69faa6c509a1d5bafd49a48615a47a8dd4b0823cc147648 -1138fe59af0df2c79f57b8780278f5ae47355fe1f817119041951c80f612fdfc6d2f0 -c547f70deaeca54d878c14c1aa5e1ab405dec833777132eea905c2fbb12504a67dcbe -0e66740c76b62c13b04a38a77926e19072953319ec65e41f9bfd2ae268d7f10604202 -1c80300e4c6f585980cf39fc51a4a6bba41b0729f9b240c729e5671cd9960ecef2fe0 +KE2: 036ebcb79716cf2ecd0b3e5f3141709f72feb7369d2de41c61e0fa5695e78385 +3e38fe59af0df2c79f57b8780278f5ae47355fe1f817119041951c80f612fdfc6d286 +5751562662eea8de000fdfd4cd1bf506b137d12f28bffaf11a0d720c6ddfe532b2aff +31acb0a8fbb89de1e29cc5a93a33f2e259cf59ad6c88a473d5f056aeb211efe68628e +45c388328e97b78809368c72b9efc78fe51ecc7f5b6f7f4c4c2e471cd9960ecef2fe0 d0f7494986fa3d8b2bb01963537e60efb13981e138e3d4a1020e67941e94deba83521 -4421d2d8c90de9b0f7f925d11e2032ce19b1832ae8e0fdca637d2a5390f4c809a67b4 -6977c536fe9f643f703178a17a413d14e4bb523c -KE3: 298cd0077d018f122bc95d706e5fef06537814c567f08d5e40b0c0ae918f9287 -export_key: c3c9a1b0e33ac84dd83d0b7e8af6794e17e7a3caadff289fbd9dc769a -853c64b -session_key: 0c59872e9bcdde274f4f52f6ba0fd1acca211d6eb7db98677b457a73 -9ef1f0d8 +4421d2d8c90de9b0f7f925d11e2032ce19b1832ae8e0f182fa038ada128f4440131f9 +8adc14cfbdf9045d95b6a55db9b38ffd0aa539f7 +KE3: a9a61a2442845e83b86c22d56ff038893208fcb0e2026d65e2a04f87497e873f +export_key: 00e1f2a1613c78183ec5127f805d320f31ce5dfef70d78f64d327d6c6 +e325ae1 +session_key: 9d15a7020c089b7c7ab7d6341e34a16260279b59dda8d63cabd3da0b +a14da32c ~~~ ## Fake Test Vectors {#fake-vectors} @@ -703,7 +467,7 @@ session_key: 0c59872e9bcdde274f4f52f6ba0fd1acca211d6eb7db98677b457a73 #### Configuration ~~~ -OPRF: ristretto255-SHA512 +OPRF: 0001 Hash: SHA512 KSF: Identity KDF: HKDF-SHA512 @@ -739,14 +503,14 @@ server_public_key: 825f832667480f08b0c9069da5083ac4d0e9ee31b49c4e0310 031fea04d52966 server_nonce: 1e10f6eeab2a7a420bf09da9b27a4639645622c46358de9cf7ae813 055ae2d12 -server_public_keyshare: 5236e2e06d49f0b496db2a786f6ee1016f15b4fd6c0db -d95d6b117055d914157 +server_keyshare: 5236e2e06d49f0b496db2a786f6ee1016f15b4fd6c0dbd95d6b1 +17055d914157 server_private_keyshare: 6d8fba9741a357584770f85294430bce2252fe212a8a 372152a73c7ffe414503 masking_key: 39ebd51f0e39a07a1c2d2431995b0399bca9996c5d10014d6ebab445 3dc10ce5cef38ed3df6e56bfff40c2d8dd4671c2b4cf63c3d54860f31fe40220d690b b71 -KE1: b0a26dcaca2230b8f5e4b1bcab9c84b586140221bb8b2848486874b0be448905 +KE1: 20098d3321812eab08e9f3ccd5640d26194cb5cf73f4c5d551f9fea8f5a5765f 42d4e61ed3f8d64cdd3b9d153343eca15b9b0d5e388232793c6376bd2d9cfd0a0e4ed 8bcc15f3dd01a30365c97c0c0de0a3dd3fbf5d3cbec55fb6ac1d3bf740f ~~~ @@ -754,16 +518,16 @@ KE1: b0a26dcaca2230b8f5e4b1bcab9c84b586140221bb8b2848486874b0be448905 #### Output Values ~~~ -KE2: 928f79ad8df21963e91411b9f55165ba833dea918f441db967cdc09521d22925 +KE2: e891a2527f657f5a72d723c735e9c3ae9179275f8e74f89a81418561b1db5670 9c035896a043e70f897d87180c543e7a063b83c1bb728fbd189c619e27b6e5a632b5a b1bff96636144faa4f9f9afaac75dd88ea99cf5175902ae3f3b2195693f165f11929b a510a5978e64dcdabecbd7ee1e4380ce270e58fea58e6462d92964a1aaef72698bca1 c673baeb04cc2bf7de5f3c2f5553464552d3a0f7698a9ca7f9c5e70c6cb1f706b2f17 5ab9d04bbd13926e816b6811a50b4aafa9799d5ed7971e10f6eeab2a7a420bf09da9b 27a4639645622c46358de9cf7ae813055ae2d125236e2e06d49f0b496db2a786f6ee1 -016f15b4fd6c0dbd95d6b117055d914157cb5e11625c701e642293ad32bfcf88da653 -c9b6e71efc8a89607fd46ed5e7b9bf7cc7dbb997a4fd41194a04bcd0c5d88052e080a -2f02c68d8d9e9c0ce15c92ff +016f15b4fd6c0dbd95d6b117055d9141571ef6a1ac9c84f21e6914ecb5d2020fe50c2 +5b3c026b9f7a877c7526c13309cc4dd4d33050932c627813a67ceb1d3a8e0065fd55a +054296ef3097c6a8a04ac33c ~~~ ### OPAQUE-3DH Fake Test Vector 2 @@ -771,75 +535,7 @@ c9b6e71efc8a89607fd46ed5e7b9bf7cc7dbb997a4fd41194a04bcd0c5d88052e080a #### Configuration ~~~ -OPRF: ristretto255-SHA512 -Hash: SHA512 -KSF: Identity -KDF: HKDF-SHA512 -MAC: HMAC-SHA512 -Group: curve25519 -Context: 4f50415155452d504f43 -Nh: 64 -Npk: 32 -Nsk: 32 -Nm: 64 -Nx: 64 -Nok: 32 -~~~ - -#### Input Values - -~~~ -client_identity: 616c696365 -server_identity: 626f62 -oprf_seed: 66e650652a8266b2205f31fdd68adeb739a05b5e650b19e7edc75e734a -1296d6088188ca46c31ae8ccbd42a52ed338c06e53645387a7efbc94b6a0449526155 -e -credential_identifier: 31323334 -masking_nonce: 9c035896a043e70f897d87180c543e7a063b83c1bb728fbd189c61 -9e27b6e5a6 -client_private_key: 288bf63470199221847bb035d99f96531adf8badd14cb1571 -b48f7a506649660 -client_public_key: 3c64a3153854cc9f0c23aab3c1a19106ec8bab4730736d1d00 -3880a1d5a59005 -server_private_key: 30fbe7e830be1fe8d2187c97414e3826040cbe49b893b6422 -9bab5e85a588846 -server_public_key: 78b3040047ff26572a7619617601a61b9c81899bee92f00cfc -aa5eed96863555 -server_nonce: 1e10f6eeab2a7a420bf09da9b27a4639645622c46358de9cf7ae813 -055ae2d12 -server_public_keyshare: 2d9055eb8f83e1b497370adad5cc2a417bf9be436a792 -def0c7b7ccb92b9e275 -server_private_keyshare: 300b0937f47d45f6123a4d8f0d0c0814b6120d840ebb -8bc5b4f6b62df07f7842 -masking_key: 79ad2621b0757a447dff7108a8ae20a068ce67872095620f415ea611 -c9dcc04972fa359538cd2fd6528775ca775487b2b56db642049b8a90526b975a38484 -c6a -KE1: b0a26dcaca2230b8f5e4b1bcab9c84b586140221bb8b2848486874b0be448905 -42d4e61ed3f8d64cdd3b9d153343eca15b9b0d5e388232793c6376bd2d9cfd0ac059b -7ba2aec863933ae48816360c7a9022e83d822704f3b0b86c0502a66e574 -~~~ - -#### Output Values - -~~~ -KE2: 6606b6fedbb33f19a81a1feb5149c600fe77252f58acd3080d7504d3dad4922f -9c035896a043e70f897d87180c543e7a063b83c1bb728fbd189c619e27b6e5a67db39 -8c0f65d8c298eac430abdae4c80e82b552fb940c00f0cbcea853c0f96c1c15099f3d4 -b0e83ecc249613116d605b8d77bb68bdf76994c2bc507e2dcae4176f00afed68ad25c -f3040a0e991acece31ca532117f5c12816997372ff031ad04ebcdce06c501da24e7b4 -db95343456e2ed260895ec362694230a1fa20e24a9c71e10f6eeab2a7a420bf09da9b -27a4639645622c46358de9cf7ae813055ae2d122d9055eb8f83e1b497370adad5cc2a -417bf9be436a792def0c7b7ccb92b9e27513c6a0d5d96e939563ad168990ed0156b8d -8fb82888ce111f217b1103b4c6d67ee9738777033dd0d85e39776993b5f1f7fa4252b -13a9c37c0fdd06204ca315c6 -~~~ - -### OPAQUE-3DH Fake Test Vector 3 - -#### Configuration - -~~~ -OPRF: P256-SHA256 +OPRF: 0003 Hash: SHA256 KSF: Identity KDF: HKDF-SHA256 @@ -874,27 +570,27 @@ server_public_key: 0221e034c0e202fe883dcfc96802a7624166fed4cfcab4ae30 cf5f3290d01c88bf server_nonce: 1e10f6eeab2a7a420bf09da9b27a4639645622c46358de9cf7ae813 055ae2d12 -server_public_keyshare: 03f42965d5bcba2a590a49eb2418061effe40b5c29a34 -b8e5163e0ef32044b2e4c +server_keyshare: 03f42965d5bcba2a590a49eb2418061effe40b5c29a34b8e5163 +e0ef32044b2e4c server_private_keyshare: 1a2a0ff27f3ca75221378a2a21fe5222ce0b439452f8 70475857a34197ba8f6d masking_key: caecc6ccb4cae27cb54d8f3a1af1bac52a3d53107ce08497cdd362b1 992e4e5e -KE1: 0396875da2b4f7749bba411513aea02dc514a48d169d8a9531bd61d3af3fa9ba -ae42d4e61ed3f8d64cdd3b9d153343eca15b9b0d5e388232793c6376bd2d9cfd0a039 +KE1: 0223afb7e2362271bdf2e20c62e25819e65d379308dfa4d9911f2fc7ada2296f +7f42d4e61ed3f8d64cdd3b9d153343eca15b9b0d5e388232793c6376bd2d9cfd0a039 94d4f1221bfd205063469e92ea4d492f7cc76a327223633ab74590c30cf7285 ~~~ #### Output Values ~~~ -KE2: 0201198dcd13f9792eb75dcfa815f61b049abfe2e3e9456d4bbbceec5f442efd -049c035896a043e70f897d87180c543e7a063b83c1bb728fbd189c619e27b6e5a6fac +KE2: 029c5324a734851923b27ea573dce1c2ed10c497ee222c5500763c96c5209db0 +cd9c035896a043e70f897d87180c543e7a063b83c1bb728fbd189c619e27b6e5a6fac da65ce0a97b9085e7af07f61fd3fdd046d257cbf2183ce8766090b8041a8bf28d79dd 4c9031ddc75bb6ddb4c291e639937840e3d39fc0d5a3d6e7723c09f7945df485bcf9a efe3fe82d149e84049e259bb5b33d6a2ff3b25e4bfb7eff0962821e10f6eeab2a7a42 0bf09da9b27a4639645622c46358de9cf7ae813055ae2d1203f42965d5bcba2a590a4 -9eb2418061effe40b5c29a34b8e5163e0ef32044b2e4c196137813ed8ec48627f0b0d -90d9427f4ec137f8360769df167c25836eae5d91 +9eb2418061effe40b5c29a34b8e5163e0ef32044b2e4c1bf93ad07640bc9ed22e2a33 +8734d55d0d22f5cc16d179e5aa4cce845b9a04a8 ~~~ "#; diff --git a/src/tests/parser.rs b/src/tests/parser.rs index 09ced9d2..e1bf82cf 100644 --- a/src/tests/parser.rs +++ b/src/tests/parser.rs @@ -36,7 +36,7 @@ fn parse_vector_types(input: &str) -> String { fn parse_ciphersuites(input: &str) -> String { let re = regex::Regex::new( - r"#### Configuration\n(.|\n)*?OPRF: (?P.*?)\n(.|\n)*?Group: (?P.*?)\n", + r"# Configuration(.|\n)+?Hash: (?P.*?)\n(.|\n)*?Group: (?P.*?)\n", ) .unwrap(); let mut ciphersuites = vec![]; @@ -47,8 +47,8 @@ fn parse_ciphersuites(input: &str) -> String { for caps in re.captures_iter(input) { let ciphersuite = format!( "{{ \"{}, {}\": {{ {} }} }}", - &caps["oprf"], &caps["group"], + &caps["hash"], parse_params(chunks[count]) ); ciphersuites.push(ciphersuite); @@ -86,7 +86,7 @@ fn parse_params(input: &str) -> String { let key = iter.next().unwrap().split_whitespace().next().unwrap(); let val = iter.next().unwrap().split_whitespace().next().unwrap(); - param = format!(" \"{key}\": \"{val}"); + param = format!(" \"{}\": \"{}", key, val); } else { let s = line.trim().to_string(); if s.contains('~') || s.contains('#') { diff --git a/src/tests/test_opaque_vectors.rs b/src/tests/test_opaque_vectors.rs index e90c1b23..3f0d67a4 100644 --- a/src/tests/test_opaque_vectors.rs +++ b/src/tests/test_opaque_vectors.rs @@ -36,12 +36,12 @@ use crate::tests::mock_rng::CycleRng; use crate::*; #[allow(non_snake_case)] +#[allow(dead_code)] #[derive(Debug)] pub struct OpaqueTestVectorParameters { pub dummy_private_key: Vec, pub dummy_masking_key: Vec, pub context: Vec, - #[allow(dead_code)] // client_private_key is not tested in the test vectors pub client_private_key: Option>, pub client_keyshare: Vec, pub client_private_keyshare: Vec, @@ -59,6 +59,8 @@ pub struct OpaqueTestVectorParameters { pub envelope_nonce: Vec, pub client_nonce: Vec, pub server_nonce: Vec, + pub client_info: Vec, + pub server_info: Vec, pub registration_request: Vec, pub registration_response: Vec, pub registration_upload: Vec, @@ -126,11 +128,11 @@ where }, context: parse!(values, "Context"), client_private_key: decode(values, "client_private_key"), - client_keyshare: parse!(values, "client_public_keyshare"), + client_keyshare: parse!(values, "client_keyshare"), client_private_keyshare: parse!(values, "client_private_keyshare"), server_public_key: parse!(values, "server_public_key"), server_private_key: parse!(values, "server_private_key"), - server_keyshare: parse!(values, "server_public_keyshare"), + server_keyshare: parse!(values, "server_keyshare"), server_private_keyshare: parse!(values, "server_private_keyshare"), client_identity: decode(values, "client_identity"), server_identity: decode(values, "server_identity"), @@ -142,6 +144,8 @@ where envelope_nonce: parse!(values, "envelope_nonce"), client_nonce: parse!(values, "client_nonce"), server_nonce: parse!(values, "server_nonce"), + client_info: parse!(values, "client_info"), + server_info: parse!(values, "server_info"), registration_request: parse!(values, "registration_request"), registration_response: parse!(values, "registration_response"), registration_upload: parse!(values, "registration_upload"), @@ -152,7 +156,7 @@ where export_key: parse!(values, "export_key"), session_key: parse!(values, "session_key"), auth_key: parse!(values, "auth_key"), - randomized_pwd: parse!(values, "randomized_password"), + 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"), @@ -215,19 +219,11 @@ fn tests() -> Result<(), ProtocolError> { type Ksf = Identity; } - let ristretto_real_tvs = json_to_test_vectors!( - rfc, - "Real", - "ristretto255-SHA512, ristretto255", - Ristretto255Sha512NoKsf - ); + let ristretto_real_tvs = + json_to_test_vectors!(rfc, "Real", "ristretto255, SHA512", Ristretto255Sha512NoKsf); - let ristretto_fake_tvs = json_to_test_vectors!( - rfc, - "Fake", - "ristretto255-SHA512, ristretto255", - Ristretto255Sha512NoKsf - ); + let ristretto_fake_tvs = + json_to_test_vectors!(rfc, "Fake", "ristretto255, SHA512", Ristretto255Sha512NoKsf); assert!( !(ristretto_real_tvs.is_empty() || ristretto_fake_tvs.is_empty()), @@ -244,45 +240,6 @@ fn tests() -> Result<(), ProtocolError> { test_fake_vectors::(&ristretto_fake_tvs)?; } - #[cfg(all(feature = "ristretto255", feature = "curve25519"))] - { - struct Ristretto255Sha512Curve25519NoKsf; - impl CipherSuite for Ristretto255Sha512Curve25519NoKsf { - type OprfCs = crate::Ristretto255; - type KeGroup = crate::Curve25519; - type KeyExchange = TripleDh; - type Ksf = Identity; - } - - let ristretto_real_tvs = json_to_test_vectors!( - rfc, - "Real", - "ristretto255-SHA512, curve25519", - Ristretto255Sha512Curve25519NoKsf - ); - - let ristretto_fake_tvs = json_to_test_vectors!( - rfc, - "Fake", - "ristretto255-SHA512, curve25519", - Ristretto255Sha512Curve25519NoKsf - ); - - assert!( - !(ristretto_real_tvs.is_empty() || ristretto_fake_tvs.is_empty()), - "Parsing error" - ); - - test_registration_request::(&ristretto_real_tvs)?; - test_registration_response::(&ristretto_real_tvs)?; - test_registration_upload::(&ristretto_real_tvs)?; - test_ke1::(&ristretto_real_tvs)?; - test_ke2::(&ristretto_real_tvs)?; - test_ke3::(&ristretto_real_tvs)?; - test_server_login_finish::(&ristretto_real_tvs)?; - test_fake_vectors::(&ristretto_fake_tvs)?; - } - struct P256Sha256NoKsf; impl CipherSuite for P256Sha256NoKsf { type OprfCs = p256::NistP256; @@ -294,13 +251,13 @@ fn tests() -> Result<(), ProtocolError> { let p256_real_tvs = json_to_test_vectors!( rfc, "Real", - "P256-SHA256, P256_XMD:SHA-256_SSWU_RO_", + "P256_XMD:SHA-256_SSWU_RO_, SHA256", P256Sha256NoKsf ); let p256_fake_tvs = json_to_test_vectors!( rfc, "Fake", - "P256-SHA256, P256_XMD:SHA-256_SSWU_RO_", + "P256_XMD:SHA-256_SSWU_RO_, SHA256", P256Sha256NoKsf ); @@ -372,10 +329,6 @@ where RegistrationRequest::deserialize(¶meters.registration_request).unwrap(), ¶meters.credential_identifier, )?; - assert_eq!( - hex::encode(¶meters.server_public_key), - hex::encode(server_setup.keypair().public().serialize()), - ); assert_eq!( hex::encode(¶meters.oprf_key), hex::encode(server_registration_start_result.oprf_key)