12 Commits

Author SHA1 Message Date
Mamy André-Ratsimbazafy
c3d458e31b
Fix bug in redc: use montgomery mul for now. Add NIST P256 curve 2020-02-16 18:59:10 +01:00
Mamy André-Ratsimbazafy
7740bfbae4
print montgomery magics at compile-time 2020-02-16 12:32:34 +01:00
Mamy André-Ratsimbazafy
f1430915fe
Add Mersenn 61 and 127 + debugging print 2020-02-16 12:03:01 +01:00
Mamy André-Ratsimbazafy
bd1430157f
Add BLS12-381 curve:
- don't create "Mod" in curve parser: compile-time type incompatibility
- don't use "Mod" in const sections: compile-time type incompat  --> create a macro to get montgomery magics instead of a const array
2020-02-16 00:44:01 +01:00
Mamy André-Ratsimbazafy
05a2c6a34b
Properly precompute the montomery cosntants at compile-time and store them in ROM 2020-02-15 20:43:38 +01:00
Mamy André-Ratsimbazafy
d3ad4acb3a
Do less in curve generator macro:
- no more monty magic "negInvModWord"
- no public "matchingBigInt"

Improve comment on Montgomery procedures
2020-02-15 13:56:13 +01:00
Mamy André-Ratsimbazafy
398b871c4f
Reorg the repo to introduce prepare for introducing the R² (mod p) magic constant 2020-02-15 13:13:01 +01:00
Mamy André-Ratsimbazafy
301cf20195
Use Montgomery representation by default for Finite Field
- Fix montyMagic, modular inversion mode 2^2k was missing an iteration
- Fix test for buffer size in BigInt serialization
- Add UINT/Hex serialization for finite fields
- Montgomery conversion and redc
2020-02-15 00:26:40 +01:00
Mamy André-Ratsimbazafy
f418e08746
For finite fields, we will use the Montgomery n-residue form by default 2020-02-14 13:36:34 +01:00
Mamy André-Ratsimbazafy
4cac44358f
Update security level of BN254 to ~100bits 2020-02-13 00:11:04 +01:00
Mamy André-Ratsimbazafy
3eb22f8fc7
Fix curve parser, implement smoke test for finite field 2020-02-12 23:57:51 +01:00
Mamy André-Ratsimbazafy
fe59efb8d8
reorganize the repo 2020-02-12 00:20:31 +01:00