Skip to content

Commit

Permalink
Fix a corner case for ate pairing in BLS12 and BW6 models (#460)
Browse files Browse the repository at this point in the history
  • Loading branch information
weikengchen authored Aug 28, 2022
1 parent 6263006 commit 77fb6ab
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
- [\#366](https://github.com/arkworks-rs/algebra/pull/366) (`ark-ff`) Fix `norm()` for cubic extension field towers.
- [\#394](https://github.com/arkworks-rs/algebra/pull/394) (`ark-ff`, `ark-serialize`) Remove `EmptyFlags` construction checks.
- [\#442](https://github.com/arkworks-rs/algebra/pull/442) (`ark-ff`) Fix deserialization for modulo with 64 shaving bits.
- [\#460](https://github.com/arkworks-rs/algebra/pull/460) (`ark-ec`) Fix a corner case for ate pairing in BLS12 and BW6 models.

## v0.3.0

Expand Down
4 changes: 2 additions & 2 deletions ec/src/models/bls12/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ impl<P: Bls12Parameters> PairingEngine for Bls12<P> {
}
}
let mut f = Self::Fqk::one();
for i in BitIteratorBE::new(P::X).skip(1) {
for i in BitIteratorBE::without_leading_zeros(P::X).skip(1) {
f.square_in_place();
for (p, ref mut coeffs) in &mut pairs {
Self::ell(&mut f, coeffs.next().unwrap(), &p.0);
Expand Down Expand Up @@ -161,7 +161,7 @@ impl<P: Bls12Parameters> PairingEngine for Bls12<P> {
-> Fp12<<P as Bls12Parameters>::Fp12Config> {
let coeffs = coeffs.as_slice();
let mut j = 0;
for i in BitIteratorBE::new(P::X).skip(1) {
for i in BitIteratorBE::without_leading_zeros(P::X).skip(1) {
f.square_in_place();
Self::ell(&mut f, &coeffs[j], &p.0);
j += 1;
Expand Down
2 changes: 1 addition & 1 deletion ec/src/models/bw6/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ impl<P: BW6Parameters> PairingEngine for BW6<P> {
// f_{u+1,Q}(P)
let mut f_1 = Self::Fqk::one();

for i in BitIteratorBE::new(P::ATE_LOOP_COUNT_1).skip(1) {
for i in BitIteratorBE::without_leading_zeros(P::ATE_LOOP_COUNT_1).skip(1) {
f_1.square_in_place();

for (p, ref mut coeffs) in &mut pairs_1 {
Expand Down

0 comments on commit 77fb6ab

Please sign in to comment.