Code formatting

This commit is contained in:
Henry Case 2019-06-28 14:27:44 +01:00
parent fee32327c1
commit e3fed59a52
2 changed files with 80 additions and 78 deletions

View File

@ -7,52 +7,53 @@ const (
// Used internally by this package // Used internally by this package
// ------------------------------- // -------------------------------
var (
var p = Fp{ p = Fp{
0xFFFFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFF, 0xFDC1767AE2FFFFFF, 0xFFFFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFF, 0xFDC1767AE2FFFFFF,
0x7BC65C783158AEA3, 0x6CFC5FD681C52056, 0x2341F27177344, 0x7BC65C783158AEA3, 0x6CFC5FD681C52056, 0x2341F27177344,
} }
// 2*p434 // 2*p434
var pX2 = Fp{ pX2 = Fp{
0xFFFFFFFFFFFFFFFE, 0xFFFFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFF, 0xFB82ECF5C5FFFFFF, 0xFFFFFFFFFFFFFFFE, 0xFFFFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFF, 0xFB82ECF5C5FFFFFF,
0xF78CB8F062B15D47, 0xD9F8BFAD038A40AC, 0x4683E4E2EE688, 0xF78CB8F062B15D47, 0xD9F8BFAD038A40AC, 0x4683E4E2EE688,
} }
// p434 + 1 // p434 + 1
var p1 = Fp{ p1 = Fp{
0x0000000000000000, 0x0000000000000000, 0x0000000000000000, 0xFDC1767AE3000000, 0x0000000000000000, 0x0000000000000000, 0x0000000000000000, 0xFDC1767AE3000000,
0x7BC65C783158AEA3, 0x6CFC5FD681C52056, 0x0002341F27177344, 0x7BC65C783158AEA3, 0x6CFC5FD681C52056, 0x0002341F27177344,
} }
// R^2=(2^512)^2 mod p // R^2=(2^448)^2 mod p
var pR2 = Fp{ pR2 = Fp{
0x28E55B65DCD69B30, 0xACEC7367768798C2, 0xAB27973F8311688D, 0x175CC6AF8D6C7C0B, 0x28E55B65DCD69B30, 0xACEC7367768798C2, 0xAB27973F8311688D, 0x175CC6AF8D6C7C0B,
0xABCD92BF2DDE347E, 0x69E16A61C7686D9A, 0x000025A89BCDD12A, 0xABCD92BF2DDE347E, 0x69E16A61C7686D9A, 0x000025A89BCDD12A,
} }
// 1/2 * R mod p // 1/2 * R mod p
var half = Fp2{ half = Fp2{
A: Fp{ A: Fp{
0x0000000000003A16, 0x0000000000000000, 0x0000000000000000, 0x5C87FA027E000000, 0x0000000000003A16, 0x0000000000000000, 0x0000000000000000, 0x5C87FA027E000000,
0x6C00D27DAACFD66A, 0x74992A2A2FBBA086, 0x0000767753DE976D}, 0x6C00D27DAACFD66A, 0x74992A2A2FBBA086, 0x0000767753DE976D},
} }
// 1*R mod p // 1*R mod p
var one = Fp2{ one = Fp2{
A: Fp{ A: Fp{
0x000000000000742C, 0x0000000000000000, 0x0000000000000000, 0xB90FF404FC000000, 0x000000000000742C, 0x0000000000000000, 0x0000000000000000, 0xB90FF404FC000000,
0xD801A4FB559FACD4, 0xE93254545F77410C, 0x0000ECEEA7BD2EDA}, 0xD801A4FB559FACD4, 0xE93254545F77410C, 0x0000ECEEA7BD2EDA},
} }
// 6*R mod p // 6*R mod p
var six = Fp2{ six = Fp2{
A: Fp{ A: Fp{
0x000000000002B90A, 0x0000000000000000, 0x0000000000000000, 0x5ADCCB2822000000, 0x000000000002B90A, 0x0000000000000000, 0x0000000000000000, 0x5ADCCB2822000000,
0x187D24F39F0CAFB4, 0x9D353A4D394145A0, 0x00012559A0403298}, 0x187D24F39F0CAFB4, 0x9D353A4D394145A0, 0x00012559A0403298},
} }
var Params SidhParams Params SidhParams
)
func init() { func init() {
Params = SidhParams{ Params = SidhParams{

View File

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