37 lines
1.0 KiB
Plaintext
37 lines
1.0 KiB
Plaintext
|
#pragma curve bn128
|
||
|
|
||
|
// Parameters are based on: https://github.com/HarryR/ethsnarks/tree/9cdf0117c2e42c691e75b98979cb29b099eca998/src/jubjub
|
||
|
// Note: parameters will be updated soon to be more compatible with zCash's implementation
|
||
|
|
||
|
struct BabyJubJubParams {
|
||
|
field JUBJUB_C;
|
||
|
field JUBJUB_A;
|
||
|
field JUBJUB_D;
|
||
|
field MONT_A;
|
||
|
field MONT_B;
|
||
|
field[2] INFINITY;
|
||
|
field Gu;
|
||
|
field Gv;
|
||
|
}
|
||
|
|
||
|
const BabyJubJubParams BABYJUBJUB_PARAMS = BabyJubJubParams {
|
||
|
// Order of the curve for reference: 21888242871839275222246405745257275088614511777268538073601725287587578984328
|
||
|
JUBJUB_C: 8, // Cofactor
|
||
|
JUBJUB_A: 168700, // Coefficient A
|
||
|
JUBJUB_D: 168696, // Coefficient D
|
||
|
|
||
|
// Montgomery parameters
|
||
|
MONT_A: 168698,
|
||
|
MONT_B: 1,
|
||
|
|
||
|
// Point at infinity
|
||
|
INFINITY: [0, 1],
|
||
|
|
||
|
// Generator
|
||
|
Gu: 16540640123574156134436876038791482806971768689494387082833631921987005038935,
|
||
|
Gv: 20819045374670962167435360035096875258406992893633759881276124905556507972311
|
||
|
};
|
||
|
|
||
|
def main() -> BabyJubJubParams {
|
||
|
return BABYJUBJUB_PARAMS;
|
||
|
}
|