Lines Matching refs:blocks
36 int aesni_cbc_sha256_enc(const void *inp, void *out, size_t blocks,
112 int blocks; member
118 int blocks; member
139 } blocks[8]; in tls1_multi_block_encrypt() local
150 if (RAND_bytes_ex(ctx->base.libctx, (IVs = blocks[0].c), 16 * x4, 0) <= 0) in tls1_multi_block_encrypt()
182 memcpy(blocks[0].c, sctx->md.data, 8); in tls1_multi_block_encrypt()
183 seqnum = BSWAP8(blocks[0].q[0]); in tls1_multi_block_encrypt()
203 blocks[i].q[0] = BSWAP8(seqnum + i); in tls1_multi_block_encrypt()
206 blocks[i].c[j] = ((u8 *)sctx->md.data)[j] + carry; in tls1_multi_block_encrypt()
207 carry = (blocks[i].c[j] - carry) >> (sizeof(carry) * 8 - 1); in tls1_multi_block_encrypt()
210 blocks[i].c[8] = ((u8 *)sctx->md.data)[8]; in tls1_multi_block_encrypt()
211 blocks[i].c[9] = ((u8 *)sctx->md.data)[9]; in tls1_multi_block_encrypt()
212 blocks[i].c[10] = ((u8 *)sctx->md.data)[10]; in tls1_multi_block_encrypt()
214 blocks[i].c[11] = (u8)(len >> 8); in tls1_multi_block_encrypt()
215 blocks[i].c[12] = (u8)(len); in tls1_multi_block_encrypt()
217 memcpy(blocks[i].c + 13, hash_d[i].ptr, 64 - 13); in tls1_multi_block_encrypt()
219 hash_d[i].blocks = (len - (64 - 13)) / 64; in tls1_multi_block_encrypt()
221 edges[i].ptr = blocks[i].c; in tls1_multi_block_encrypt()
222 edges[i].blocks = 1; in tls1_multi_block_encrypt()
240 edges[i].blocks = MAXCHUNKSIZE / 64; in tls1_multi_block_encrypt()
241 ciph_d[i].blocks = MAXCHUNKSIZE / 16; in tls1_multi_block_encrypt()
249 hash_d[i].blocks -= MAXCHUNKSIZE / 64; in tls1_multi_block_encrypt()
250 edges[i].blocks = MAXCHUNKSIZE / 64; in tls1_multi_block_encrypt()
253 ciph_d[i].blocks = MAXCHUNKSIZE / 16; in tls1_multi_block_encrypt()
264 memset(blocks, 0, sizeof(blocks)); in tls1_multi_block_encrypt()
267 off = hash_d[i].blocks * 64; in tls1_multi_block_encrypt()
271 memcpy(blocks[i].c, ptr, off); in tls1_multi_block_encrypt()
272 blocks[i].c[off] = 0x80; in tls1_multi_block_encrypt()
277 blocks[i].d[15] = BSWAP4(len); in tls1_multi_block_encrypt()
279 PUTU32(blocks[i].c + 60, len); in tls1_multi_block_encrypt()
281 edges[i].blocks = 1; in tls1_multi_block_encrypt()
284 blocks[i].d[31] = BSWAP4(len); in tls1_multi_block_encrypt()
286 PUTU32(blocks[i].c + 124, len); in tls1_multi_block_encrypt()
288 edges[i].blocks = 2; in tls1_multi_block_encrypt()
290 edges[i].ptr = blocks[i].c; in tls1_multi_block_encrypt()
296 memset(blocks, 0, sizeof(blocks)); in tls1_multi_block_encrypt()
299 blocks[i].d[0] = BSWAP4(mctx->A[i]); in tls1_multi_block_encrypt()
301 blocks[i].d[1] = BSWAP4(mctx->B[i]); in tls1_multi_block_encrypt()
303 blocks[i].d[2] = BSWAP4(mctx->C[i]); in tls1_multi_block_encrypt()
305 blocks[i].d[3] = BSWAP4(mctx->D[i]); in tls1_multi_block_encrypt()
307 blocks[i].d[4] = BSWAP4(mctx->E[i]); in tls1_multi_block_encrypt()
309 blocks[i].d[5] = BSWAP4(mctx->F[i]); in tls1_multi_block_encrypt()
311 blocks[i].d[6] = BSWAP4(mctx->G[i]); in tls1_multi_block_encrypt()
313 blocks[i].d[7] = BSWAP4(mctx->H[i]); in tls1_multi_block_encrypt()
315 blocks[i].c[32] = 0x80; in tls1_multi_block_encrypt()
316 blocks[i].d[15] = BSWAP4((64 + 32) * 8); in tls1_multi_block_encrypt()
318 PUTU32(blocks[i].c + 0, mctx->A[i]); in tls1_multi_block_encrypt()
320 PUTU32(blocks[i].c + 4, mctx->B[i]); in tls1_multi_block_encrypt()
322 PUTU32(blocks[i].c + 8, mctx->C[i]); in tls1_multi_block_encrypt()
324 PUTU32(blocks[i].c + 12, mctx->D[i]); in tls1_multi_block_encrypt()
326 PUTU32(blocks[i].c + 16, mctx->E[i]); in tls1_multi_block_encrypt()
328 PUTU32(blocks[i].c + 20, mctx->F[i]); in tls1_multi_block_encrypt()
330 PUTU32(blocks[i].c + 24, mctx->G[i]); in tls1_multi_block_encrypt()
332 PUTU32(blocks[i].c + 28, mctx->H[i]); in tls1_multi_block_encrypt()
334 blocks[i].c[32] = 0x80; in tls1_multi_block_encrypt()
335 PUTU32(blocks[i].c + 60, (64 + 32) * 8); in tls1_multi_block_encrypt()
337 edges[i].ptr = blocks[i].c; in tls1_multi_block_encrypt()
338 edges[i].blocks = 1; in tls1_multi_block_encrypt()
371 ciph_d[i].blocks = (len - processed) / 16; in tls1_multi_block_encrypt()
387 OPENSSL_cleanse(blocks, sizeof(blocks)); in tls1_multi_block_encrypt()
404 size_t aes_off = 0, blocks; in aesni_cbc_hmac_sha256_cipher() local
437 (blocks = (plen - (sha_off + iv)) / SHA256_CBLOCK)) { in aesni_cbc_hmac_sha256_cipher()
440 (void)aesni_cbc_sha256_enc(in, out, blocks, &ctx->ks, in aesni_cbc_hmac_sha256_cipher()
443 blocks *= SHA256_CBLOCK; in aesni_cbc_hmac_sha256_cipher()
444 aes_off += blocks; in aesni_cbc_hmac_sha256_cipher()
445 sha_off += blocks; in aesni_cbc_hmac_sha256_cipher()
446 sctx->md.Nh += blocks >> 29; in aesni_cbc_hmac_sha256_cipher()
447 sctx->md.Nl += blocks <<= 3; in aesni_cbc_hmac_sha256_cipher()
448 if (sctx->md.Nl < (unsigned int)blocks) in aesni_cbc_hmac_sha256_cipher()