• Home
  • Raw
  • Download

Lines Matching +full:a +full:- +full:c

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>
9 * Copyright (c) Andrew McDonald <andrew@mcdonald.org.uk>
10 * Copyright (c) 2002 James Morris <jmorris@intercode.com.au>
11 * Copyright (c) 2014 Red Hat Inc.
43 W[I] = s1(W[I-2]) + W[I-7] + s0(W[I-15]) + W[I-16]; in BLEND_OP()
48 u32 a, b, c, d, e, f, g, h, t1, t2; in sha256_transform() local
61 a = state[0]; b = state[1]; c = state[2]; d = state[3]; in sha256_transform()
66 t2 = e0(a) + Maj(a, b, c); d += t1; h = t1 + t2; in sha256_transform()
68 t2 = e0(h) + Maj(h, a, b); c += t1; g = t1 + t2; in sha256_transform()
69 t1 = f + e1(c) + Ch(c, d, e) + 0xb5c0fbcf + W[2]; in sha256_transform()
70 t2 = e0(g) + Maj(g, h, a); b += t1; f = t1 + t2; in sha256_transform()
71 t1 = e + e1(b) + Ch(b, c, d) + 0xe9b5dba5 + W[3]; in sha256_transform()
72 t2 = e0(f) + Maj(f, g, h); a += t1; e = t1 + t2; in sha256_transform()
73 t1 = d + e1(a) + Ch(a, b, c) + 0x3956c25b + W[4]; in sha256_transform()
75 t1 = c + e1(h) + Ch(h, a, b) + 0x59f111f1 + W[5]; in sha256_transform()
76 t2 = e0(d) + Maj(d, e, f); g += t1; c = t1 + t2; in sha256_transform()
77 t1 = b + e1(g) + Ch(g, h, a) + 0x923f82a4 + W[6]; in sha256_transform()
78 t2 = e0(c) + Maj(c, d, e); f += t1; b = t1 + t2; in sha256_transform()
79 t1 = a + e1(f) + Ch(f, g, h) + 0xab1c5ed5 + W[7]; in sha256_transform()
80 t2 = e0(b) + Maj(b, c, d); e += t1; a = t1 + t2; in sha256_transform()
83 t2 = e0(a) + Maj(a, b, c); d += t1; h = t1 + t2; in sha256_transform()
85 t2 = e0(h) + Maj(h, a, b); c += t1; g = t1 + t2; in sha256_transform()
86 t1 = f + e1(c) + Ch(c, d, e) + 0x243185be + W[10]; in sha256_transform()
87 t2 = e0(g) + Maj(g, h, a); b += t1; f = t1 + t2; in sha256_transform()
88 t1 = e + e1(b) + Ch(b, c, d) + 0x550c7dc3 + W[11]; in sha256_transform()
89 t2 = e0(f) + Maj(f, g, h); a += t1; e = t1 + t2; in sha256_transform()
90 t1 = d + e1(a) + Ch(a, b, c) + 0x72be5d74 + W[12]; in sha256_transform()
92 t1 = c + e1(h) + Ch(h, a, b) + 0x80deb1fe + W[13]; in sha256_transform()
93 t2 = e0(d) + Maj(d, e, f); g += t1; c = t1 + t2; in sha256_transform()
94 t1 = b + e1(g) + Ch(g, h, a) + 0x9bdc06a7 + W[14]; in sha256_transform()
95 t2 = e0(c) + Maj(c, d, e); f += t1; b = t1 + t2; in sha256_transform()
96 t1 = a + e1(f) + Ch(f, g, h) + 0xc19bf174 + W[15]; in sha256_transform()
97 t2 = e0(b) + Maj(b, c, d); e += t1; a = t1 + t2; in sha256_transform()
100 t2 = e0(a) + Maj(a, b, c); d += t1; h = t1 + t2; in sha256_transform()
102 t2 = e0(h) + Maj(h, a, b); c += t1; g = t1 + t2; in sha256_transform()
103 t1 = f + e1(c) + Ch(c, d, e) + 0x0fc19dc6 + W[18]; in sha256_transform()
104 t2 = e0(g) + Maj(g, h, a); b += t1; f = t1 + t2; in sha256_transform()
105 t1 = e + e1(b) + Ch(b, c, d) + 0x240ca1cc + W[19]; in sha256_transform()
106 t2 = e0(f) + Maj(f, g, h); a += t1; e = t1 + t2; in sha256_transform()
107 t1 = d + e1(a) + Ch(a, b, c) + 0x2de92c6f + W[20]; in sha256_transform()
109 t1 = c + e1(h) + Ch(h, a, b) + 0x4a7484aa + W[21]; in sha256_transform()
110 t2 = e0(d) + Maj(d, e, f); g += t1; c = t1 + t2; in sha256_transform()
111 t1 = b + e1(g) + Ch(g, h, a) + 0x5cb0a9dc + W[22]; in sha256_transform()
112 t2 = e0(c) + Maj(c, d, e); f += t1; b = t1 + t2; in sha256_transform()
113 t1 = a + e1(f) + Ch(f, g, h) + 0x76f988da + W[23]; in sha256_transform()
114 t2 = e0(b) + Maj(b, c, d); e += t1; a = t1 + t2; in sha256_transform()
117 t2 = e0(a) + Maj(a, b, c); d += t1; h = t1 + t2; in sha256_transform()
119 t2 = e0(h) + Maj(h, a, b); c += t1; g = t1 + t2; in sha256_transform()
120 t1 = f + e1(c) + Ch(c, d, e) + 0xb00327c8 + W[26]; in sha256_transform()
121 t2 = e0(g) + Maj(g, h, a); b += t1; f = t1 + t2; in sha256_transform()
122 t1 = e + e1(b) + Ch(b, c, d) + 0xbf597fc7 + W[27]; in sha256_transform()
123 t2 = e0(f) + Maj(f, g, h); a += t1; e = t1 + t2; in sha256_transform()
124 t1 = d + e1(a) + Ch(a, b, c) + 0xc6e00bf3 + W[28]; in sha256_transform()
126 t1 = c + e1(h) + Ch(h, a, b) + 0xd5a79147 + W[29]; in sha256_transform()
127 t2 = e0(d) + Maj(d, e, f); g += t1; c = t1 + t2; in sha256_transform()
128 t1 = b + e1(g) + Ch(g, h, a) + 0x06ca6351 + W[30]; in sha256_transform()
129 t2 = e0(c) + Maj(c, d, e); f += t1; b = t1 + t2; in sha256_transform()
130 t1 = a + e1(f) + Ch(f, g, h) + 0x14292967 + W[31]; in sha256_transform()
131 t2 = e0(b) + Maj(b, c, d); e += t1; a = t1 + t2; in sha256_transform()
134 t2 = e0(a) + Maj(a, b, c); d += t1; h = t1 + t2; in sha256_transform()
136 t2 = e0(h) + Maj(h, a, b); c += t1; g = t1 + t2; in sha256_transform()
137 t1 = f + e1(c) + Ch(c, d, e) + 0x4d2c6dfc + W[34]; in sha256_transform()
138 t2 = e0(g) + Maj(g, h, a); b += t1; f = t1 + t2; in sha256_transform()
139 t1 = e + e1(b) + Ch(b, c, d) + 0x53380d13 + W[35]; in sha256_transform()
140 t2 = e0(f) + Maj(f, g, h); a += t1; e = t1 + t2; in sha256_transform()
141 t1 = d + e1(a) + Ch(a, b, c) + 0x650a7354 + W[36]; in sha256_transform()
143 t1 = c + e1(h) + Ch(h, a, b) + 0x766a0abb + W[37]; in sha256_transform()
144 t2 = e0(d) + Maj(d, e, f); g += t1; c = t1 + t2; in sha256_transform()
145 t1 = b + e1(g) + Ch(g, h, a) + 0x81c2c92e + W[38]; in sha256_transform()
146 t2 = e0(c) + Maj(c, d, e); f += t1; b = t1 + t2; in sha256_transform()
147 t1 = a + e1(f) + Ch(f, g, h) + 0x92722c85 + W[39]; in sha256_transform()
148 t2 = e0(b) + Maj(b, c, d); e += t1; a = t1 + t2; in sha256_transform()
151 t2 = e0(a) + Maj(a, b, c); d += t1; h = t1 + t2; in sha256_transform()
153 t2 = e0(h) + Maj(h, a, b); c += t1; g = t1 + t2; in sha256_transform()
154 t1 = f + e1(c) + Ch(c, d, e) + 0xc24b8b70 + W[42]; in sha256_transform()
155 t2 = e0(g) + Maj(g, h, a); b += t1; f = t1 + t2; in sha256_transform()
156 t1 = e + e1(b) + Ch(b, c, d) + 0xc76c51a3 + W[43]; in sha256_transform()
157 t2 = e0(f) + Maj(f, g, h); a += t1; e = t1 + t2; in sha256_transform()
158 t1 = d + e1(a) + Ch(a, b, c) + 0xd192e819 + W[44]; in sha256_transform()
160 t1 = c + e1(h) + Ch(h, a, b) + 0xd6990624 + W[45]; in sha256_transform()
161 t2 = e0(d) + Maj(d, e, f); g += t1; c = t1 + t2; in sha256_transform()
162 t1 = b + e1(g) + Ch(g, h, a) + 0xf40e3585 + W[46]; in sha256_transform()
163 t2 = e0(c) + Maj(c, d, e); f += t1; b = t1 + t2; in sha256_transform()
164 t1 = a + e1(f) + Ch(f, g, h) + 0x106aa070 + W[47]; in sha256_transform()
165 t2 = e0(b) + Maj(b, c, d); e += t1; a = t1 + t2; in sha256_transform()
168 t2 = e0(a) + Maj(a, b, c); d += t1; h = t1 + t2; in sha256_transform()
170 t2 = e0(h) + Maj(h, a, b); c += t1; g = t1 + t2; in sha256_transform()
171 t1 = f + e1(c) + Ch(c, d, e) + 0x2748774c + W[50]; in sha256_transform()
172 t2 = e0(g) + Maj(g, h, a); b += t1; f = t1 + t2; in sha256_transform()
173 t1 = e + e1(b) + Ch(b, c, d) + 0x34b0bcb5 + W[51]; in sha256_transform()
174 t2 = e0(f) + Maj(f, g, h); a += t1; e = t1 + t2; in sha256_transform()
175 t1 = d + e1(a) + Ch(a, b, c) + 0x391c0cb3 + W[52]; in sha256_transform()
177 t1 = c + e1(h) + Ch(h, a, b) + 0x4ed8aa4a + W[53]; in sha256_transform()
178 t2 = e0(d) + Maj(d, e, f); g += t1; c = t1 + t2; in sha256_transform()
179 t1 = b + e1(g) + Ch(g, h, a) + 0x5b9cca4f + W[54]; in sha256_transform()
180 t2 = e0(c) + Maj(c, d, e); f += t1; b = t1 + t2; in sha256_transform()
181 t1 = a + e1(f) + Ch(f, g, h) + 0x682e6ff3 + W[55]; in sha256_transform()
182 t2 = e0(b) + Maj(b, c, d); e += t1; a = t1 + t2; in sha256_transform()
185 t2 = e0(a) + Maj(a, b, c); d += t1; h = t1 + t2; in sha256_transform()
187 t2 = e0(h) + Maj(h, a, b); c += t1; g = t1 + t2; in sha256_transform()
188 t1 = f + e1(c) + Ch(c, d, e) + 0x84c87814 + W[58]; in sha256_transform()
189 t2 = e0(g) + Maj(g, h, a); b += t1; f = t1 + t2; in sha256_transform()
190 t1 = e + e1(b) + Ch(b, c, d) + 0x8cc70208 + W[59]; in sha256_transform()
191 t2 = e0(f) + Maj(f, g, h); a += t1; e = t1 + t2; in sha256_transform()
192 t1 = d + e1(a) + Ch(a, b, c) + 0x90befffa + W[60]; in sha256_transform()
194 t1 = c + e1(h) + Ch(h, a, b) + 0xa4506ceb + W[61]; in sha256_transform()
195 t2 = e0(d) + Maj(d, e, f); g += t1; c = t1 + t2; in sha256_transform()
196 t1 = b + e1(g) + Ch(g, h, a) + 0xbef9a3f7 + W[62]; in sha256_transform()
197 t2 = e0(c) + Maj(c, d, e); f += t1; b = t1 + t2; in sha256_transform()
198 t1 = a + e1(f) + Ch(f, g, h) + 0xc67178f2 + W[63]; in sha256_transform()
199 t2 = e0(b) + Maj(b, c, d); e += t1; a = t1 + t2; in sha256_transform()
201 state[0] += a; state[1] += b; state[2] += c; state[3] += d; in sha256_transform()
205 a = b = c = d = e = f = g = h = t1 = t2 = 0; in sha256_transform()
214 partial = sctx->count & 0x3f; in sha256_update()
215 sctx->count += len; in sha256_update()
221 done = -partial; in sha256_update()
222 memcpy(sctx->buf + partial, data, done + 64); in sha256_update()
223 src = sctx->buf; in sha256_update()
227 sha256_transform(sctx->state, src); in sha256_update()
234 memcpy(sctx->buf + partial, src, len - done); in sha256_update()
253 bits = cpu_to_be64(sctx->count << 3); in __sha256_final()
256 index = sctx->count & 0x3f; in __sha256_final()
257 pad_len = (index < 56) ? (56 - index) : ((64+56) - index); in __sha256_final()
265 put_unaligned_be32(sctx->state[i], &dst[i]); in __sha256_final()