zkcrypto / bls12_381

Implementation of the BLS12-381 pairing-friendly elliptic curve group
Other
304 stars 178 forks source link

Legendre Symbol #93

Open SteinerMatthias opened 2 years ago

SteinerMatthias commented 2 years ago

Implemented the legendre symbol for BLS12-381 base and scalar fields.

ebfull commented 1 year ago

I had a couple comments.

We don't expose Fp in the crate so there's no need to implement this for Fp since we don't need it internally.

Also, you can just call sqrt and if it returns a valid CtOption you'll know if it's square. Do you have a particular need to more efficiently check whether it's a square outside of the context of computing square roots?

huitseeker commented 1 year ago

@ebfull the classical example would be the Shallue-van de Woestijne map to the curve, I think, but I don't know if this is very relevant for BLS12-381.