Lines Matching refs:i
175 unsigned int frag, last, packlen, i, x4 = 4 * n4x, minblocks, processed = in tls1_1_multi_block_encrypt() local
207 for (i = 1; i < x4; i++) { in tls1_1_multi_block_encrypt()
208 ciph_d[i].inp = hash_d[i].ptr = hash_d[i - 1].ptr + frag; in tls1_1_multi_block_encrypt()
209 ciph_d[i].out = ciph_d[i - 1].out + packlen; in tls1_1_multi_block_encrypt()
210 memcpy(ciph_d[i].out - 16, IVs, 16); in tls1_1_multi_block_encrypt()
211 memcpy(ciph_d[i].iv, IVs, 16); in tls1_1_multi_block_encrypt()
219 for (i = 0; i < x4; i++) { in tls1_1_multi_block_encrypt()
220 unsigned int len = (i == (x4 - 1) ? last : frag); in tls1_1_multi_block_encrypt()
225 ctx->A[i] = key->md.h0; in tls1_1_multi_block_encrypt()
226 ctx->B[i] = key->md.h1; in tls1_1_multi_block_encrypt()
227 ctx->C[i] = key->md.h2; in tls1_1_multi_block_encrypt()
228 ctx->D[i] = key->md.h3; in tls1_1_multi_block_encrypt()
229 ctx->E[i] = key->md.h4; in tls1_1_multi_block_encrypt()
233 blocks[i].q[0] = BSWAP8(seqnum + i); in tls1_1_multi_block_encrypt()
235 for (carry = i, j = 8; j--;) { in tls1_1_multi_block_encrypt()
236 blocks[i].c[j] = ((u8 *)key->md.data)[j] + carry; in tls1_1_multi_block_encrypt()
237 carry = (blocks[i].c[j] - carry) >> (sizeof(carry) * 8 - 1); in tls1_1_multi_block_encrypt()
240 blocks[i].c[8] = ((u8 *)key->md.data)[8]; in tls1_1_multi_block_encrypt()
241 blocks[i].c[9] = ((u8 *)key->md.data)[9]; in tls1_1_multi_block_encrypt()
242 blocks[i].c[10] = ((u8 *)key->md.data)[10]; in tls1_1_multi_block_encrypt()
244 blocks[i].c[11] = (u8)(len >> 8); in tls1_1_multi_block_encrypt()
245 blocks[i].c[12] = (u8)(len); in tls1_1_multi_block_encrypt()
247 memcpy(blocks[i].c + 13, hash_d[i].ptr, 64 - 13); in tls1_1_multi_block_encrypt()
248 hash_d[i].ptr += 64 - 13; in tls1_1_multi_block_encrypt()
249 hash_d[i].blocks = (len - (64 - 13)) / 64; in tls1_1_multi_block_encrypt()
251 edges[i].ptr = blocks[i].c; in tls1_1_multi_block_encrypt()
252 edges[i].blocks = 1; in tls1_1_multi_block_encrypt()
268 for (i = 0; i < x4; i++) { in tls1_1_multi_block_encrypt()
269 edges[i].ptr = hash_d[i].ptr; in tls1_1_multi_block_encrypt()
270 edges[i].blocks = MAXCHUNKSIZE / 64; in tls1_1_multi_block_encrypt()
271 ciph_d[i].blocks = MAXCHUNKSIZE / 16; in tls1_1_multi_block_encrypt()
277 for (i = 0; i < x4; i++) { in tls1_1_multi_block_encrypt()
278 edges[i].ptr = hash_d[i].ptr += MAXCHUNKSIZE; in tls1_1_multi_block_encrypt()
279 hash_d[i].blocks -= MAXCHUNKSIZE / 64; in tls1_1_multi_block_encrypt()
280 edges[i].blocks = MAXCHUNKSIZE / 64; in tls1_1_multi_block_encrypt()
281 ciph_d[i].inp += MAXCHUNKSIZE; in tls1_1_multi_block_encrypt()
282 ciph_d[i].out += MAXCHUNKSIZE; in tls1_1_multi_block_encrypt()
283 ciph_d[i].blocks = MAXCHUNKSIZE / 16; in tls1_1_multi_block_encrypt()
284 memcpy(ciph_d[i].iv, ciph_d[i].out - 16, 16); in tls1_1_multi_block_encrypt()
295 for (i = 0; i < x4; i++) { in tls1_1_multi_block_encrypt()
296 unsigned int len = (i == (x4 - 1) ? last : frag), in tls1_1_multi_block_encrypt()
297 off = hash_d[i].blocks * 64; in tls1_1_multi_block_encrypt()
298 const unsigned char *ptr = hash_d[i].ptr + off; in tls1_1_multi_block_encrypt()
301 memcpy(blocks[i].c, ptr, off); in tls1_1_multi_block_encrypt()
302 blocks[i].c[off] = 0x80; in tls1_1_multi_block_encrypt()
307 blocks[i].d[15] = BSWAP4(len); in tls1_1_multi_block_encrypt()
309 PUTU32(blocks[i].c + 60, len); in tls1_1_multi_block_encrypt()
311 edges[i].blocks = 1; in tls1_1_multi_block_encrypt()
314 blocks[i].d[31] = BSWAP4(len); in tls1_1_multi_block_encrypt()
316 PUTU32(blocks[i].c + 124, len); in tls1_1_multi_block_encrypt()
318 edges[i].blocks = 2; in tls1_1_multi_block_encrypt()
320 edges[i].ptr = blocks[i].c; in tls1_1_multi_block_encrypt()
327 for (i = 0; i < x4; i++) { in tls1_1_multi_block_encrypt()
329 blocks[i].d[0] = BSWAP4(ctx->A[i]); in tls1_1_multi_block_encrypt()
330 ctx->A[i] = key->tail.h0; in tls1_1_multi_block_encrypt()
331 blocks[i].d[1] = BSWAP4(ctx->B[i]); in tls1_1_multi_block_encrypt()
332 ctx->B[i] = key->tail.h1; in tls1_1_multi_block_encrypt()
333 blocks[i].d[2] = BSWAP4(ctx->C[i]); in tls1_1_multi_block_encrypt()
334 ctx->C[i] = key->tail.h2; in tls1_1_multi_block_encrypt()
335 blocks[i].d[3] = BSWAP4(ctx->D[i]); in tls1_1_multi_block_encrypt()
336 ctx->D[i] = key->tail.h3; in tls1_1_multi_block_encrypt()
337 blocks[i].d[4] = BSWAP4(ctx->E[i]); in tls1_1_multi_block_encrypt()
338 ctx->E[i] = key->tail.h4; in tls1_1_multi_block_encrypt()
339 blocks[i].c[20] = 0x80; in tls1_1_multi_block_encrypt()
340 blocks[i].d[15] = BSWAP4((64 + 20) * 8); in tls1_1_multi_block_encrypt()
342 PUTU32(blocks[i].c + 0, ctx->A[i]); in tls1_1_multi_block_encrypt()
343 ctx->A[i] = key->tail.h0; in tls1_1_multi_block_encrypt()
344 PUTU32(blocks[i].c + 4, ctx->B[i]); in tls1_1_multi_block_encrypt()
345 ctx->B[i] = key->tail.h1; in tls1_1_multi_block_encrypt()
346 PUTU32(blocks[i].c + 8, ctx->C[i]); in tls1_1_multi_block_encrypt()
347 ctx->C[i] = key->tail.h2; in tls1_1_multi_block_encrypt()
348 PUTU32(blocks[i].c + 12, ctx->D[i]); in tls1_1_multi_block_encrypt()
349 ctx->D[i] = key->tail.h3; in tls1_1_multi_block_encrypt()
350 PUTU32(blocks[i].c + 16, ctx->E[i]); in tls1_1_multi_block_encrypt()
351 ctx->E[i] = key->tail.h4; in tls1_1_multi_block_encrypt()
352 blocks[i].c[20] = 0x80; in tls1_1_multi_block_encrypt()
353 PUTU32(blocks[i].c + 60, (64 + 20) * 8); in tls1_1_multi_block_encrypt()
355 edges[i].ptr = blocks[i].c; in tls1_1_multi_block_encrypt()
356 edges[i].blocks = 1; in tls1_1_multi_block_encrypt()
362 for (i = 0; i < x4; i++) { in tls1_1_multi_block_encrypt()
363 unsigned int len = (i == (x4 - 1) ? last : frag), pad, j; in tls1_1_multi_block_encrypt()
366 memcpy(ciph_d[i].out, ciph_d[i].inp, len - processed); in tls1_1_multi_block_encrypt()
367 ciph_d[i].inp = ciph_d[i].out; in tls1_1_multi_block_encrypt()
372 PUTU32(out + 0, ctx->A[i]); in tls1_1_multi_block_encrypt()
373 PUTU32(out + 4, ctx->B[i]); in tls1_1_multi_block_encrypt()
374 PUTU32(out + 8, ctx->C[i]); in tls1_1_multi_block_encrypt()
375 PUTU32(out + 12, ctx->D[i]); in tls1_1_multi_block_encrypt()
376 PUTU32(out + 16, ctx->E[i]); in tls1_1_multi_block_encrypt()
386 ciph_d[i].blocks = (len - processed) / 16; in tls1_1_multi_block_encrypt()
490 size_t inp_len, mask, j, i; in aesni_cbc_hmac_sha1_cipher() local
637 for (i = res; i < SHA_CBLOCK; i++, j++) in aesni_cbc_hmac_sha1_cipher()
638 data->c[i] = 0; in aesni_cbc_hmac_sha1_cipher()
670 for (i = 0; i < 5; i++) { in aesni_cbc_hmac_sha1_cipher()
671 res = pmac->u[i]; in aesni_cbc_hmac_sha1_cipher()
672 pmac->c[4 * i + 0] = (unsigned char)(res >> 24); in aesni_cbc_hmac_sha1_cipher()
673 pmac->c[4 * i + 1] = (unsigned char)(res >> 16); in aesni_cbc_hmac_sha1_cipher()
674 pmac->c[4 * i + 2] = (unsigned char)(res >> 8); in aesni_cbc_hmac_sha1_cipher()
675 pmac->c[4 * i + 3] = (unsigned char)res; in aesni_cbc_hmac_sha1_cipher()
712 for (res = 0, i = 0, j = 0; j < maxpad + SHA_DIGEST_LENGTH; j++) { in aesni_cbc_hmac_sha1_cipher()
719 res |= (c ^ pmac->c[i]) & cmask; in aesni_cbc_hmac_sha1_cipher()
720 i += 1 & cmask; in aesni_cbc_hmac_sha1_cipher()
727 for (res = 0, i = 0; i < SHA_DIGEST_LENGTH; i++) in aesni_cbc_hmac_sha1_cipher()
728 res |= out[i] ^ pmac->c[i]; in aesni_cbc_hmac_sha1_cipher()
735 for (res = 0, i = 0; i < pad; i++) in aesni_cbc_hmac_sha1_cipher()
736 res |= out[i] ^ pad; in aesni_cbc_hmac_sha1_cipher()
786 unsigned int i; in aesni_cbc_hmac_sha1_ctrl() local
799 for (i = 0; i < sizeof(hmac_key); i++) in aesni_cbc_hmac_sha1_ctrl()
800 hmac_key[i] ^= 0x36; /* ipad */ in aesni_cbc_hmac_sha1_ctrl()
804 for (i = 0; i < sizeof(hmac_key); i++) in aesni_cbc_hmac_sha1_ctrl()
805 hmac_key[i] ^= 0x36 ^ 0x5c; /* opad */ in aesni_cbc_hmac_sha1_ctrl()