pub struct MinPk {}
Trait Implementations§
Source§impl Variant for MinPk
impl Variant for MinPk
Source§fn verify(
public: &Self::Public,
hm: &Self::Signature,
signature: &Self::Signature,
) -> Result<(), Error>
fn verify( public: &Self::Public, hm: &Self::Signature, signature: &Self::Signature, ) -> Result<(), Error>
Verifies that e(hm,pk)
is equal to e(sig,G1::one())
using a single product check with
a negated G1 generator (e(hm,pk) * e(sig,-G1::one()) == 1
).
Source§fn batch_verify<R: CryptoRngCore>(
rng: &mut R,
publics: &[Self::Public],
hms: &[Self::Signature],
signatures: &[Self::Signature],
) -> Result<(), Error>
fn batch_verify<R: CryptoRngCore>( rng: &mut R, publics: &[Self::Public], hms: &[Self::Signature], signatures: &[Self::Signature], ) -> Result<(), Error>
Verifies a set of signatures against their respective public keys and pre-hashed messages.
This method is outperforms individual signature verification (2
pairings per signature) by
verifying a random linear combination of the public keys and signatures (n+1
pairings and
2n
multiplications for n
signatures).
The verification equation for each signature i
is:
e(hm_i,pk_i) == e(sig_i,G1::one())
,
which is equivalent to checking if e(hm_i,pk_i) * e(sig_i,-G1::one()) == 1
.
To batch verify n
such equations, we introduce random non-zero scalars r_i
(for i=1..n
).
The batch verification checks if the product of these individual equations, each raised to the power
of its respective r_i
, equals one:
prod_i((e(hm_i,pk_i) * e(sig_i,-G1::one()))^{r_i}) == 1
Using the bilinearity of pairings, this can be rewritten (by moving r_i
inside the pairings):
prod_i(e(hm_i,r_i * pk_i) * e(r_i * sig_i,-G1::one())) == 1
The second term e(r_i * sig_i,-G1::one())
can be computed efficiently with Multi-Scalar Multiplication:
e(sum_i(r_i * sig_i),-G1::one())
Finally, we aggregate all pairings e(hm_i,r_i * pk_i)
(n
) and e(sum_i(r_i * sig_i),-G1::one())
(1
)
into a single product in the target group G_T
. If the result is the identity element in G_T
,
the batch verification succeeds.
Source: https://ethresear.ch/t/security-of-bls-batch-verification/10748
Source§fn pairing(public: &Self::Public, signature: &Self::Signature) -> GT
fn pairing(public: &Self::Public, signature: &Self::Signature) -> GT
Compute the pairing e(public, signature) -> GT
.
Source§const PROOF_OF_POSSESSION: DST = G2_PROOF_OF_POSSESSION
const PROOF_OF_POSSESSION: DST = G2_PROOF_OF_POSSESSION
impl Eq for MinPk
impl StructuralPartialEq for MinPk
Auto Trait Implementations§
impl Freeze for MinPk
impl RefUnwindSafe for MinPk
impl Send for MinPk
impl Sync for MinPk
impl Unpin for MinPk
impl UnwindSafe for MinPk
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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