• Home
  • Raw
  • Download

Lines Matching +full:0 +full:- +full:9 +full:a +full:- +full:e

2  * SM3 secure hash, as specified by OSCCA GM/T 0004-2012 SM3 and
3 * described at https://tools.ietf.org/html/draft-shen-sm3-hash-01
6 * Written by Gilad Ben-Yossef <gilad@benyossef.com>
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * You should have received a copy of the GNU General Public License
33 0x1A, 0xB2, 0x1D, 0x83, 0x55, 0xCF, 0xA1, 0x7F,
34 0x8e, 0x61, 0x19, 0x48, 0x31, 0xE8, 0x1A, 0x8F,
35 0x22, 0xBE, 0xC8, 0xC7, 0x28, 0xFE, 0xFB, 0x74,
36 0x7E, 0xD0, 0x35, 0xEB, 0x50, 0x82, 0xAA, 0x2B
42 return x ^ rol32(x, 9) ^ rol32(x, 17); in p0()
50 static inline u32 ff(unsigned int n, u32 a, u32 b, u32 c) in ff() argument
52 return (n < 16) ? (a ^ b ^ c) : ((a & b) | (a & c) | (b & c)); in ff()
55 static inline u32 gg(unsigned int n, u32 e, u32 f, u32 g) in gg() argument
57 return (n < 16) ? (e ^ f ^ g) : ((e & f) | ((~e) & g)); in gg()
71 for (i = 0; i <= 15; i++) in sm3_expand()
75 tmp = w[i - 16] ^ w[i - 9] ^ rol32(w[i - 3], 15); in sm3_expand()
76 w[i] = p1(tmp) ^ (rol32(w[i - 13], 7)) ^ w[i - 6]; in sm3_expand()
79 for (i = 0; i <= 63; i++) in sm3_expand()
89 u32 a, b, c, d, e, f, g, h; in sm3_compress() local
92 a = m[0]; in sm3_compress()
96 e = m[4]; in sm3_compress()
101 for (i = 0; i <= 63; i++) { in sm3_compress()
103 ss1 = rol32((rol32(a, 12) + e + rol32(t(i), i & 31)), 7); in sm3_compress()
105 ss2 = ss1 ^ rol32(a, 12); in sm3_compress()
107 tt1 = ff(i, a, b, c) + d + ss2 + *wt; in sm3_compress()
110 tt2 = gg(i, e, f, g) + h + ss1 + *w; in sm3_compress()
114 c = rol32(b, 9); in sm3_compress()
115 b = a; in sm3_compress()
116 a = tt1; in sm3_compress()
119 f = e; in sm3_compress()
120 e = p0(tt2); in sm3_compress()
123 m[0] = a ^ m[0]; in sm3_compress()
127 m[4] = e ^ m[4]; in sm3_compress()
132 a = b = c = d = e = f = g = h = ss1 = ss2 = tt1 = tt2 = 0; in sm3_compress()
141 sm3_compress(w, wt, sst->state); in sm3_transform()
150 while (blocks--) { in sm3_generic_block_fn()
186 .cra_driver_name = "sm3-generic",
209 MODULE_ALIAS_CRYPTO("sm3-generic");