pub struct UsualBLS<E: Pairing, P: Bls12Config + CurveExtraConfig>(pub E, _)
where
<P as Bls12Config>::G2Config: WBConfig,
WBMap<<P as Bls12Config>::G2Config>: MapToCurve<<E as Pairing>::G2>;
Expand description
Usual aggregate BLS signature scheme on ZCash’s BLS12-381 curve. Usual BLS variant with tiny 48 byte public keys and 96 byte signatures.
We favor this variant because verifiers always perform
O(signers)
additions on the PublicKeyGroup
, or worse 128 bit
scalar multiplications with delinearization.
We also orient this variant to match zcash’s traits.
Tuple Fields§
§0: E
Trait Implementations§
Source§impl<E: Default + Pairing, P: Default + Bls12Config + CurveExtraConfig> Default for UsualBLS<E, P>where
<P as Bls12Config>::G2Config: WBConfig,
WBMap<<P as Bls12Config>::G2Config>: MapToCurve<<E as Pairing>::G2>,
impl<E: Default + Pairing, P: Default + Bls12Config + CurveExtraConfig> Default for UsualBLS<E, P>where
<P as Bls12Config>::G2Config: WBConfig,
WBMap<<P as Bls12Config>::G2Config>: MapToCurve<<E as Pairing>::G2>,
Source§impl<E: Pairing, P: Bls12Config + CurveExtraConfig> EngineBLS for UsualBLS<E, P>where
<P as Bls12Config>::G2Config: WBConfig,
WBMap<<P as Bls12Config>::G2Config>: MapToCurve<<E as Pairing>::G2>,
impl<E: Pairing, P: Bls12Config + CurveExtraConfig> EngineBLS for UsualBLS<E, P>where
<P as Bls12Config>::G2Config: WBConfig,
WBMap<<P as Bls12Config>::G2Config>: MapToCurve<<E as Pairing>::G2>,
Source§fn minus_generator_of_public_key_group_prepared() -> Self::PublicKeyPrepared
fn minus_generator_of_public_key_group_prepared() -> Self::PublicKeyPrepared
Prepared negative of the generator of the public key curve.
const PUBLICKEY_SERIALIZED_SIZE: usize = 48usize
const SECRET_KEY_SIZE: usize = 32usize
const CURVE_NAME: &'static [u8] = P::CURVE_NAME
const SIG_GROUP_NAME: &'static [u8] = b"G2"
const CIPHER_SUIT_DOMAIN_SEPARATION: &'static [u8] = b"_XMD:SHA-256_SSWU_RO_"
const SIGNATURE_SERIALIZED_SIZE: usize = 96usize
type Engine = E
type Scalar = <<UsualBLS<E, P> as EngineBLS>::Engine as Pairing>::ScalarField
type PublicKeyGroup = <E as Pairing>::G1
type PublicKeyGroupAffine = <E as Pairing>::G1Affine
type PublicKeyPrepared = <E as Pairing>::G1Prepared
Source§type PublicKeyGroupBaseField = <<E as Pairing>::G1 as CurveGroup>::BaseField
type PublicKeyGroupBaseField = <<E as Pairing>::G1 as CurveGroup>::BaseField
Group where BLS public keys live Read more
type SignatureGroup = <E as Pairing>::G2
type SignatureGroupAffine = <E as Pairing>::G2Affine
type SignaturePrepared = <E as Pairing>::G2Prepared
Source§type SignatureGroupBaseField = <<E as Pairing>::G2 as CurveGroup>::BaseField
type SignatureGroupBaseField = <<E as Pairing>::G2 as CurveGroup>::BaseField
Group where BLS signatures live Read more
type HashToSignatureField = DefaultFieldHasher<CoreWrapper<CtVariableCoreWrapper<Sha256VarCore, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, OidSha256>>>
type MapToSignatureCurve = WBMap<<P as Bls12Config>::G2Config>
Source§fn miller_loop<'a, I>(i: I) -> MillerLoopOutput<E>
fn miller_loop<'a, I>(i: I) -> MillerLoopOutput<E>
Run the Miller loop from
Engine
but orients its arguments
to be a SignatureGroup
and PublicKeyGroup
.Source§fn pairing<G1, G2>(p: G1, q: G2) -> E::TargetField
fn pairing<G1, G2>(p: G1, q: G2) -> E::TargetField
Performs a pairing operation
e(p, q)
by calling Engine::pairing
but orients its arguments to be a PublicKeyGroup
and SignatureGroup
.Source§fn hash_to_curve_map() -> MapToCurveBasedHasher<Self::SignatureGroup, Self::HashToSignatureField, Self::MapToSignatureCurve>
fn hash_to_curve_map() -> MapToCurveBasedHasher<Self::SignatureGroup, Self::HashToSignatureField, Self::MapToSignatureCurve>
getter function for the hash to curve map
Source§fn generate<R: Rng + RngCore>(rng: &mut R) -> Self::Scalar
fn generate<R: Rng + RngCore>(rng: &mut R) -> Self::Scalar
Generate a random scalar for use as a secret key.
Source§fn hash_to_signature_curve<M: Borrow<[u8]>>(message: M) -> Self::SignatureGroup
fn hash_to_signature_curve<M: Borrow<[u8]>>(message: M) -> Self::SignatureGroup
Hash one message to the signature curve.
Source§fn final_exponentiation(
e: MillerLoopOutput<Self::Engine>,
) -> Option<PairingOutput<Self::Engine>>
fn final_exponentiation( e: MillerLoopOutput<Self::Engine>, ) -> Option<PairingOutput<Self::Engine>>
Perform final exponentiation on the result of a Miller loop.
Source§fn verify_prepared<'a, I>(signature: Self::SignaturePrepared, inputs: I) -> boolwhere
Self::PublicKeyPrepared: 'a,
Self::SignaturePrepared: 'a,
I: IntoIterator<Item = &'a (Self::PublicKeyPrepared, Self::SignaturePrepared)>,
fn verify_prepared<'a, I>(signature: Self::SignaturePrepared, inputs: I) -> boolwhere
Self::PublicKeyPrepared: 'a,
Self::SignaturePrepared: 'a,
I: IntoIterator<Item = &'a (Self::PublicKeyPrepared, Self::SignaturePrepared)>,
Implement verification equation for aggregate BLS signatures
provided as prepared points Read more
Source§fn generator_of_signature_group() -> Self::SignatureGroup
fn generator_of_signature_group() -> Self::SignatureGroup
return the generator of signature group
Source§fn prepare_public_key(
g: impl Into<Self::PublicKeyGroupAffine>,
) -> Self::PublicKeyPrepared
fn prepare_public_key( g: impl Into<Self::PublicKeyGroupAffine>, ) -> Self::PublicKeyPrepared
Process the public key to be use in pairing. This has to be
implemented by the type of BLS system implementing the engine
by calling either prepare_g1 or prepare_g2 based on which group
is used by the signature system to host the public key
Source§fn prepare_signature(
g: impl Into<Self::SignatureGroupAffine>,
) -> Self::SignaturePrepared
fn prepare_signature( g: impl Into<Self::SignatureGroupAffine>, ) -> Self::SignaturePrepared
Process the signature to be use in pairing. This has to be
implemented by the type of BLS system implementing the engine
by calling either prepare_g1 or prepare_g2 based on which group
is used by the signature system to host the public key
Source§fn signature_point_to_byte(point: &Self::SignatureGroup) -> Vec<u8> ⓘ
fn signature_point_to_byte(point: &Self::SignatureGroup) -> Vec<u8> ⓘ
Serialization helper for various sigma protocols
fn public_key_point_to_byte(point: &Self::PublicKeyGroup) -> Vec<u8> ⓘ
Auto Trait Implementations§
impl<E, P> Freeze for UsualBLS<E, P>
impl<E, P> RefUnwindSafe for UsualBLS<E, P>where
WBMap<<P as Bls12Config>::G2Config>: Sized,
<P as Bls12Config>::G2Config: Sized,
E: RefUnwindSafe,
impl<E, P> Send for UsualBLS<E, P>
impl<E, P> Sync for UsualBLS<E, P>
impl<E, P> Unpin for UsualBLS<E, P>
impl<E, P> UnwindSafe for UsualBLS<E, P>where
WBMap<<P as Bls12Config>::G2Config>: Sized,
<P as Bls12Config>::G2Config: Sized,
E: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more