Lines Matching +full:- +full:16 +full:g

30 #define ROTR(x, n)    (((uint32_t)(x) << (32 - (n))) | ((uint32_t)(x) >> (n)))
73 #define SHA2_STEP(A, B, C, D, E, F, G, H, j) do { \ in br_sha2small_round() argument
75 T1 = H + BSG2_1(E) + CH(E, F, G) + K[j] + w[j]; \ in br_sha2small_round()
82 uint32_t a, b, c, d, e, f, g, h; in br_sha2small_round() local
85 br_range_dec32be(w, 16, buf); in br_sha2small_round()
86 for (i = 16; i < 64; i ++) { in br_sha2small_round()
87 w[i] = SSG2_1(w[i - 2]) + w[i - 7] in br_sha2small_round()
88 + SSG2_0(w[i - 15]) + w[i - 16]; in br_sha2small_round()
96 g = val[6]; in br_sha2small_round()
99 SHA2_STEP(a, b, c, d, e, f, g, h, i + 0); in br_sha2small_round()
100 SHA2_STEP(h, a, b, c, d, e, f, g, i + 1); in br_sha2small_round()
101 SHA2_STEP(g, h, a, b, c, d, e, f, i + 2); in br_sha2small_round()
102 SHA2_STEP(f, g, h, a, b, c, d, e, i + 3); in br_sha2small_round()
103 SHA2_STEP(e, f, g, h, a, b, c, d, i + 4); in br_sha2small_round()
104 SHA2_STEP(d, e, f, g, h, a, b, c, i + 5); in br_sha2small_round()
105 SHA2_STEP(c, d, e, f, g, h, a, b, i + 6); in br_sha2small_round()
106 SHA2_STEP(b, c, d, e, f, g, h, a, i + 7); in br_sha2small_round()
114 val[6] += g; in br_sha2small_round()
124 W[(pc) & 0x0F] = SSG2_1(W[((pc) - 2) & 0x0F]) \ in br_sha2small_round()
125 + W[((pc) - 7) & 0x0F] \ in br_sha2small_round()
126 + SSG2_0(W[((pc) - 15) & 0x0F]) + W[(pc) & 0x0F]; \ in br_sha2small_round()
129 #define SHA2_STEPn(n, a, b, c, d, e, f, g, h, pc) do { \ in br_sha2small_round()
132 t1 = h + BSG2_1(e) + CH(e, f, g) \ in br_sha2small_round()
139 #define SHA2_STEP1(a, b, c, d, e, f, g, h, pc) \ in br_sha2small_round()
140 SHA2_STEPn(1, a, b, c, d, e, f, g, h, pc) in br_sha2small_round()
141 #define SHA2_STEP2(a, b, c, d, e, f, g, h, pc) \ in br_sha2small_round()
142 SHA2_STEPn(2, a, b, c, d, e, f, g, h, pc) in br_sha2small_round()
144 uint32_t A, B, C, D, E, F, G, H; in br_sha2small_round()
145 uint32_t W[16]; in br_sha2small_round()
154 G = val[6]; in br_sha2small_round()
157 SHA2_STEP1(A, B, C, D, E, F, G, H, 0); in br_sha2small_round()
158 SHA2_STEP1(H, A, B, C, D, E, F, G, 1); in br_sha2small_round()
159 SHA2_STEP1(G, H, A, B, C, D, E, F, 2); in br_sha2small_round()
160 SHA2_STEP1(F, G, H, A, B, C, D, E, 3); in br_sha2small_round()
161 SHA2_STEP1(E, F, G, H, A, B, C, D, 4); in br_sha2small_round()
162 SHA2_STEP1(D, E, F, G, H, A, B, C, 5); in br_sha2small_round()
163 SHA2_STEP1(C, D, E, F, G, H, A, B, 6); in br_sha2small_round()
164 SHA2_STEP1(B, C, D, E, F, G, H, A, 7); in br_sha2small_round()
165 SHA2_STEP1(A, B, C, D, E, F, G, H, 8); in br_sha2small_round()
166 SHA2_STEP1(H, A, B, C, D, E, F, G, 9); in br_sha2small_round()
167 SHA2_STEP1(G, H, A, B, C, D, E, F, 10); in br_sha2small_round()
168 SHA2_STEP1(F, G, H, A, B, C, D, E, 11); in br_sha2small_round()
169 SHA2_STEP1(E, F, G, H, A, B, C, D, 12); in br_sha2small_round()
170 SHA2_STEP1(D, E, F, G, H, A, B, C, 13); in br_sha2small_round()
171 SHA2_STEP1(C, D, E, F, G, H, A, B, 14); in br_sha2small_round()
172 SHA2_STEP1(B, C, D, E, F, G, H, A, 15); in br_sha2small_round()
173 for (pcount = 16; pcount < 64; pcount += 16) { in br_sha2small_round()
174 SHA2_STEP2(A, B, C, D, E, F, G, H, 0); in br_sha2small_round()
175 SHA2_STEP2(H, A, B, C, D, E, F, G, 1); in br_sha2small_round()
176 SHA2_STEP2(G, H, A, B, C, D, E, F, 2); in br_sha2small_round()
177 SHA2_STEP2(F, G, H, A, B, C, D, E, 3); in br_sha2small_round()
178 SHA2_STEP2(E, F, G, H, A, B, C, D, 4); in br_sha2small_round()
179 SHA2_STEP2(D, E, F, G, H, A, B, C, 5); in br_sha2small_round()
180 SHA2_STEP2(C, D, E, F, G, H, A, B, 6); in br_sha2small_round()
181 SHA2_STEP2(B, C, D, E, F, G, H, A, 7); in br_sha2small_round()
182 SHA2_STEP2(A, B, C, D, E, F, G, H, 8); in br_sha2small_round()
183 SHA2_STEP2(H, A, B, C, D, E, F, G, 9); in br_sha2small_round()
184 SHA2_STEP2(G, H, A, B, C, D, E, F, 10); in br_sha2small_round()
185 SHA2_STEP2(F, G, H, A, B, C, D, E, 11); in br_sha2small_round()
186 SHA2_STEP2(E, F, G, H, A, B, C, D, 12); in br_sha2small_round()
187 SHA2_STEP2(D, E, F, G, H, A, B, C, 13); in br_sha2small_round()
188 SHA2_STEP2(C, D, E, F, G, H, A, B, 14); in br_sha2small_round()
189 SHA2_STEP2(B, C, D, E, F, G, H, A, 15); in br_sha2small_round()
197 val[6] += G; in br_sha2small_round()
209 ptr = (size_t)cc->count & 63; in sha2small_update()
210 cc->count += (uint64_t)len; in sha2small_update()
214 clen = 64 - ptr; in sha2small_update()
218 memcpy(cc->buf + ptr, buf, clen); in sha2small_update()
221 len -= clen; in sha2small_update()
223 br_sha2small_round(cc->buf, cc->val); in sha2small_update()
236 ptr = (size_t)cc->count & 63; in sha2small_out()
237 memcpy(buf, cc->buf, ptr); in sha2small_out()
238 memcpy(val, cc->val, sizeof val); in sha2small_out()
241 memset(buf + ptr, 0, 64 - ptr); in sha2small_out()
245 memset(buf + ptr, 0, 56 - ptr); in sha2small_out()
247 br_enc64be(buf + 56, cc->count << 3); in sha2small_out()
256 cc->vtable = &br_sha224_vtable; in br_sha224_init()
257 memcpy(cc->val, br_sha224_IV, sizeof cc->val); in br_sha224_init()
258 cc->count = 0; in br_sha224_init()
279 br_range_enc32be(dst, cc->val, 8); in br_sha224_state()
280 return cc->count; in br_sha224_state()
287 br_range_dec32be(cc->val, 8, stb); in br_sha224_set_state()
288 cc->count = count; in br_sha224_set_state()
295 cc->vtable = &br_sha256_vtable; in br_sha256_init()
296 memcpy(cc->val, br_sha256_IV, sizeof cc->val); in br_sha256_init()
297 cc->count = 0; in br_sha256_init()