Lines Matching refs:blocks
59 int aesni_cbc_sha256_enc(const void *inp, void *out, size_t blocks,
141 int blocks; member
149 int blocks; member
167 } blocks[8]; in tls1_1_multi_block_encrypt() local
178 if (RAND_bytes((IVs = blocks[0].c), 16 * x4) <= 0) in tls1_1_multi_block_encrypt()
211 memcpy(blocks[0].c, key->md.data, 8); in tls1_1_multi_block_encrypt()
212 seqnum = BSWAP8(blocks[0].q[0]); in tls1_1_multi_block_encrypt()
231 blocks[i].q[0] = BSWAP8(seqnum + i); in tls1_1_multi_block_encrypt()
234 blocks[i].c[j] = ((u8 *)key->md.data)[j] + carry; in tls1_1_multi_block_encrypt()
235 carry = (blocks[i].c[j] - carry) >> (sizeof(carry) * 8 - 1); in tls1_1_multi_block_encrypt()
238 blocks[i].c[8] = ((u8 *)key->md.data)[8]; in tls1_1_multi_block_encrypt()
239 blocks[i].c[9] = ((u8 *)key->md.data)[9]; in tls1_1_multi_block_encrypt()
240 blocks[i].c[10] = ((u8 *)key->md.data)[10]; in tls1_1_multi_block_encrypt()
242 blocks[i].c[11] = (u8)(len >> 8); in tls1_1_multi_block_encrypt()
243 blocks[i].c[12] = (u8)(len); in tls1_1_multi_block_encrypt()
245 memcpy(blocks[i].c + 13, hash_d[i].ptr, 64 - 13); in tls1_1_multi_block_encrypt()
247 hash_d[i].blocks = (len - (64 - 13)) / 64; in tls1_1_multi_block_encrypt()
249 edges[i].ptr = blocks[i].c; in tls1_1_multi_block_encrypt()
250 edges[i].blocks = 1; in tls1_1_multi_block_encrypt()
268 edges[i].blocks = MAXCHUNKSIZE / 64; in tls1_1_multi_block_encrypt()
269 ciph_d[i].blocks = MAXCHUNKSIZE / 16; in tls1_1_multi_block_encrypt()
277 hash_d[i].blocks -= MAXCHUNKSIZE / 64; in tls1_1_multi_block_encrypt()
278 edges[i].blocks = MAXCHUNKSIZE / 64; in tls1_1_multi_block_encrypt()
281 ciph_d[i].blocks = MAXCHUNKSIZE / 16; in tls1_1_multi_block_encrypt()
292 memset(blocks, 0, sizeof(blocks)); in tls1_1_multi_block_encrypt()
295 off = hash_d[i].blocks * 64; in tls1_1_multi_block_encrypt()
299 memcpy(blocks[i].c, ptr, off); in tls1_1_multi_block_encrypt()
300 blocks[i].c[off] = 0x80; in tls1_1_multi_block_encrypt()
305 blocks[i].d[15] = BSWAP4(len); in tls1_1_multi_block_encrypt()
307 PUTU32(blocks[i].c + 60, len); in tls1_1_multi_block_encrypt()
309 edges[i].blocks = 1; in tls1_1_multi_block_encrypt()
312 blocks[i].d[31] = BSWAP4(len); in tls1_1_multi_block_encrypt()
314 PUTU32(blocks[i].c + 124, len); in tls1_1_multi_block_encrypt()
316 edges[i].blocks = 2; in tls1_1_multi_block_encrypt()
318 edges[i].ptr = blocks[i].c; in tls1_1_multi_block_encrypt()
324 memset(blocks, 0, sizeof(blocks)); in tls1_1_multi_block_encrypt()
327 blocks[i].d[0] = BSWAP4(ctx->A[i]); in tls1_1_multi_block_encrypt()
329 blocks[i].d[1] = BSWAP4(ctx->B[i]); in tls1_1_multi_block_encrypt()
331 blocks[i].d[2] = BSWAP4(ctx->C[i]); in tls1_1_multi_block_encrypt()
333 blocks[i].d[3] = BSWAP4(ctx->D[i]); in tls1_1_multi_block_encrypt()
335 blocks[i].d[4] = BSWAP4(ctx->E[i]); in tls1_1_multi_block_encrypt()
337 blocks[i].d[5] = BSWAP4(ctx->F[i]); in tls1_1_multi_block_encrypt()
339 blocks[i].d[6] = BSWAP4(ctx->G[i]); in tls1_1_multi_block_encrypt()
341 blocks[i].d[7] = BSWAP4(ctx->H[i]); in tls1_1_multi_block_encrypt()
343 blocks[i].c[32] = 0x80; in tls1_1_multi_block_encrypt()
344 blocks[i].d[15] = BSWAP4((64 + 32) * 8); in tls1_1_multi_block_encrypt()
346 PUTU32(blocks[i].c + 0, ctx->A[i]); in tls1_1_multi_block_encrypt()
348 PUTU32(blocks[i].c + 4, ctx->B[i]); in tls1_1_multi_block_encrypt()
350 PUTU32(blocks[i].c + 8, ctx->C[i]); in tls1_1_multi_block_encrypt()
352 PUTU32(blocks[i].c + 12, ctx->D[i]); in tls1_1_multi_block_encrypt()
354 PUTU32(blocks[i].c + 16, ctx->E[i]); in tls1_1_multi_block_encrypt()
356 PUTU32(blocks[i].c + 20, ctx->F[i]); in tls1_1_multi_block_encrypt()
358 PUTU32(blocks[i].c + 24, ctx->G[i]); in tls1_1_multi_block_encrypt()
360 PUTU32(blocks[i].c + 28, ctx->H[i]); in tls1_1_multi_block_encrypt()
362 blocks[i].c[32] = 0x80; in tls1_1_multi_block_encrypt()
363 PUTU32(blocks[i].c + 60, (64 + 32) * 8); in tls1_1_multi_block_encrypt()
365 edges[i].ptr = blocks[i].c; in tls1_1_multi_block_encrypt()
366 edges[i].blocks = 1; in tls1_1_multi_block_encrypt()
399 ciph_d[i].blocks = (len - processed) / 16; in tls1_1_multi_block_encrypt()
415 OPENSSL_cleanse(blocks, sizeof(blocks)); in tls1_1_multi_block_encrypt()
432 size_t aes_off = 0, blocks; in aesni_cbc_hmac_sha256_cipher() local
468 (blocks = (plen - (sha_off + iv)) / SHA256_CBLOCK)) { in aesni_cbc_hmac_sha256_cipher()
471 (void)aesni_cbc_sha256_enc(in, out, blocks, &key->ks, in aesni_cbc_hmac_sha256_cipher()
473 blocks *= SHA256_CBLOCK; in aesni_cbc_hmac_sha256_cipher()
474 aes_off += blocks; in aesni_cbc_hmac_sha256_cipher()
475 sha_off += blocks; in aesni_cbc_hmac_sha256_cipher()
476 key->md.Nh += blocks >> 29; in aesni_cbc_hmac_sha256_cipher()
477 key->md.Nl += blocks <<= 3; in aesni_cbc_hmac_sha256_cipher()
478 if (key->md.Nl < (unsigned int)blocks) in aesni_cbc_hmac_sha256_cipher()