Lines Matching refs:i

137     unsigned int frag, last, packlen, i;  in tls1_multi_block_encrypt()  local
169 for (i = 1; i < x4; i++) { in tls1_multi_block_encrypt()
170 ciph_d[i].inp = hash_d[i].ptr = hash_d[i - 1].ptr + frag; in tls1_multi_block_encrypt()
171 ciph_d[i].out = ciph_d[i - 1].out + packlen; in tls1_multi_block_encrypt()
172 memcpy(ciph_d[i].out - 16, IVs, 16); in tls1_multi_block_encrypt()
173 memcpy(ciph_d[i].iv, IVs, 16); in tls1_multi_block_encrypt()
181 for (i = 0; i < x4; i++) { in tls1_multi_block_encrypt()
182 unsigned int len = (i == (x4 - 1) ? last : frag); in tls1_multi_block_encrypt()
187 mctx->A[i] = sctx->md.h0; in tls1_multi_block_encrypt()
188 mctx->B[i] = sctx->md.h1; in tls1_multi_block_encrypt()
189 mctx->C[i] = sctx->md.h2; in tls1_multi_block_encrypt()
190 mctx->D[i] = sctx->md.h3; in tls1_multi_block_encrypt()
191 mctx->E[i] = sctx->md.h4; in tls1_multi_block_encrypt()
195 blocks[i].q[0] = BSWAP8(seqnum + i); in tls1_multi_block_encrypt()
197 for (carry = i, j = 8; j--;) { in tls1_multi_block_encrypt()
198 blocks[i].c[j] = ((u8 *)sctx->md.data)[j] + carry; in tls1_multi_block_encrypt()
199 carry = (blocks[i].c[j] - carry) >> (sizeof(carry) * 8 - 1); in tls1_multi_block_encrypt()
202 blocks[i].c[8] = ((u8 *)sctx->md.data)[8]; in tls1_multi_block_encrypt()
203 blocks[i].c[9] = ((u8 *)sctx->md.data)[9]; in tls1_multi_block_encrypt()
204 blocks[i].c[10] = ((u8 *)sctx->md.data)[10]; in tls1_multi_block_encrypt()
206 blocks[i].c[11] = (u8)(len >> 8); in tls1_multi_block_encrypt()
207 blocks[i].c[12] = (u8)(len); in tls1_multi_block_encrypt()
209 memcpy(blocks[i].c + 13, hash_d[i].ptr, 64 - 13); in tls1_multi_block_encrypt()
210 hash_d[i].ptr += 64 - 13; in tls1_multi_block_encrypt()
211 hash_d[i].blocks = (len - (64 - 13)) / 64; in tls1_multi_block_encrypt()
213 edges[i].ptr = blocks[i].c; in tls1_multi_block_encrypt()
214 edges[i].blocks = 1; in tls1_multi_block_encrypt()
230 for (i = 0; i < x4; i++) { in tls1_multi_block_encrypt()
231 edges[i].ptr = hash_d[i].ptr; in tls1_multi_block_encrypt()
232 edges[i].blocks = MAXCHUNKSIZE / 64; in tls1_multi_block_encrypt()
233 ciph_d[i].blocks = MAXCHUNKSIZE / 16; in tls1_multi_block_encrypt()
239 for (i = 0; i < x4; i++) { in tls1_multi_block_encrypt()
240 edges[i].ptr = hash_d[i].ptr += MAXCHUNKSIZE; in tls1_multi_block_encrypt()
241 hash_d[i].blocks -= MAXCHUNKSIZE / 64; in tls1_multi_block_encrypt()
242 edges[i].blocks = MAXCHUNKSIZE / 64; in tls1_multi_block_encrypt()
243 ciph_d[i].inp += MAXCHUNKSIZE; in tls1_multi_block_encrypt()
244 ciph_d[i].out += MAXCHUNKSIZE; in tls1_multi_block_encrypt()
245 ciph_d[i].blocks = MAXCHUNKSIZE / 16; in tls1_multi_block_encrypt()
246 memcpy(ciph_d[i].iv, ciph_d[i].out - 16, 16); in tls1_multi_block_encrypt()
257 for (i = 0; i < x4; i++) { in tls1_multi_block_encrypt()
258 unsigned int len = (i == (x4 - 1) ? last : frag), in tls1_multi_block_encrypt()
259 off = hash_d[i].blocks * 64; in tls1_multi_block_encrypt()
260 const unsigned char *ptr = hash_d[i].ptr + off; in tls1_multi_block_encrypt()
263 memcpy(blocks[i].c, ptr, off); in tls1_multi_block_encrypt()
264 blocks[i].c[off] = 0x80; in tls1_multi_block_encrypt()
269 blocks[i].d[15] = BSWAP4(len); in tls1_multi_block_encrypt()
271 PUTU32(blocks[i].c + 60, len); in tls1_multi_block_encrypt()
273 edges[i].blocks = 1; in tls1_multi_block_encrypt()
276 blocks[i].d[31] = BSWAP4(len); in tls1_multi_block_encrypt()
278 PUTU32(blocks[i].c + 124, len); in tls1_multi_block_encrypt()
280 edges[i].blocks = 2; in tls1_multi_block_encrypt()
282 edges[i].ptr = blocks[i].c; in tls1_multi_block_encrypt()
289 for (i = 0; i < x4; i++) { in tls1_multi_block_encrypt()
291 blocks[i].d[0] = BSWAP4(mctx->A[i]); in tls1_multi_block_encrypt()
292 mctx->A[i] = sctx->tail.h0; in tls1_multi_block_encrypt()
293 blocks[i].d[1] = BSWAP4(mctx->B[i]); in tls1_multi_block_encrypt()
294 mctx->B[i] = sctx->tail.h1; in tls1_multi_block_encrypt()
295 blocks[i].d[2] = BSWAP4(mctx->C[i]); in tls1_multi_block_encrypt()
296 mctx->C[i] = sctx->tail.h2; in tls1_multi_block_encrypt()
297 blocks[i].d[3] = BSWAP4(mctx->D[i]); in tls1_multi_block_encrypt()
298 mctx->D[i] = sctx->tail.h3; in tls1_multi_block_encrypt()
299 blocks[i].d[4] = BSWAP4(mctx->E[i]); in tls1_multi_block_encrypt()
300 mctx->E[i] = sctx->tail.h4; in tls1_multi_block_encrypt()
301 blocks[i].c[20] = 0x80; in tls1_multi_block_encrypt()
302 blocks[i].d[15] = BSWAP4((64 + 20) * 8); in tls1_multi_block_encrypt()
304 PUTU32(blocks[i].c + 0, mctx->A[i]); in tls1_multi_block_encrypt()
305 mctx->A[i] = sctx->tail.h0; in tls1_multi_block_encrypt()
306 PUTU32(blocks[i].c + 4, mctx->B[i]); in tls1_multi_block_encrypt()
307 mctx->B[i] = sctx->tail.h1; in tls1_multi_block_encrypt()
308 PUTU32(blocks[i].c + 8, mctx->C[i]); in tls1_multi_block_encrypt()
309 mctx->C[i] = sctx->tail.h2; in tls1_multi_block_encrypt()
310 PUTU32(blocks[i].c + 12, mctx->D[i]); in tls1_multi_block_encrypt()
311 mctx->D[i] = sctx->tail.h3; in tls1_multi_block_encrypt()
312 PUTU32(blocks[i].c + 16, mctx->E[i]); in tls1_multi_block_encrypt()
313 mctx->E[i] = sctx->tail.h4; in tls1_multi_block_encrypt()
314 blocks[i].c[20] = 0x80; in tls1_multi_block_encrypt()
315 PUTU32(blocks[i].c + 60, (64 + 20) * 8); in tls1_multi_block_encrypt()
317 edges[i].ptr = blocks[i].c; in tls1_multi_block_encrypt()
318 edges[i].blocks = 1; in tls1_multi_block_encrypt()
324 for (i = 0; i < x4; i++) { in tls1_multi_block_encrypt()
325 unsigned int len = (i == (x4 - 1) ? last : frag), pad, j; in tls1_multi_block_encrypt()
328 memcpy(ciph_d[i].out, ciph_d[i].inp, len - processed); in tls1_multi_block_encrypt()
329 ciph_d[i].inp = ciph_d[i].out; in tls1_multi_block_encrypt()
334 PUTU32(out + 0, mctx->A[i]); in tls1_multi_block_encrypt()
335 PUTU32(out + 4, mctx->B[i]); in tls1_multi_block_encrypt()
336 PUTU32(out + 8, mctx->C[i]); in tls1_multi_block_encrypt()
337 PUTU32(out + 12, mctx->D[i]); in tls1_multi_block_encrypt()
338 PUTU32(out + 16, mctx->E[i]); in tls1_multi_block_encrypt()
348 ciph_d[i].blocks = (len - processed) / 16; in tls1_multi_block_encrypt()
449 size_t inp_len, mask, j, i; in aesni_cbc_hmac_sha1_cipher() local
551 for (i = res; i < SHA_CBLOCK; i++, j++) in aesni_cbc_hmac_sha1_cipher()
552 data->c[i] = 0; in aesni_cbc_hmac_sha1_cipher()
584 for (i = 0; i < 5; i++) { in aesni_cbc_hmac_sha1_cipher()
585 res = pmac->u[i]; in aesni_cbc_hmac_sha1_cipher()
586 pmac->c[4 * i + 0] = (unsigned char)(res >> 24); in aesni_cbc_hmac_sha1_cipher()
587 pmac->c[4 * i + 1] = (unsigned char)(res >> 16); in aesni_cbc_hmac_sha1_cipher()
588 pmac->c[4 * i + 2] = (unsigned char)(res >> 8); in aesni_cbc_hmac_sha1_cipher()
589 pmac->c[4 * i + 3] = (unsigned char)res; in aesni_cbc_hmac_sha1_cipher()
606 for (res = 0, i = 0, j = 0; j < maxpad + SHA_DIGEST_LENGTH; j++) { in aesni_cbc_hmac_sha1_cipher()
613 res |= (c ^ pmac->c[i]) & cmask; in aesni_cbc_hmac_sha1_cipher()
614 i += 1 & cmask; in aesni_cbc_hmac_sha1_cipher()
636 unsigned int i; in aesni_cbc_hmac_sha1_set_mac_key() local
649 for (i = 0; i < sizeof(hmac_key); i++) in aesni_cbc_hmac_sha1_set_mac_key()
650 hmac_key[i] ^= 0x36; /* ipad */ in aesni_cbc_hmac_sha1_set_mac_key()
654 for (i = 0; i < sizeof(hmac_key); i++) in aesni_cbc_hmac_sha1_set_mac_key()
655 hmac_key[i] ^= 0x36 ^ 0x5c; /* opad */ in aesni_cbc_hmac_sha1_set_mac_key()