Lines Matching +full:0 +full:- +full:9 +full:a +full:- +full:e
1 // SPDX-License-Identifier: GPL-2.0-only
3 * SM3 secure hash, as specified by OSCCA GM/T 0004-2012 SM3 and
4 * described at https://tools.ietf.org/html/draft-shen-sm3-hash-01
7 * Written by Gilad Ben-Yossef <gilad@benyossef.com>
22 0x1A, 0xB2, 0x1D, 0x83, 0x55, 0xCF, 0xA1, 0x7F,
23 0x8e, 0x61, 0x19, 0x48, 0x31, 0xE8, 0x1A, 0x8F,
24 0x22, 0xBE, 0xC8, 0xC7, 0x28, 0xFE, 0xFB, 0x74,
25 0x7E, 0xD0, 0x35, 0xEB, 0x50, 0x82, 0xAA, 0x2B
31 return x ^ rol32(x, 9) ^ rol32(x, 17); in p0()
39 static inline u32 ff(unsigned int n, u32 a, u32 b, u32 c) in ff() argument
41 return (n < 16) ? (a ^ b ^ c) : ((a & b) | (a & c) | (b & c)); in ff()
44 static inline u32 gg(unsigned int n, u32 e, u32 f, u32 g) in gg() argument
46 return (n < 16) ? (e ^ f ^ g) : ((e & f) | ((~e) & g)); in gg()
60 for (i = 0; i <= 15; i++) in sm3_expand()
64 tmp = w[i - 16] ^ w[i - 9] ^ rol32(w[i - 3], 15); in sm3_expand()
65 w[i] = p1(tmp) ^ (rol32(w[i - 13], 7)) ^ w[i - 6]; in sm3_expand()
68 for (i = 0; i <= 63; i++) in sm3_expand()
78 u32 a, b, c, d, e, f, g, h; in sm3_compress() local
81 a = m[0]; in sm3_compress()
85 e = m[4]; in sm3_compress()
90 for (i = 0; i <= 63; i++) { in sm3_compress()
92 ss1 = rol32((rol32(a, 12) + e + rol32(t(i), i & 31)), 7); in sm3_compress()
94 ss2 = ss1 ^ rol32(a, 12); in sm3_compress()
96 tt1 = ff(i, a, b, c) + d + ss2 + *wt; in sm3_compress()
99 tt2 = gg(i, e, f, g) + h + ss1 + *w; in sm3_compress()
103 c = rol32(b, 9); in sm3_compress()
104 b = a; in sm3_compress()
105 a = tt1; in sm3_compress()
108 f = e; in sm3_compress()
109 e = p0(tt2); in sm3_compress()
112 m[0] = a ^ m[0]; in sm3_compress()
116 m[4] = e ^ m[4]; in sm3_compress()
121 a = b = c = d = e = f = g = h = ss1 = ss2 = tt1 = tt2 = 0; in sm3_compress()
130 sm3_compress(w, wt, sst->state); in sm3_transform()
139 while (blocks--) { in sm3_generic_block_fn()
176 .cra_driver_name = "sm3-generic",
199 MODULE_ALIAS_CRYPTO("sm3-generic");