mirror of
https://github.com/serai-dex/serai.git
synced 2024-12-22 19:49:22 +00:00
Add must_use to the BatchVerifier's verify -> bool functions
This commit is contained in:
parent
0ff5ee8292
commit
fe9a8d9495
1 changed files with 2 additions and 0 deletions
|
@ -33,12 +33,14 @@ impl<Id: Copy, G: Group> BatchVerifier<Id, G> where <G as Group>::Scalar: PrimeF
|
|||
self.0.push((id, pairs.into_iter().map(|(scalar, point)| (scalar * u, point)).collect()));
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn verify(&self) -> bool {
|
||||
multiexp(
|
||||
&self.0.iter().flat_map(|pairs| pairs.1.iter()).cloned().collect::<Vec<_>>()
|
||||
).is_identity().into()
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn verify_vartime(&self) -> bool {
|
||||
multiexp_vartime(
|
||||
&self.0.iter().flat_map(|pairs| pairs.1.iter()).cloned().collect::<Vec<_>>()
|
||||
|
|
Loading…
Reference in a new issue