pub struct MinSig {}
Trait Implementations§
Source§impl Variant for MinSig
impl Variant for MinSig
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(pk,hm)
is equal to e(G2::one(),sig)
using a single product check with
a negated G2 generator (e(pk,hm) * e(-G2::one(),sig) == 1
).
Source§fn batch_verify<R: RngCore + CryptoRng>(
rng: &mut R,
publics: &[Self::Public],
hms: &[Self::Signature],
signatures: &[Self::Signature],
) -> Result<(), Error>
fn batch_verify<R: RngCore + CryptoRng>( 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 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(pk_i,hm_i) == e(G2::one(),sig_i)
,
which is equivalent to checking if e(pk_i,hm_i) * e(-G2::one(),sig_i) == 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 effectively
raised to the power of its respective r_i
, equals one:
prod_i((e(pk_i,hm_i) * e(-G2::one(),sig_i))^{r_i}) == 1
Using the bilinearity of pairings, this can be rewritten (by moving r_i
inside the pairings):
prod_i(e(r_i * pk_i,hm_i) * e(-G2::one(),r_i * sig_i)) == 1
The second term e(-G2::one(),r_i * sig_i)
can be computed efficiently with Multi-Scalar Multiplication:
e(-G2::one(),sum_i(r_i * sig_i))
Finally, we aggregate all pairings e(r_i * pk_i,hm_i)
(n
) and e(-G2::one(),sum_i(r_i * sig_i))
(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§const PROOF_OF_POSSESSION: DST = G1_PROOF_OF_POSSESSION
const PROOF_OF_POSSESSION: DST = G1_PROOF_OF_POSSESSION
impl Eq for MinSig
impl StructuralPartialEq for MinSig
Auto Trait Implementations§
impl Freeze for MinSig
impl RefUnwindSafe for MinSig
impl Send for MinSig
impl Sync for MinSig
impl Unpin for MinSig
impl UnwindSafe for MinSig
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