diff --git a/Cargo.lock b/Cargo.lock index 252ef1a4..e2a311f3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1695,7 +1695,6 @@ dependencies = [ "ciphersuite", "dleq", "flexible-transcript", - "group", "multiexp", "rand_core 0.6.4", "schnorr-signatures", @@ -4675,7 +4674,6 @@ dependencies = [ "dkg", "dleq", "flexible-transcript", - "group", "hex", "minimal-ed448", "multiexp", @@ -7521,7 +7519,6 @@ dependencies = [ "ciphersuite", "dalek-ff-group", "flexible-transcript", - "group", "hex", "multiexp", "rand_core 0.6.4", diff --git a/crypto/ciphersuite/src/lib.rs b/crypto/ciphersuite/src/lib.rs index fde5306c..11533a73 100644 --- a/crypto/ciphersuite/src/lib.rs +++ b/crypto/ciphersuite/src/lib.rs @@ -14,6 +14,7 @@ use subtle::ConstantTimeEq; use digest::{core_api::BlockSizeUser, Digest, HashMarker}; use transcript::SecureDigest; +pub use group; use group::{ ff::{Field, PrimeField, PrimeFieldBits}, Group, GroupOps, diff --git a/crypto/dkg/Cargo.toml b/crypto/dkg/Cargo.toml index 22403f7b..1822cb4c 100644 --- a/crypto/dkg/Cargo.toml +++ b/crypto/dkg/Cargo.toml @@ -24,9 +24,8 @@ serde = { version = "1", features = ["derive"], optional = true } transcript = { package = "flexible-transcript", path = "../transcript", version = "0.2", features = ["recommended"] } chacha20 = { version = "0.9", features = ["zeroize"] } -group = "0.12" -multiexp = { path = "../multiexp", version = "0.2", features = ["batch"] } ciphersuite = { path = "../ciphersuite", version = "0.1", features = ["std"] } +multiexp = { path = "../multiexp", version = "0.2", features = ["batch"] } schnorr = { package = "schnorr-signatures", path = "../schnorr", version = "0.2" } dleq = { path = "../dleq", version = "0.2", features = ["serialize"] } diff --git a/crypto/dkg/src/encryption.rs b/crypto/dkg/src/encryption.rs index cbf61a99..c37221ec 100644 --- a/crypto/dkg/src/encryption.rs +++ b/crypto/dkg/src/encryption.rs @@ -17,9 +17,8 @@ use chacha20::{ use transcript::{Transcript, RecommendedTranscript}; #[cfg(test)] -use group::ff::Field; -use group::GroupEncoding; -use ciphersuite::Ciphersuite; +use ciphersuite::group::ff::Field; +use ciphersuite::{group::GroupEncoding, Ciphersuite}; use multiexp::BatchVerifier; use schnorr::SchnorrSignature; @@ -222,7 +221,7 @@ impl EncryptedMessage { from: Participant, to: C::G, ) { - use group::ff::PrimeField; + use ciphersuite::group::ff::PrimeField; let mut repr = ::Repr::default(); for b in repr.as_mut().iter_mut() { @@ -246,7 +245,7 @@ impl EncryptedMessage { from: Participant, to: C::G, ) { - use group::ff::PrimeField; + use ciphersuite::group::ff::PrimeField; // Assumes the share isn't randomly 1 let repr = C::F::one().to_repr(); diff --git a/crypto/dkg/src/frost.rs b/crypto/dkg/src/frost.rs index e2e7c64b..f137e04b 100644 --- a/crypto/dkg/src/frost.rs +++ b/crypto/dkg/src/frost.rs @@ -10,11 +10,13 @@ use zeroize::{Zeroize, ZeroizeOnDrop, Zeroizing}; use transcript::{Transcript, RecommendedTranscript}; -use group::{ - ff::{Field, PrimeField}, - Group, GroupEncoding, +use ciphersuite::{ + group::{ + ff::{Field, PrimeField}, + Group, GroupEncoding, + }, + Ciphersuite, }; -use ciphersuite::Ciphersuite; use multiexp::{multiexp_vartime, BatchVerifier}; use schnorr::SchnorrSignature; diff --git a/crypto/dkg/src/lib.rs b/crypto/dkg/src/lib.rs index e2e2c70d..81e58b1b 100644 --- a/crypto/dkg/src/lib.rs +++ b/crypto/dkg/src/lib.rs @@ -16,13 +16,14 @@ use thiserror::Error; use zeroize::{Zeroize, Zeroizing}; -use group::{ - ff::{Field, PrimeField}, - GroupEncoding, +use ciphersuite::{ + group::{ + ff::{Field, PrimeField}, + GroupEncoding, + }, + Ciphersuite, }; -use ciphersuite::Ciphersuite; - /// Encryption types and utilities used to secure DKG messages. pub mod encryption; diff --git a/crypto/dkg/src/promote.rs b/crypto/dkg/src/promote.rs index 9399224d..7edb85d5 100644 --- a/crypto/dkg/src/promote.rs +++ b/crypto/dkg/src/promote.rs @@ -7,9 +7,7 @@ use std::{ use rand_core::{RngCore, CryptoRng}; -use group::GroupEncoding; - -use ciphersuite::Ciphersuite; +use ciphersuite::{group::GroupEncoding, Ciphersuite}; use transcript::{Transcript, RecommendedTranscript}; use dleq::DLEqProof; diff --git a/crypto/dkg/src/tests/mod.rs b/crypto/dkg/src/tests/mod.rs index db14f250..5617121f 100644 --- a/crypto/dkg/src/tests/mod.rs +++ b/crypto/dkg/src/tests/mod.rs @@ -3,9 +3,7 @@ use std::collections::HashMap; use rand_core::{RngCore, CryptoRng}; -use group::ff::Field; - -use ciphersuite::Ciphersuite; +use ciphersuite::{group::ff::Field, Ciphersuite}; use crate::{Participant, ThresholdCore, ThresholdKeys, lagrange}; diff --git a/crypto/dkg/src/tests/promote.rs b/crypto/dkg/src/tests/promote.rs index e9fefc07..99c00433 100644 --- a/crypto/dkg/src/tests/promote.rs +++ b/crypto/dkg/src/tests/promote.rs @@ -5,9 +5,7 @@ use rand_core::{RngCore, CryptoRng}; use zeroize::Zeroize; -use group::Group; - -use ciphersuite::Ciphersuite; +use ciphersuite::{group::Group, Ciphersuite}; use crate::{ promote::{GeneratorPromotion, GeneratorProof}, diff --git a/crypto/frost/Cargo.toml b/crypto/frost/Cargo.toml index 2cbfcf89..637c1498 100644 --- a/crypto/frost/Cargo.toml +++ b/crypto/frost/Cargo.toml @@ -26,12 +26,11 @@ hex = { version = "0.4", optional = true } digest = "0.10" transcript = { package = "flexible-transcript", path = "../transcript", version = "0.2", features = ["recommended"] } -group = "0.12" -ciphersuite = { path = "../ciphersuite", version = "0.1", features = ["std"] } - dalek-ff-group = { path = "../dalek-ff-group", version = "^0.1.2", optional = true } minimal-ed448 = { path = "../ed448", version = "^0.1.2", optional = true } +ciphersuite = { path = "../ciphersuite", version = "0.1", features = ["std"] } + multiexp = { path = "../multiexp", version = "0.2", features = ["batch"] } schnorr = { package = "schnorr-signatures", path = "../schnorr", version = "0.2" } diff --git a/crypto/frost/src/curve/ed448.rs b/crypto/frost/src/curve/ed448.rs index 05877dbe..5b24dad0 100644 --- a/crypto/frost/src/curve/ed448.rs +++ b/crypto/frost/src/curve/ed448.rs @@ -1,10 +1,7 @@ use digest::Digest; -use group::GroupEncoding; - use minimal_ed448::{Scalar, Point}; - -pub use ciphersuite::{Shake256_114, Ed448}; +pub use ciphersuite::{group::GroupEncoding, Shake256_114, Ed448}; use crate::{curve::Curve, algorithm::Hram}; diff --git a/crypto/frost/src/curve/kp256.rs b/crypto/frost/src/curve/kp256.rs index 653d5c18..582d9d1d 100644 --- a/crypto/frost/src/curve/kp256.rs +++ b/crypto/frost/src/curve/kp256.rs @@ -1,6 +1,4 @@ -use group::GroupEncoding; - -use ciphersuite::Ciphersuite; +use ciphersuite::{group::GroupEncoding, Ciphersuite}; use crate::{curve::Curve, algorithm::Hram}; diff --git a/crypto/frost/src/curve/mod.rs b/crypto/frost/src/curve/mod.rs index f4e705d2..a941bbe7 100644 --- a/crypto/frost/src/curve/mod.rs +++ b/crypto/frost/src/curve/mod.rs @@ -8,13 +8,14 @@ use subtle::ConstantTimeEq; use digest::{Digest, Output}; -use group::{ - ff::{Field, PrimeField}, - Group, +pub use ciphersuite::{ + group::{ + ff::{Field, PrimeField}, + Group, + }, + Ciphersuite, }; -pub use ciphersuite::Ciphersuite; - #[cfg(any(feature = "ristretto", feature = "ed25519"))] mod dalek; #[cfg(feature = "ristretto")] diff --git a/crypto/frost/src/nonce.rs b/crypto/frost/src/nonce.rs index 2268c755..6b156212 100644 --- a/crypto/frost/src/nonce.rs +++ b/crypto/frost/src/nonce.rs @@ -21,7 +21,7 @@ use zeroize::{Zeroize, Zeroizing}; use transcript::Transcript; -use group::{ff::PrimeField, Group, GroupEncoding}; +use ciphersuite::group::{ff::PrimeField, Group, GroupEncoding}; use multiexp::multiexp_vartime; use dleq::MultiDLEqProof; diff --git a/crypto/frost/src/sign.rs b/crypto/frost/src/sign.rs index a92732eb..52507e7f 100644 --- a/crypto/frost/src/sign.rs +++ b/crypto/frost/src/sign.rs @@ -11,7 +11,7 @@ use zeroize::{Zeroize, Zeroizing}; use transcript::Transcript; -use group::{ff::PrimeField, GroupEncoding}; +use ciphersuite::group::{ff::PrimeField, GroupEncoding}; use multiexp::BatchVerifier; use crate::{ @@ -195,7 +195,7 @@ impl Writable for SignatureShare { #[cfg(any(test, feature = "tests"))] impl SignatureShare { pub(crate) fn invalidate(&mut self) { - use group::ff::Field; + use ciphersuite::group::ff::Field; self.0 += C::F::one(); } diff --git a/crypto/frost/src/tests/nonces.rs b/crypto/frost/src/tests/nonces.rs index 134d4a28..a4fdd19e 100644 --- a/crypto/frost/src/tests/nonces.rs +++ b/crypto/frost/src/tests/nonces.rs @@ -7,7 +7,7 @@ use rand_chacha::ChaCha20Rng; use transcript::{Transcript, RecommendedTranscript}; -use group::{ff::Field, Group, GroupEncoding}; +use ciphersuite::group::{ff::Field, Group, GroupEncoding}; use dleq::MultiDLEqProof; pub use dkg::tests::{key_gen, recover_key}; diff --git a/crypto/frost/src/tests/vectors.rs b/crypto/frost/src/tests/vectors.rs index 14c303af..e92474b2 100644 --- a/crypto/frost/src/tests/vectors.rs +++ b/crypto/frost/src/tests/vectors.rs @@ -9,7 +9,7 @@ use zeroize::Zeroizing; use rand_core::{RngCore, CryptoRng, SeedableRng}; use rand_chacha::ChaCha20Rng; -use group::{ff::PrimeField, GroupEncoding}; +use ciphersuite::group::{ff::PrimeField, GroupEncoding}; use crate::{ curve::Curve, diff --git a/crypto/schnorr/Cargo.toml b/crypto/schnorr/Cargo.toml index f6a2ea89..e6d9e1c6 100644 --- a/crypto/schnorr/Cargo.toml +++ b/crypto/schnorr/Cargo.toml @@ -19,9 +19,8 @@ zeroize = { version = "^1.5", features = ["zeroize_derive"] } transcript = { package = "flexible-transcript", path = "../transcript", version = "0.2" } -group = "0.12" -multiexp = { path = "../multiexp", version = "0.2", features = ["batch"] } ciphersuite = { path = "../ciphersuite", version = "0.1" } +multiexp = { path = "../multiexp", version = "0.2", features = ["batch"] } [dev-dependencies] hex = "0.4" diff --git a/crypto/schnorr/src/aggregate.rs b/crypto/schnorr/src/aggregate.rs index bcd36910..c45abff9 100644 --- a/crypto/schnorr/src/aggregate.rs +++ b/crypto/schnorr/src/aggregate.rs @@ -4,12 +4,14 @@ use zeroize::Zeroize; use transcript::{Transcript, SecureDigest, DigestTranscript}; -use group::{ - ff::{Field, PrimeField}, - Group, GroupEncoding, +use ciphersuite::{ + group::{ + ff::{Field, PrimeField}, + Group, GroupEncoding, + }, + Ciphersuite, }; use multiexp::multiexp_vartime; -use ciphersuite::Ciphersuite; use crate::SchnorrSignature; diff --git a/crypto/schnorr/src/lib.rs b/crypto/schnorr/src/lib.rs index 972d3864..f53fb26c 100644 --- a/crypto/schnorr/src/lib.rs +++ b/crypto/schnorr/src/lib.rs @@ -5,15 +5,15 @@ use rand_core::{RngCore, CryptoRng}; use zeroize::{Zeroize, Zeroizing}; -use group::{ - ff::{Field, PrimeField}, - Group, GroupEncoding, +use ciphersuite::{ + group::{ + ff::{Field, PrimeField}, + Group, GroupEncoding, + }, + Ciphersuite, }; - use multiexp::{multiexp_vartime, BatchVerifier}; -use ciphersuite::Ciphersuite; - pub mod aggregate; #[cfg(test)] diff --git a/crypto/schnorr/src/tests/mod.rs b/crypto/schnorr/src/tests/mod.rs index 1b4fe212..fc434b97 100644 --- a/crypto/schnorr/src/tests/mod.rs +++ b/crypto/schnorr/src/tests/mod.rs @@ -3,11 +3,12 @@ use core::ops::Deref; use zeroize::Zeroizing; use rand_core::OsRng; -use group::{ff::Field, Group}; +use ciphersuite::{ + group::{ff::Field, Group}, + Ciphersuite, Ed25519, +}; use multiexp::BatchVerifier; -use ciphersuite::{Ciphersuite, Ed25519}; - use crate::{ SchnorrSignature, aggregate::{SchnorrAggregator, SchnorrAggregate}, diff --git a/crypto/schnorr/src/tests/rfc8032.rs b/crypto/schnorr/src/tests/rfc8032.rs index 001927ac..991cf450 100644 --- a/crypto/schnorr/src/tests/rfc8032.rs +++ b/crypto/schnorr/src/tests/rfc8032.rs @@ -5,9 +5,8 @@ use sha2::{Digest, Sha512}; -use group::GroupEncoding; use dalek_ff_group::Scalar; -use ciphersuite::{Ciphersuite, Ed25519}; +use ciphersuite::{group::GroupEncoding, Ciphersuite, Ed25519}; use crate::SchnorrSignature;