|
|
@ -1,4 +1,4 @@ |
|
|
|
mod error; |
|
|
|
pub mod error; |
|
|
|
pub mod keygen; |
|
|
|
pub mod keygen; |
|
|
|
#[cfg(feature = "serialization-serde")] |
|
|
|
#[cfg(feature = "serialization-serde")] |
|
|
|
mod serde_impl; |
|
|
|
mod serde_impl; |
|
|
@ -59,7 +59,7 @@ impl<E: Engine> PublicKey<E> { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// A signature, or a signature share.
|
|
|
|
/// A signature, or a signature share.
|
|
|
|
#[derive(Debug)] |
|
|
|
#[derive(Clone, Debug, PartialOrd)] |
|
|
|
pub struct Signature<E: Engine>(E::G2); |
|
|
|
pub struct Signature<E: Engine>(E::G2); |
|
|
|
|
|
|
|
|
|
|
|
impl<E: Engine> PartialEq for Signature<E> { |
|
|
|
impl<E: Engine> PartialEq for Signature<E> { |
|
|
@ -68,6 +68,18 @@ impl<E: Engine> PartialEq for Signature<E> { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
impl<E: Engine> Signature<E> { |
|
|
|
|
|
|
|
pub fn parity(&self) -> bool { |
|
|
|
|
|
|
|
2 % self |
|
|
|
|
|
|
|
.0 |
|
|
|
|
|
|
|
.into_affine() |
|
|
|
|
|
|
|
.into_uncompressed() |
|
|
|
|
|
|
|
.as_ref() |
|
|
|
|
|
|
|
.last() |
|
|
|
|
|
|
|
.expect("non-empty signature") == 0 |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// A secret key, or a secret key share.
|
|
|
|
/// A secret key, or a secret key share.
|
|
|
|
#[derive(Debug)] |
|
|
|
#[derive(Debug)] |
|
|
|
pub struct SecretKey<E: Engine>(E::Fr); |
|
|
|
pub struct SecretKey<E: Engine>(E::Fr); |
|
|
|