Re-export the frost-core traits and rand-core as part of top-level impls API (#297)

* Re-export the frost-core traits and rand-core as part of top-level impls API

* Don't export frost_core::frost

---------

Co-authored-by: Conrado Gouvea <conradoplg@gmail.com>
This commit is contained in:
Deirdre Connolly 2023-04-13 21:04:17 -04:00 committed by GitHub
parent b829d4ff9f
commit cf7ebcb34e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 28 additions and 10 deletions

View File

@ -11,11 +11,15 @@ use curve25519_dalek::{
use rand_core::{CryptoRng, RngCore};
use sha2::{Digest, Sha512};
use frost_core::{frost, Ciphersuite, Field, FieldError, Group, GroupError};
use frost_core::frost;
#[cfg(test)]
mod tests;
// Re-exports in our public API
pub use frost_core::{Ciphersuite, Field, FieldError, Group, GroupError};
pub use rand_core;
/// An error.
pub type Error = frost_core::Error<Ed25519Sha512>;

View File

@ -1,4 +1,3 @@
use frost_core::{Ciphersuite, Group, GroupError};
use frost_ed25519::*;
use curve25519_dalek::{edwards::EdwardsPoint, traits::Identity};

View File

@ -12,11 +12,15 @@ use sha3::{
Shake256,
};
use frost_core::{frost, Ciphersuite, Field, FieldError, Group, GroupError};
use frost_core::frost;
#[cfg(test)]
mod tests;
// Re-exports in our public API
pub use frost_core::{Ciphersuite, Field, FieldError, Group, GroupError};
pub use rand_core;
/// An error.
pub type Error = frost_core::Error<Ed448Shake256>;

View File

@ -1,5 +1,5 @@
use ed448_goldilocks::curve::ExtendedPoint;
use frost_core::{Ciphersuite, Group, GroupError};
use frost_ed448::*;
use rand::thread_rng;

View File

@ -13,11 +13,15 @@ use p256::{
use rand_core::{CryptoRng, RngCore};
use sha2::{Digest, Sha256};
use frost_core::{frost, Ciphersuite, Field, FieldError, Group, GroupError};
use frost_core::frost;
#[cfg(test)]
mod tests;
// Re-exports in our public API
pub use frost_core::{Ciphersuite, Field, FieldError, Group, GroupError};
pub use rand_core;
/// An error.
pub type Error = frost_core::Error<P256Sha256>;

View File

@ -1,4 +1,3 @@
use frost_core::{Ciphersuite, Group, GroupError};
use frost_p256::*;
use rand::thread_rng;

View File

@ -12,6 +12,8 @@ use frost_core::{
Ciphersuite, Error, Field, Group, VerifyingKey,
};
// When pulled into `reddsa`, that has its own sibling `rand_core` import.
// For the time being, we do not re-export this `rand_core`.
use rand_core::{CryptoRng, RngCore};
/// Performed once by each participant selected for the signing operation.

View File

@ -11,11 +11,15 @@ use curve25519_dalek::{
use rand_core::{CryptoRng, RngCore};
use sha2::{Digest, Sha512};
use frost_core::{frost, Ciphersuite, Field, FieldError, Group, GroupError};
use frost_core::frost;
#[cfg(test)]
mod tests;
// Re-exports in our public API
pub use frost_core::{Ciphersuite, Field, FieldError, Group, GroupError};
pub use rand_core;
/// An error.
pub type Error = frost_core::Error<Ristretto255Sha512>;

View File

@ -1,5 +1,4 @@
use curve25519_dalek::{ristretto::RistrettoPoint, traits::Identity};
use frost_core::{Ciphersuite, Group, GroupError};
use frost_ristretto255::*;
use rand::thread_rng;

View File

@ -14,11 +14,15 @@ use k256::{
use rand_core::{CryptoRng, RngCore};
use sha2::{Digest, Sha256};
use frost_core::{frost, Ciphersuite, Field, FieldError, Group, GroupError};
use frost_core::frost;
#[cfg(test)]
mod tests;
// Re-exports in our public API
pub use frost_core::{Ciphersuite, Field, FieldError, Group, GroupError};
pub use rand_core;
/// An error.
pub type Error = frost_core::Error<Secp256K1Sha256>;

View File

@ -1,4 +1,3 @@
use frost_core::{Ciphersuite, Group, GroupError};
use frost_secp256k1::*;
use rand::thread_rng;