Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 14 additions & 9 deletions constantine/named/config_fields_and_curves.nim
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,6 @@ declareCurves:
testingCurve: true
bitwidth: 16
modulus: "0xFFEF" # 65519 in hex

curve BabyBear: # BabyBear field used in SNARKs and zkVMs
bitwidth: 31
modulus: "0x78000001" # `0b1111000000000000000000000000001 = 15·2²⁷ + 1 = 2³¹ - 2²⁷ + 1`

curve Goldilocks: # GoldiLocks field used in SNARKs and zkVMs
bitwidth: 64
modulus: "0xFFFFFFFF00000001" # `1111111111111111111111111111111100000000000000000000000000000001 = 2^64 - 2^32 + 1`

curve Mersenne61:
testingCurve: true
bitwidth: 61
Expand All @@ -82,7 +73,21 @@ declareCurves:
testingCurve: true
bitwidth: 127
modulus: "0x7fffffffffffffffffffffffffffffff" # 2^127 - 1

# -----------------------------------------------------------------------------
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

above this are testing "curves" and fields.


curve BabyBear: # BabyBear field used in SNARKs and zkVMs
bitwidth: 31
modulus: "0x78000001" # `0b1111000000000000000000000000001 = 15·2²⁷ + 1 = 2³¹ - 2²⁷ + 1`

curve KoalaBear: # KoalaBear field used in SNARKs and zkVMs
bitwidth: 31
modulus: "0x7f000001" # `0b11111111000000000000000000000001 = 255·2²⁴ + 1 = 2³¹ - 2²⁴ + 1`

curve Goldilocks: # GoldiLocks field used in SNARKs and zkVMs
bitwidth: 64
modulus: "0xFFFFFFFF00000001" # `1111111111111111111111111111111100000000000000000000000000000001 = 2^64 - 2^32 + 1`

curve P224: # NIST P-224
bitwidth: 224
modulus: "0xffffffffffffffffffffffffffffffff000000000000000000000001"
Expand Down
Loading