diff --git a/src/ciphersuite.rs b/src/ciphersuite.rs index 39caf07..afb5466 100644 --- a/src/ciphersuite.rs +++ b/src/ciphersuite.rs @@ -13,8 +13,8 @@ use core::ops::Mul; use digest::block_api::BlockSizeUser; use digest::typenum::{IsLess, IsLessOrEqual, U256}; use digest::{Digest, FixedOutput, HashMarker, OutputSizeUser}; -use hybrid_array::typenum::{IsGreaterOrEqual, Prod, True, U2}; use hybrid_array::ArraySize; +use hybrid_array::typenum::{IsGreaterOrEqual, Prod, True, U2}; /// Configures the underlying primitives used in VOPRF pub trait CipherSuite diff --git a/src/common.rs b/src/common.rs index 7ebfe34..ba0fc9f 100644 --- a/src/common.rs +++ b/src/common.rs @@ -13,7 +13,7 @@ use core::ops::Add; use derive_where::derive_where; use digest::{Digest, Output, OutputSizeUser}; -use hybrid_array::typenum::{IsLess, Unsigned, U2, U256, U9}; +use hybrid_array::typenum::{IsLess, U2, U9, U256, Unsigned}; use hybrid_array::{Array, ArrayN, ArraySize}; use rand_core::{TryCryptoRng, TryRng}; use subtle::ConstantTimeEq; diff --git a/src/group/elliptic_curve.rs b/src/group/elliptic_curve.rs index 5c520ac..1f04cdb 100644 --- a/src/group/elliptic_curve.rs +++ b/src/group/elliptic_curve.rs @@ -16,7 +16,7 @@ use elliptic_curve::{ AffinePoint, Field, FieldBytes, FieldBytesSize, Group as _, ProjectivePoint, PublicKey, Scalar, SecretKey, }; -use hash2curve::{hash_to_scalar, ExpandMsgXmd, GroupDigest}; +use hash2curve::{ExpandMsgXmd, GroupDigest, hash_to_scalar}; use hybrid_array::typenum::{IsGreaterOrEqual, Prod, Sum, True, U2}; use hybrid_array::{Array, ArraySize}; use rand_core::TryCryptoRng; diff --git a/src/group/ristretto.rs b/src/group/ristretto.rs index 06d004a..d5e0b32 100644 --- a/src/group/ristretto.rs +++ b/src/group/ristretto.rs @@ -15,10 +15,10 @@ use curve25519_dalek::traits::Identity; use digest::block_api::BlockSizeUser; use digest::{FixedOutput, HashMarker}; use hash2curve::{ExpandMsg, ExpandMsgXmd, Expander}; -use hybrid_array::typenum::{ - IsGreaterOrEqual, IsLess, IsLessOrEqual, Prod, True, U16, U2, U256, U32, U64, -}; use hybrid_array::Array; +use hybrid_array::typenum::{ + IsGreaterOrEqual, IsLess, IsLessOrEqual, Prod, True, U2, U16, U32, U64, U256, +}; use rand_core::{TryCryptoRng, TryRng}; use subtle::ConstantTimeEq; diff --git a/src/oprf.rs b/src/oprf.rs index 7e57093..488c93b 100644 --- a/src/oprf.rs +++ b/src/oprf.rs @@ -12,13 +12,13 @@ use core::iter::{self, Map}; use derive_where::derive_where; use digest::{Digest, Output}; -use hybrid_array::typenum::Unsigned; use hybrid_array::Array; +use hybrid_array::typenum::Unsigned; use rand_core::{TryCryptoRng, TryRng}; use crate::common::{ - derive_key_internal, deterministic_blind_unchecked, hash_to_group, i2osp_2, - server_evaluate_hash_input, BlindedElement, EvaluationElement, Mode, STR_FINALIZE, + BlindedElement, EvaluationElement, Mode, STR_FINALIZE, derive_key_internal, + deterministic_blind_unchecked, hash_to_group, i2osp_2, server_evaluate_hash_input, }; #[cfg(feature = "serde")] use crate::serialization::serde::Scalar; @@ -267,12 +267,12 @@ fn finalize_after_unblind< mod tests { use core::ptr; - use rand::rngs::SysRng; use rand::TryRng; + use rand::rngs::SysRng; use super::*; - use crate::common::{Dst, STR_HASH_TO_GROUP}; use crate::Group; + use crate::common::{Dst, STR_HASH_TO_GROUP}; fn prf( input: &[u8], diff --git a/src/poprf.rs b/src/poprf.rs index da6c49f..7f12169 100644 --- a/src/poprf.rs +++ b/src/poprf.rs @@ -19,9 +19,9 @@ use hybrid_array::{Array, ArraySize}; use rand_core::{TryCryptoRng, TryRng}; use crate::common::{ - derive_keypair, deterministic_blind_unchecked, generate_proof, hash_to_group, i2osp_2, - server_evaluate_hash_input, verify_proof, BlindedElement, Dst, EvaluationElement, Mode, - PreparedEvaluationElement, Proof, STR_FINALIZE, STR_HASH_TO_SCALAR, STR_INFO, + BlindedElement, Dst, EvaluationElement, Mode, PreparedEvaluationElement, Proof, STR_FINALIZE, + STR_HASH_TO_SCALAR, STR_INFO, derive_keypair, deterministic_blind_unchecked, generate_proof, + hash_to_group, i2osp_2, server_evaluate_hash_input, verify_proof, }; #[cfg(feature = "serde")] use crate::serialization::serde::{Element, Scalar}; @@ -371,7 +371,7 @@ impl PoprfServer { tweaked_key, prepared_evaluation_elements .into_iter() - .map(|element| element.0 .0), + .map(|element| element.0.0), blinded_elements.map(|element| element.0), Mode::Poprf, )?; @@ -379,7 +379,7 @@ impl PoprfServer { let messages = prepared_evaluation_elements.into_iter().map(, ) -> _>::from( - |element| EvaluationElement(element.0 .0), + |element| EvaluationElement(element.0.0), )); Ok(PoprfServerBatchEvaluateFinishResult { messages, proof }) @@ -736,8 +736,8 @@ mod tests { use rand::rngs::SysRng; use super::*; - use crate::common::STR_HASH_TO_GROUP; use crate::Group; + use crate::common::STR_HASH_TO_GROUP; fn prf( input: &[u8], diff --git a/src/serialization.rs b/src/serialization.rs index c33ec37..ecaa8d6 100644 --- a/src/serialization.rs +++ b/src/serialization.rs @@ -9,8 +9,8 @@ //! Handles the serialization of each of the components used in the VOPRF //! protocol -use hybrid_array::typenum::{Sum, Unsigned}; use hybrid_array::Array; +use hybrid_array::typenum::{Sum, Unsigned}; use crate::{ BlindedElement, CipherSuite, Error, EvaluationElement, Group, OprfClient, OprfServer, diff --git a/src/voprf.rs b/src/voprf.rs index d40a07c..ebf43fd 100644 --- a/src/voprf.rs +++ b/src/voprf.rs @@ -14,14 +14,14 @@ use core::iter::{self, Map, Repeat, Zip}; use derive_where::derive_where; use digest::{Digest, Output}; -use hybrid_array::typenum::Unsigned; use hybrid_array::Array; +use hybrid_array::typenum::Unsigned; use rand_core::{TryCryptoRng, TryRng}; use crate::common::{ + BlindedElement, EvaluationElement, Mode, PreparedEvaluationElement, Proof, STR_FINALIZE, derive_keypair, deterministic_blind_unchecked, generate_proof, hash_to_group, i2osp_2, - server_evaluate_hash_input, verify_proof, BlindedElement, EvaluationElement, Mode, - PreparedEvaluationElement, Proof, STR_FINALIZE, + server_evaluate_hash_input, verify_proof, }; #[cfg(feature = "serde")] use crate::serialization::serde::{Element, Scalar}; @@ -343,14 +343,14 @@ impl VoprfServer { g, self.pk, blinded_elements.map(|element| element.0), - evaluation_elements.into_iter().map(|element| element.0 .0), + evaluation_elements.into_iter().map(|element| element.0.0), Mode::Voprf, )?; let messages = evaluation_elements.into_iter().map(, ) -> EvaluationElement>::from( - |element| EvaluationElement(element.0 .0), + |element| EvaluationElement(element.0.0), )); Ok(VoprfServerBatchEvaluateFinishResult { messages, proof }) @@ -553,8 +553,8 @@ mod tests { use rand::rngs::SysRng; use super::*; - use crate::common::{Dst, STR_HASH_TO_GROUP}; use crate::Group; + use crate::common::{Dst, STR_HASH_TO_GROUP}; fn prf( input: &[u8],