-
Notifications
You must be signed in to change notification settings - Fork 103
Replace ATE_LOOP_COUNT
with its 2-NAF for MNT curves
#107
Conversation
mnt4_298/src/curves/mod.rs
Outdated
@@ -28,7 +28,15 @@ impl MNT4Parameters for Parameters { | |||
// ``` | |||
const TWIST_COEFF_A: Fq2 = Fq2::new(G1_COEFF_A_NON_RESIDUE, Fq::ZERO); | |||
|
|||
const ATE_LOOP_COUNT: &'static [u64] = &[993502997770534912, 5071219579242586943, 2027349]; | |||
// https://github.com/o1-labs/snarky/blob/9c21ab2bb23874604640740d646a932e813432c3/snarkette/mnt4_80.ml#L88 | |||
const ATE_LOOP_COUNT_2: &'static [i8] = &[ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should make this a const fn
? So that we don't have to return arbitrary-looking arrays? (Not that the original constants have much meaning lol)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about attaching a sage script (since there's already a directory with such scripts for most curves)?
I think that if it's documented well where these consts come from, then the current approach is cleaner, especially that this constant is only ever used in its non-adjacent form (after this change).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Pratyush ping here and for the related PR arkworks-rs/algebra#445
Description
Companion to arkworks-rs/algebra#445
Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.
Pending
section inCHANGELOG.md
Files changed
in the Github PR explorer