|
|
@@ -7,52 +7,53 @@ const ( |
|
|
|
|
|
|
|
// Used internally by this package |
|
|
|
// ------------------------------- |
|
|
|
var ( |
|
|
|
p = Fp{ |
|
|
|
0xFFFFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFF, 0xABFFFFFFFFFFFFFF, |
|
|
|
0x13085BDA2211E7A0, 0x1B9BF6C87B7E7DAF, 0x6045C6BDDA77A4D0, 0x004066F541811E1E, |
|
|
|
} |
|
|
|
|
|
|
|
var p = Fp{ |
|
|
|
0xFFFFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFF, 0xABFFFFFFFFFFFFFF, |
|
|
|
0x13085BDA2211E7A0, 0x1B9BF6C87B7E7DAF, 0x6045C6BDDA77A4D0, 0x004066F541811E1E, |
|
|
|
} |
|
|
|
|
|
|
|
// 2*503 |
|
|
|
var pX2 = Fp{ |
|
|
|
0xFFFFFFFFFFFFFFFE, 0xFFFFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFF, 0x57FFFFFFFFFFFFFF, |
|
|
|
0x2610B7B44423CF41, 0x3737ED90F6FCFB5E, 0xC08B8D7BB4EF49A0, 0x0080CDEA83023C3C, |
|
|
|
} |
|
|
|
// 2*503 |
|
|
|
pX2 = Fp{ |
|
|
|
0xFFFFFFFFFFFFFFFE, 0xFFFFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFF, 0x57FFFFFFFFFFFFFF, |
|
|
|
0x2610B7B44423CF41, 0x3737ED90F6FCFB5E, 0xC08B8D7BB4EF49A0, 0x0080CDEA83023C3C, |
|
|
|
} |
|
|
|
|
|
|
|
// p503 + 1 |
|
|
|
var p1 = Fp{ |
|
|
|
0x0000000000000000, 0x0000000000000000, 0x0000000000000000, 0xAC00000000000000, |
|
|
|
0x13085BDA2211E7A0, 0x1B9BF6C87B7E7DAF, 0x6045C6BDDA77A4D0, 0x004066F541811E1E, |
|
|
|
} |
|
|
|
// p503 + 1 |
|
|
|
p1 = Fp{ |
|
|
|
0x0000000000000000, 0x0000000000000000, 0x0000000000000000, 0xAC00000000000000, |
|
|
|
0x13085BDA2211E7A0, 0x1B9BF6C87B7E7DAF, 0x6045C6BDDA77A4D0, 0x004066F541811E1E, |
|
|
|
} |
|
|
|
|
|
|
|
// R^2=(2^512)^2 mod p |
|
|
|
var pR2 = Fp{ |
|
|
|
0x5289A0CF641D011F, 0x9B88257189FED2B9, 0xA3B365D58DC8F17A, 0x5BC57AB6EFF168EC, |
|
|
|
0x9E51998BD84D4423, 0xBF8999CBAC3B5695, 0x46E9127BCE14CDB6, 0x003F6CFCE8B81771, |
|
|
|
} |
|
|
|
// R^2=(2^512)^2 mod p |
|
|
|
pR2 = Fp{ |
|
|
|
0x5289A0CF641D011F, 0x9B88257189FED2B9, 0xA3B365D58DC8F17A, 0x5BC57AB6EFF168EC, |
|
|
|
0x9E51998BD84D4423, 0xBF8999CBAC3B5695, 0x46E9127BCE14CDB6, 0x003F6CFCE8B81771, |
|
|
|
} |
|
|
|
|
|
|
|
// 1/2 * R mod p |
|
|
|
var half = Fp2{ |
|
|
|
A: Fp{ |
|
|
|
0x00000000000001FC, 0x0000000000000000, 0x0000000000000000, 0xB000000000000000, |
|
|
|
0x3B69BB2464785D2A, 0x36824A2AF0FE9896, 0xF5899F427A94F309, 0x0033B15203C83BB8}, |
|
|
|
} |
|
|
|
// 1/2 * R mod p |
|
|
|
half = Fp2{ |
|
|
|
A: Fp{ |
|
|
|
0x00000000000001FC, 0x0000000000000000, 0x0000000000000000, 0xB000000000000000, |
|
|
|
0x3B69BB2464785D2A, 0x36824A2AF0FE9896, 0xF5899F427A94F309, 0x0033B15203C83BB8}, |
|
|
|
} |
|
|
|
|
|
|
|
// 1*R mod p |
|
|
|
var one = Fp2{ |
|
|
|
A: Fp{ |
|
|
|
0x00000000000003F9, 0x0000000000000000, 0x0000000000000000, 0xB400000000000000, |
|
|
|
0x63CB1A6EA6DED2B4, 0x51689D8D667EB37D, 0x8ACD77C71AB24142, 0x0026FBAEC60F5953}, |
|
|
|
} |
|
|
|
// 1*R mod p |
|
|
|
one = Fp2{ |
|
|
|
A: Fp{ |
|
|
|
0x00000000000003F9, 0x0000000000000000, 0x0000000000000000, 0xB400000000000000, |
|
|
|
0x63CB1A6EA6DED2B4, 0x51689D8D667EB37D, 0x8ACD77C71AB24142, 0x0026FBAEC60F5953}, |
|
|
|
} |
|
|
|
|
|
|
|
// 6*R mod p |
|
|
|
var six = Fp2{ |
|
|
|
A: Fp{ |
|
|
|
0x00000000000017D8, 0x0000000000000000, 0x0000000000000000, 0xE000000000000000, |
|
|
|
0x30B1E6E3A51520FA, 0xB13BC3BF6FFB3992, 0x8045412EEB3E3DED, 0x0069182E2159DBB8}, |
|
|
|
} |
|
|
|
// 6*R mod p |
|
|
|
six = Fp2{ |
|
|
|
A: Fp{ |
|
|
|
0x00000000000017D8, 0x0000000000000000, 0x0000000000000000, 0xE000000000000000, |
|
|
|
0x30B1E6E3A51520FA, 0xB13BC3BF6FFB3992, 0x8045412EEB3E3DED, 0x0069182E2159DBB8}, |
|
|
|
} |
|
|
|
|
|
|
|
var Params SidhParams |
|
|
|
Params SidhParams |
|
|
|
) |
|
|
|
|
|
|
|
func init() { |
|
|
|
Params = SidhParams{ |
|
|
|