|
|
|
@ -611,6 +611,23 @@ __constant__ static uint64_t F0[8] = // GOST_F(0)
@@ -611,6 +611,23 @@ __constant__ static uint64_t F0[8] = // GOST_F(0)
|
|
|
|
|
0x74a5d4ce2efc83b3, 0x74a5d4ce2efc83b3, 0x74a5d4ce2efc83b3, 0x74a5d4ce2efc83b3 |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
__constant__ static uint64_t CC_F0[12][8] = |
|
|
|
|
{ |
|
|
|
|
{ 0x8FD72F640708B0D0, 0x0DE874C7EBC3F213, 0xE92EEF3AD202E9E0, 0xC1E9DA0708013DA7, 0x9727DAB2F014BE88, 0x103051A02BCD6935, 0x33EC7E1DBD28F736, 0x1ECF460CF78AD1F4 }, |
|
|
|
|
{ 0x0B2D9F89C775449D, 0x6B6EEFC6DAB7E8B0, 0xF1A0D31667F6EC44, 0x2A71132D5E108166, 0x0E9357C2EC87931A, 0xC99F5C1B4A01612D, 0x7E60B16E637D4EE2, 0xA9FCB827F9BA6D81 }, |
|
|
|
|
{ 0x231FECA5AB3D285C, 0x70C6E1483C838C3B, 0x9C21C3C40CE4E2DA, 0x2FA796BD5688E573, 0x04C0E3FF55809FDF, 0x5FF978BFB8E3CDC8, 0xC54A19D6A3D07033, 0x0FCA83FDDE872478 }, |
|
|
|
|
{ 0xBDF9312726339F10, 0x51A5BA1793BC9C56, 0xC4428DA14F96D2D4, 0xEC925222374EAB1F, 0x79477893747DD92F, 0xC495E19A46886304, 0x9C23F893BA7CFA36, 0x0C47268881FC5FEB }, |
|
|
|
|
{ 0xCF117966029B2CB3, 0x07179ABE77088A8F, 0x671EF4CC2650E257, 0x7474B8B170DAB5C6, 0x4224FEBECF35113E, 0x993D156C675C5537, 0x2DEE3A5782C39B45, 0xE7C586F2990DD385 }, |
|
|
|
|
{ 0x8608FD95B1C1138A, 0x8BB0847D9E9849AC, 0x5E76623F4F0EB0C7, 0x34C2BDBAFC5060CE, 0xE9E814475907826C, 0x22C9ED94D6AAC7C9, 0xE6B75E28171EB0D6, 0xF1329E5534E60215 }, |
|
|
|
|
{ 0x86BB4814B1C3CE52, 0xE8F226C9FBDDD017, 0xCEDED67991CB3087, 0x76C33E32FDBFACA5, 0xDBB13BE1A9F7474C, 0x3D0273470342C356, 0x8E7246C51CF07F61, 0xAC8C125DDEF8DF71 }, |
|
|
|
|
{ 0x6D73E747795B8CF3, 0x4E4AA65EA0072050, 0xA14A1582CB43C2B9, 0x748EF2B7BB63B938, 0x126789534410D7D4, 0xD4D48FF40301D791, 0xC67DFBE315C41FC0, 0x35E7A1A1AF88601C }, |
|
|
|
|
{ 0x9BD33EA0FAB34007, 0xF51B7CDBE3D67D25, 0xD3ABDA0CE4186E6B, 0x8E61DDADCBCE1706, 0x58994565B41BE6A5, 0x7A87ABC1240CD31D, 0xFAFE6C28487968D0, 0x15B368609FF9EEA7 }, |
|
|
|
|
{ 0xAE33263CCF115818, 0x93B2DBE9CADFCFC8, 0x0A91952BF91B0147, 0x458E67CA5F1ED73A, 0x94C2E5F288F074E3, 0x377895E85C69E996, 0xF11A4456AAB37B10, 0x163131934816821A }, |
|
|
|
|
{ 0xD07E4A2366BF469D, 0x5EF1A3D220213B6C, 0x3C5BB78971D8ED0F, 0x0DE05E6B9006F2D2, 0xC58CFB00B8EAA1C9, 0xEFCDB54D1F250B76, 0xFD135634FA527042, 0x4CEE791290516407 }, |
|
|
|
|
{ 0xD800B9264010790F, 0x974C4823E2B668D7, 0xA605A4B385C5E361, 0x3F6C92DA5A56D8D2, 0x82B9D67C12EF8277, 0x0AB6B4582561BF90, 0x46954FD98FC2CBA3, 0x70BE45CB21B6760D } |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
__constant__ static uint64_t F1[8] = // GOST_F(1) |
|
|
|
|
{ |
|
|
|
|
0x155f7bb040eec523, 0x155f7bb040eec523, 0x155f7bb040eec523, 0x155f7bb040eec523, |
|
|
|
@ -744,6 +761,21 @@ void GOST_E(uint64_t* const K, uint64_t* const m, uint64_t *state /* out only */
@@ -744,6 +761,21 @@ void GOST_E(uint64_t* const K, uint64_t* const m, uint64_t *state /* out only */
|
|
|
|
|
GOST_E12(K, state); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
__device__ |
|
|
|
|
void GOST_E_F0(uint64_t* const m, uint64_t *state /* out only */) |
|
|
|
|
{ |
|
|
|
|
GOST_Xor512(state, m, F0); // state = m ^ F0 |
|
|
|
|
|
|
|
|
|
uint64_t state1[8]; |
|
|
|
|
#pragma unroll 5 |
|
|
|
|
for(int i=0; i<12; i++) |
|
|
|
|
{ |
|
|
|
|
GOST_FS(state, state1); |
|
|
|
|
GOST_Xor512(state, state1, CC_F0[i]); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
__device__ |
|
|
|
|
void GOST_g_N(uint64_t* h, uint64_t* const M, uint64_t* const N) |
|
|
|
|
{ |
|
|
|
|