Skip to content

Commit

Permalink
Set f_u as its inverse if loop count 1 is negative
Browse files Browse the repository at this point in the history
  • Loading branch information
mmagician committed Mar 11, 2023
1 parent 851b235 commit c7d8a69
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ec/src/models/bw6/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,14 @@ pub trait BW6Config: 'static + Eq + Sized {
})
.product::<<BW6<Self> as Pairing>::TargetField>();

let f_u_inv = f_u.cyclotomic_inverse().unwrap();
let f_u_inv;

// TODO: is it enough to get the inverse of f_1, or does f_u also need to get inverted?
if Self::ATE_LOOP_COUNT_1_IS_NEGATIVE {
f_u_inv = f_u;
f_u.cyclotomic_inverse_in_place();
} else {
f_u_inv = f_u.cyclotomic_inverse().unwrap();
}

// f_1(P) = f_(u+1)(P) = f_u(P) * l([u]q, q)(P)
Expand Down

0 comments on commit c7d8a69

Please sign in to comment.