Lines Matching +full:6 +full:e +full:- +full:7

1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * SHA-256, as specified in
4 * http://csrc.nist.gov/groups/STM/cavp/documents/shs/sha256-384-512.pdf
6 * SHA-256 code by Jean-Luc Cooke <jlcooke@certainkey.com>.
8 * Copyright (c) Jean-Luc Cooke <jlcooke@certainkey.com>
51 #define e1(x) (ror32(x, 6) ^ ror32(x, 11) ^ ror32(x, 25))
52 #define s0(x) (ror32(x, 7) ^ ror32(x, 18) ^ (x >> 3))
62 W[I] = s1(W[I-2]) + W[I-7] + s0(W[I-15]) + W[I-16]; in BLEND_OP()
65 #define SHA256_ROUND(i, a, b, c, d, e, f, g, h) do { \ argument
67 t1 = h + e1(e) + Ch(e, f, g) + SHA256_K[i] + W[i]; \
75 u32 a, b, c, d, e, f, g, h; in sha256_transform() local
86 LOAD_OP(i + 6, W, input); in sha256_transform()
87 LOAD_OP(i + 7, W, input); in sha256_transform()
98 BLEND_OP(i + 6, W); in sha256_transform()
99 BLEND_OP(i + 7, W); in sha256_transform()
104 e = state[4]; f = state[5]; g = state[6]; h = state[7]; in sha256_transform()
108 SHA256_ROUND(i + 0, a, b, c, d, e, f, g, h); in sha256_transform()
109 SHA256_ROUND(i + 1, h, a, b, c, d, e, f, g); in sha256_transform()
110 SHA256_ROUND(i + 2, g, h, a, b, c, d, e, f); in sha256_transform()
111 SHA256_ROUND(i + 3, f, g, h, a, b, c, d, e); in sha256_transform()
112 SHA256_ROUND(i + 4, e, f, g, h, a, b, c, d); in sha256_transform()
113 SHA256_ROUND(i + 5, d, e, f, g, h, a, b, c); in sha256_transform()
114 SHA256_ROUND(i + 6, c, d, e, f, g, h, a, b); in sha256_transform()
115 SHA256_ROUND(i + 7, b, c, d, e, f, g, h, a); in sha256_transform()
119 state[4] += e; state[5] += f; state[6] += g; state[7] += h; in sha256_transform()
128 partial = sctx->count & 0x3f; in sha256_update()
129 sctx->count += len; in sha256_update()
135 done = -partial; in sha256_update()
136 memcpy(sctx->buf + partial, data, done + 64); in sha256_update()
137 src = sctx->buf; in sha256_update()
141 sha256_transform(sctx->state, src, W); in sha256_update()
150 memcpy(sctx->buf + partial, src, len - done); in sha256_update()
169 bits = cpu_to_be64(sctx->count << 3); in __sha256_final()
172 index = sctx->count & 0x3f; in __sha256_final()
173 pad_len = (index < 56) ? (56 - index) : ((64+56) - index); in __sha256_final()
181 put_unaligned_be32(sctx->state[i], &dst[i]); in __sha256_final()
195 __sha256_final(sctx, out, 7); in sha224_final()