Lines Matching +full:mix +full:-
1 /*-
48 /* Copy a vector of big-endian uint32_t into a vector of bytes */
52 /* Copy a vector of bytes into a vector of big-endian uint32_t */
60 * (unsigned char) in big-endian form. Assumes len is a multiple of 4.
72 * Decode a big-endian length len vector of (unsigned char) into a length
110 #define ROTR(x, n) ((x >> n) | (x << (32 - n)))
124 RND(S[(64 - i) % 8], S[(65 - i) % 8], \
125 S[(66 - i) % 8], S[(67 - i) % 8], \
126 S[(68 - i) % 8], S[(69 - i) % 8], \
127 S[(70 - i) % 8], S[(71 - i) % 8], \
135 * SHA256 block compression function. The 256-bit state is transformed via
136 * the 512-bit input block to produce a new state.
155 /* 3. Mix. */ in SHA256_Transform_c()
194 /* 4. Mix local working variables into global state */ in SHA256_Transform_c()
227 /* Add padding and terminating bit-count. */
234 r = (ctx->count >> 3) & 0x3f; in SHA256_Pad()
239 memcpy(&ctx->buf[r], PAD, 56 - r); in SHA256_Pad()
241 /* Finish the current block and mix. */ in SHA256_Pad()
242 memcpy(&ctx->buf[r], PAD, 64 - r); in SHA256_Pad()
243 SHA256_Transform(ctx->state, ctx->buf); in SHA256_Pad()
246 memset(&ctx->buf[0], 0, 56); in SHA256_Pad()
249 /* Add the terminating bit-count. */ in SHA256_Pad()
250 be64enc(&ctx->buf[56], ctx->count); in SHA256_Pad()
252 /* Mix in the final block. */ in SHA256_Pad()
253 SHA256_Transform(ctx->state, ctx->buf); in SHA256_Pad()
256 /* SHA-256 initialization. Begins a SHA-256 operation. */
262 ctx->count = 0; in SHA256_Init()
265 ctx->state[0] = 0x6A09E667; in SHA256_Init()
266 ctx->state[1] = 0xBB67AE85; in SHA256_Init()
267 ctx->state[2] = 0x3C6EF372; in SHA256_Init()
268 ctx->state[3] = 0xA54FF53A; in SHA256_Init()
269 ctx->state[4] = 0x510E527F; in SHA256_Init()
270 ctx->state[5] = 0x9B05688C; in SHA256_Init()
271 ctx->state[6] = 0x1F83D9AB; in SHA256_Init()
272 ctx->state[7] = 0x5BE0CD19; in SHA256_Init()
284 r = (ctx->count >> 3) & 0x3f; in SHA256_Update()
290 ctx->count += bitlen; in SHA256_Update()
293 if (len < 64 - r) { in SHA256_Update()
294 memcpy(&ctx->buf[r], src, len); in SHA256_Update()
299 memcpy(&ctx->buf[r], src, 64 - r); in SHA256_Update()
300 SHA256_Transform(ctx->state, ctx->buf); in SHA256_Update()
301 src += 64 - r; in SHA256_Update()
302 len -= 64 - r; in SHA256_Update()
306 SHA256_Transform(ctx->state, src); in SHA256_Update()
308 len -= 64; in SHA256_Update()
312 memcpy(ctx->buf, src, len); in SHA256_Update()
316 * SHA-256 finalization. Pads the input data, exports the hash value,
327 be32enc_vect(digest, ctx->state, SHA256_DIGEST_LENGTH); in SHA256_Final()
333 /*** SHA-224: *********************************************************/
338 /* SHA-224 initialization. Begins a SHA-224 operation. */
344 ctx->count = 0; in SHA224_Init()
347 ctx->state[0] = 0xC1059ED8; in SHA224_Init()
348 ctx->state[1] = 0x367CD507; in SHA224_Init()
349 ctx->state[2] = 0x3070DD17; in SHA224_Init()
350 ctx->state[3] = 0xF70E5939; in SHA224_Init()
351 ctx->state[4] = 0xFFC00B31; in SHA224_Init()
352 ctx->state[5] = 0x68581511; in SHA224_Init()
353 ctx->state[6] = 0x64f98FA7; in SHA224_Init()
354 ctx->state[7] = 0xBEFA4FA4; in SHA224_Init()
357 /* Add bytes into the SHA-224 hash */
366 * SHA-224 finalization. Pads the input data, exports the hash value,
377 be32enc_vect(digest, ctx->state, SHA224_DIGEST_LENGTH); in SHA224_Final()