diff --git a/fastcrypto-vdf/src/class_group/mod.rs b/fastcrypto-vdf/src/class_group/mod.rs index 35b4d4f65..58514aef9 100644 --- a/fastcrypto-vdf/src/class_group/mod.rs +++ b/fastcrypto-vdf/src/class_group/mod.rs @@ -6,7 +6,7 @@ //! for the composition. use crate::math::extended_gcd::{extended_euclidean_algorithm, EuclideanAlgorithmOutput}; -use crate::math::parameterized_group::{ParameterizedGroupElement, UnknownOrderGroupElement}; +use crate::math::parameterized_group::ParameterizedGroupElement; use core::cell::OnceCell; use discriminant::Discriminant; use fastcrypto::error::FastCryptoError::InvalidInput; @@ -374,8 +374,6 @@ impl Neg for QuadraticForm { } } -impl UnknownOrderGroupElement for QuadraticForm {} - impl PartialEq for QuadraticForm { fn eq(&self, other: &Self) -> bool { // Ignore the partial_gcd_limit field diff --git a/fastcrypto-vdf/src/math/parameterized_group.rs b/fastcrypto-vdf/src/math/parameterized_group.rs index 7544f1d31..527d5f70a 100644 --- a/fastcrypto-vdf/src/math/parameterized_group.rs +++ b/fastcrypto-vdf/src/math/parameterized_group.rs @@ -44,6 +44,3 @@ pub trait ParameterizedGroupElement: /// Return the parameter for the group this element belongs to. fn parameter(&self) -> Self::ParameterType; } - -/// Trait impl'd by elements of groups where the order is unknown. -pub trait UnknownOrderGroupElement {} diff --git a/fastcrypto-vdf/src/vdf/wesolowski/fiat_shamir.rs b/fastcrypto-vdf/src/vdf/wesolowski/fiat_shamir.rs index fb9cac25d..cbe7f616c 100644 --- a/fastcrypto-vdf/src/vdf/wesolowski/fiat_shamir.rs +++ b/fastcrypto-vdf/src/vdf/wesolowski/fiat_shamir.rs @@ -4,7 +4,7 @@ use crate::class_group::discriminant::Discriminant; use crate::class_group::QuadraticForm; use crate::math::hash_prime::hash_prime; -use crate::math::parameterized_group::{ParameterizedGroupElement, UnknownOrderGroupElement}; +use crate::math::parameterized_group::ParameterizedGroupElement; use crate::vdf::wesolowski::WesolowskisVDF; use fastcrypto::groups::multiplier::ScalarMultiplier; use num_bigint::BigInt; @@ -13,7 +13,7 @@ use serde::Serialize; /// Default size in bytes of the Fiat-Shamir challenge used in proving and verification. pub const DEFAULT_CHALLENGE_SIZE_IN_BYTES: usize = 32; -pub trait FiatShamir: Sized { +pub trait FiatShamir: Sized { /// Compute the prime modulus used in proving and verification. This is a Fiat-Shamir construction /// to make the Wesolowski VDF non-interactive. fn compute_challenge>( diff --git a/fastcrypto-vdf/src/vdf/wesolowski/mod.rs b/fastcrypto-vdf/src/vdf/wesolowski/mod.rs index d5eb5f715..bcc4b61e5 100644 --- a/fastcrypto-vdf/src/vdf/wesolowski/mod.rs +++ b/fastcrypto-vdf/src/vdf/wesolowski/mod.rs @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 use crate::class_group::QuadraticForm; -use crate::math::parameterized_group::{ParameterizedGroupElement, UnknownOrderGroupElement}; +use crate::math::parameterized_group::ParameterizedGroupElement; use crate::vdf::VDF; use fastcrypto::error::FastCryptoError::{InvalidInput, InvalidProof}; use fastcrypto::error::FastCryptoResult; @@ -19,7 +19,7 @@ mod fiat_shamir; /// An implementation of Wesolowski's VDF construction (https://eprint.iacr.org/2018/623) over a /// group of unknown order. pub struct WesolowskisVDF< - G: ParameterizedGroupElement + UnknownOrderGroupElement, + G: ParameterizedGroupElement, F: FiatShamir, M: ScalarMultiplier, > { @@ -29,11 +29,8 @@ pub struct WesolowskisVDF< _scalar_multiplier: PhantomData, } -impl< - G: ParameterizedGroupElement + UnknownOrderGroupElement, - F: FiatShamir, - M: ScalarMultiplier, - > WesolowskisVDF +impl, M: ScalarMultiplier> + WesolowskisVDF { /// Create a new VDF using the group defined by the given group parameter. Evaluating this VDF /// will require computing `2^iterations * input` which requires `iterations` group operations. @@ -48,7 +45,7 @@ impl< } impl< - G: ParameterizedGroupElement + UnknownOrderGroupElement, + G: ParameterizedGroupElement, F: FiatShamir, M: ScalarMultiplier, > VDF for WesolowskisVDF