Skip to content

Commit

Permalink
Made PairingOutput::default() = TargetField::one() (arkworks-rs#694)
Browse files Browse the repository at this point in the history
  • Loading branch information
rozbb authored Oct 27, 2023
1 parent 1acf70c commit 3082750
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ec/src/pairing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,18 @@ pub trait Pairing: Sized + 'static + Copy + Debug + Sync + Send + Eq {
Eq(bound = "P: Pairing"),
PartialOrd(bound = "P: Pairing"),
Ord(bound = "P: Pairing"),
Default(bound = "P: Pairing"),
Hash(bound = "P: Pairing")
)]
#[must_use]
pub struct PairingOutput<P: Pairing>(pub P::TargetField);

impl<P: Pairing> Default for PairingOutput<P> {
fn default() -> Self {
// Default value is AdditiveGroup::ZERO (i.e., P::TargetField::one())
Self::ZERO
}
}

impl<P: Pairing> CanonicalSerialize for PairingOutput<P> {
#[allow(unused_qualifications)]
#[inline]
Expand Down

0 comments on commit 3082750

Please sign in to comment.