mratsim / constantine

Constantine: modular, high-performance, zero-dependency cryptography stack for verifiable computation, proof systems and blockchain protocols.
Other
389 stars 43 forks source link

Sage script for dlog precomp constants calculation #359

Open advaita-saha opened 7 months ago

advaita-saha commented 7 months ago

The PR #354 adds the pre-comp optimisation for sqrt, which has the constants prepared only for

A sage script is supposed to be added for the calculation of the these constants for other curves. The algorithm for the calculation of the constants can be found here https://github.com/crate-crypto/go-ipa/blob/408dbffb2041271c95979a3fb79d98b268bf2880/bandersnatch/fp/sqrt.go#L45-L89

A corresponding sage script is supposed to be created and added inside the sage folder

rupam-04 commented 5 months ago

@mratsim As far as I know, sage only supports Weierstrass curves and doesn't support Twisted Edwards curves like Banderwagon and Bandersnatch. So is there any way around this?

mratsim commented 4 months ago

@mratsim As far as I know, sage only supports Weierstrass curves and doesn't support Twisted Edwards curves like Banderwagon and Bandersnatch. So is there any way around this?

We're working at the field level so we only need

Fp = GF('0x73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001')