Compare commits

...

2 Commits

Author SHA1 Message Date
  Henry Case 4116683608 WIP 4 years ago
  Henry Case 3a3bb7fb5a Fix p503 5 years ago
4 changed files with 411 additions and 410 deletions
Split View
  1. +6
    -6
      p503/consts.go
  2. +400
    -400
      p503/etc/PQCkemKAT_434.rsp
  3. +4
    -4
      p503/sike_test.go
  4. +1
    -0
      tools/sliding_window_strat_calc.py

+ 6
- 6
p503/consts.go View File

@@ -91,12 +91,12 @@ func init() {
// The x-coordinate of RA = PA-QA
Affine_R: Fp2{
A: Fp{
0x6B6F4A4F786CF310, 0xB019D444BDCFDBE3, 0xA14CB06680607834, 0xCB0D5582E7E6E60A,
0xBA4EE8771667E241, 0xE42A114FCB12E5FF, 0x9A0C074E275BCD98, 0x001871329B28689E,
0x1D9D32D2DC877C17, 0x5517CD8F71D5B02B, 0x395AFB8F6B60C117, 0x3AE31AC85F9098C8,
0x5F5341C198450848, 0xF8C609DBEA435C6A, 0xD832BC7EDC7BA5E4, 0x002AD98AA6968BF5,
},
B: Fp{
0x685FA8378513FE76, 0x84E8FC1785E8BDF0, 0x8A380F177CB7C1B7, 0x2227464F4F812C94,
0x117C94A81A90C279, 0x193D73132FB9FA28, 0x99335336F192C9EB, 0x0006C2FE778A34FD,
0xC466CAB0F73C2E5B, 0x7B1817148FB2CF9C, 0x873E87C099E470A0, 0xBB17AC6D17A7BAC1,
0xA146FDCD0F2E2A58, 0x88B311E9CEAB6201, 0x37604CF5C7951757, 0x0006804071C74BF9,
},
},
// Max size of secret key for 2-torsion group, corresponds to 2^e2 - 1
@@ -145,8 +145,8 @@ func init() {
0x4AF43C73344B6686, 0xCFA1F91149DF0993, 0xF327A95365587A89, 0x000DBF54E03D3906,
},
B: Fp{
0xFC1FC00CBD0A0CFB, 0x66C29FB284B491A9, 0x7FBED0B26D7F18E0, 0x9C02361066F4C67D,
0x2D83758DD0B19E6F, 0x0827029DB2CDC1D7, 0x58700A85FAD38A71, 0x0006FA256B614AD2,
0x03E03FF342F5F304, 0x993D604D7B4B6E56, 0x80412F4D9280E71F, 0x0FFDC9EF990B3982,
0xE584E64C51604931, 0x1374F42AC8B0BBD7, 0x07D5BC37DFA41A5F, 0x00396CCFD61FD34C,
},
},
// Size of secret key for 3-torsion group, corresponds to log_2(3^e3) - 1.


+ 400
- 400
p503/etc/PQCkemKAT_434.rsp
File diff suppressed because it is too large
View File


+ 4
- 4
p503/sike_test.go View File

@@ -25,9 +25,9 @@ var tdata = struct {
name: "SIKEp503",
katFile: "etc/PQCkemKAT_434.rsp",
PrB_sidh: "8626ED79D451140800E03B59B956F8210E556067407D13DC90FA9E8B872BFB0F",
PkB_sidh: "BB066F920803D8A481A09CD6398DCAE8D330AE2035245A92491228D6AC86A7E024D6318CC3FAC233A90F086EF663A74CD102D7A33BE96F726E084F3C8C630DD1CAD79289B68275962C90A29E061A8C5C266D4A9DE1D94FAA8E539A7A4FD5487905A1FAD75CBEF0B2BF298645C26D6A904EBA9B468B43B66B3CE579EF140379C4B0F06B2005B345A677590FB1A6C6B73D90D953383621EE667B9E9B3254403AF1C66D8FA8F0A9A3B06B1B6D81C661BCD0FCD09D96FF6A9AF52C4F68DB2E12DFB16319F6F24B7B206E94331F26165F501179F956AED2DC42679CAD539E32D9BF36F1764D5F3A596ADC504E0FF1F25A544FA139E0ACB516D6D5A15F0A0C4F03C0CF363086184E462035CA87BF21393DC8918E21258029A0DC7295FB7F04E363F0A63EE299AD9E638324E5A2027BF38C868AF49A591BDEA9D7C376981D015E55FBE641010C70AB08809AAE335B4B97081FB95621469F9B92F637A41BCBB7DC3D1D7242E3E5FD7CA8E3381057AAB9F948498AF438B5F8D2E157B5A318",
PkB_sidh: "05279D27FF7E3A38ABB05DCFE23B5831C030D832D3EAE35FE06A6538597532D22A0F4012FB2263E160495F8291B58D9DF8A8947C7CF3E6735520BB2D094912408829851AC4B85AA922069F2AAA0A4827DFA4730E9CF05485CBEE411C3D5169DD4953746B6A2E6574957EF920596B1612BE62A883740B5A0C157117AE1C3A07E4CE8CCCE7E9E88FE7C20A507FF019AE0893F34303E173D291F6CB7ECB4C3901FF34A48DE40771F5BAD72DA2B4C1CFD0A61F33E39327A8DA60F5640D4C2E71EF9C7297A4E9BC50493E3BA65D3664610A6D61035CB6600378D017D1E1810ACD113252D60F5915749C2B5CFB4452C40C86F1F40C63297DCCA900686F2D2266F9444539D9BA13B1F52FB2FC3BD4F3EDAA6EB707AAFCA5261EA271ED961B2ED195D5E3B0299179251866CE0EAA31C5C90B7999A8D63BA2DE84A8AFA19F11F2DC0CACA39B982CE053F71D269931D9EE26BCE592A8EA818553BC8F8D244F62FB4F5E5386E3EFF5CD231401C9EC2BA57FF42DC3B3791357A53E1E31394008",
PrA_sike: "003271531CF27285B8721ED5CB46853043B346A66CBA6CF765F1B0EAA40BF602",
PkA_sike: "BE0CB724207D42075EC1569F43FFB8178C64E1F3EAF9D914879B3B3CAD1D12048CBB72861CA0B72C16F65FB4DA98778D9F37CF1442147AE179A8D1099D77028740BD72DFC873A8D2F293A603E5C4A13F7668E8F5C363602A490D47F4F95B269706BDC8DFDEAD77026D9842BB8B5CC4BFB99AF75ED8E4A6994DD4BD5BA606D9EF21A38E26CC35AE5C57324CFE6C16B53D61AD985B37F4B1E2F11234C52A869E184008999358EC0D2B4F2F163A09D3BA9B83D7E5647B5BE92014286D5F0BCE0CA14417226462191D3F0D8587A3ADA2C561FBA5DFE938606476882472C64C9E07D6BDB6C51D59B7978C792383C0CCC28337192A30340742C82EFCB3693FE93FBDA870554CF40F2B176C831628FF339739EC87389A2DD261EE9C6AAFF09ECEFF6C5074D7755ACA4A9D937A1F3A7C31D82E606E6CC6AC90189C17899B13EB759761EEA35AAF74D0B7F2411031AF81B9B946AE2E154FC08F3BB3E2DDE5F52DBC0E1164DCE028EFA45B1D58F4B32EF016D4F995909D3E0F3F69B8115D35",
PkA_sike: "A4B4F6EBE68ADD27A491753D258165D65460C876920851C89D5B7D8063E7D9A0523F20DDE236B818FA3E6C07A66C9DB9F019DCAA340D4DE6FDCFFE2B189903EF8FC41A8502E7A4E6AF99D8A712CB4A17D96AF139B8810C7E8ED4F7B7DE2EDC7E53F964399FD4C4CC54F843F7A07A3CA0D5732E4EBC7499DE5414E5BF70148B7D4C318A2172F18BF0E6BEEAEBBDFAA0854CAFC2740C812A7B44040C2774FABBF300EDFC0935DBC5ABF30E73F2F3397020FB7552DFF3022F77FD0EDA5827D168E61D488C1F2CE9FA6F47A14956B4CD64CACEEEDED4AFE28B2578D595B121019E95FA3D8F1B6CF3B515FF93C18A2A50212404862E228DB176CD1BC3B1254C97503E69BA6024C442ADD4F8912124F6D06FA8F95ACBCD235D2608AE204FC0C2B65B4EA569919A7BB4C9372867F2B6346560B0324F9D337634948579E414283CDE779793C1D65BFD8FEBBE1E7C85E82D0290C4435ED77818A47C9573F5F74B46251176A46E02E65C967C06B3994F27578235CC7508FE00D5DE2AD7A514",
PrB_sike: "4B622DE1350119C45A9F2E2EF3DC5DF50A759D138CDFBD64E82FCC97CA60CCB27BF6938C975658AEB8B4D37CFFBDE25D97E561F36C219A0E",
PkB_sike: "4EC46509AB1C547BDF2311B3AF82FCD25A83D154D9649C0D1A7F1E4D174BE9ED44F4B8AD2160FF43D4B94E65BE5A64DA3B8D5B63A02C3DCD376BB24122E03C3F09F4253E6F117999D0359F6BAB94F38BDB4B681EE09351483380EA4839E7808F8DF11C9A01DBC9D4C61075F3FF39B444679A8F3BEAE4BD47BE5B3A4D4B0F44F44BC8AB1B40E91852605F92860F6B4E627E8F7B00168CED2BA9D86865A5314E32E39B15E2021790CECA67A47959915E5C9717C96A055ADA061921F15306E4600751E984DA5FBC72E5F4E7B1182F60109DDD50C04A7A8D4281121AECD824730F38BE81A9D59B480DE44EB6CFC93436000C6E302B710FE3C24E6E6E0A371DF2B81CFBB37EDBD739926DBBE95A81D90DA22A7A5DF0DEE13031B7DE91504F45E20F0F15B24931A5D41EE48FA84F11D9F33B1F5BF315B355FAC0AB40C702190C190489DDA7B8715E680CE0DE4BFB50D78290C1A4C29F7C776597D9FB6C1DE65E150FAD46DF3CF38BDB22493697A2307A121B67C90B04C0809E1C8CA916",
}
@@ -285,7 +285,7 @@ func TestPKERoundTrip(t *testing.T) {
t.Fatal(err)
}
if !bytes.Equal(pt[:pt_len], msg[:]) {
t.Errorf("Decryption failed \n got : %X\n exp : %X", pt, msg)
t.Errorf("Decryption failed \n got : %X\n exp : %X", pt[:pt_len], msg)
}
}

@@ -369,7 +369,7 @@ func testKEMRoundTrip(t *testing.T, pkB, skB []byte) {
"error: Decapsulation during round-trip")

if !bytes.Equal(ss_e, ss_d) {
t.Error("Shared secrets from decapsulation and encapsulation differ")
t.Errorf("Shared secrets from decapsulation and encapsulation differ\nEncaps: %X\nDecaps: %X\n", ss_e, ss_d)
}
}



+ 1
- 0
tools/sliding_window_strat_calc.py View File

@@ -72,3 +72,4 @@ while i<len(kP34):
# skips first values to print exact table used by the algorithm
print(table_pow)
print(table_mul)


Loading…
Cancel
Save