Lines Matching refs:blocks
36 void aesni_cbc_sha1_enc(const void *inp, void *out, size_t blocks,
108 int blocks; member
114 int blocks; member
135 } blocks[8]; in tls1_multi_block_encrypt() local
146 if (RAND_bytes_ex(ctx->base.libctx, (IVs = blocks[0].c), 16 * x4, 0) <= 0) in tls1_multi_block_encrypt()
178 memcpy(blocks[0].c, sctx->md.data, 8); in tls1_multi_block_encrypt()
179 seqnum = BSWAP8(blocks[0].q[0]); in tls1_multi_block_encrypt()
195 blocks[i].q[0] = BSWAP8(seqnum + i); 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()
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()
232 edges[i].blocks = MAXCHUNKSIZE / 64; in tls1_multi_block_encrypt()
233 ciph_d[i].blocks = MAXCHUNKSIZE / 16; 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()
245 ciph_d[i].blocks = MAXCHUNKSIZE / 16; in tls1_multi_block_encrypt()
256 memset(blocks, 0, sizeof(blocks)); in tls1_multi_block_encrypt()
259 off = hash_d[i].blocks * 64; 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()
288 memset(blocks, 0, sizeof(blocks)); in tls1_multi_block_encrypt()
291 blocks[i].d[0] = BSWAP4(mctx->A[i]); in tls1_multi_block_encrypt()
293 blocks[i].d[1] = BSWAP4(mctx->B[i]); in tls1_multi_block_encrypt()
295 blocks[i].d[2] = BSWAP4(mctx->C[i]); in tls1_multi_block_encrypt()
297 blocks[i].d[3] = BSWAP4(mctx->D[i]); in tls1_multi_block_encrypt()
299 blocks[i].d[4] = BSWAP4(mctx->E[i]); 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()
306 PUTU32(blocks[i].c + 4, mctx->B[i]); in tls1_multi_block_encrypt()
308 PUTU32(blocks[i].c + 8, mctx->C[i]); in tls1_multi_block_encrypt()
310 PUTU32(blocks[i].c + 12, mctx->D[i]); in tls1_multi_block_encrypt()
312 PUTU32(blocks[i].c + 16, mctx->E[i]); 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()
348 ciph_d[i].blocks = (len - processed) / 16; in tls1_multi_block_encrypt()
364 OPENSSL_cleanse(blocks, sizeof(blocks)); in tls1_multi_block_encrypt()
381 size_t aes_off = 0, blocks; in aesni_cbc_hmac_sha1_cipher() local
400 && (blocks = (plen - (sha_off + iv)) / SHA_CBLOCK)) { in aesni_cbc_hmac_sha1_cipher()
403 aesni_cbc_sha1_enc(in, out, blocks, &ctx->ks, ctx->base.iv, in aesni_cbc_hmac_sha1_cipher()
405 blocks *= SHA_CBLOCK; in aesni_cbc_hmac_sha1_cipher()
406 aes_off += blocks; in aesni_cbc_hmac_sha1_cipher()
407 sha_off += blocks; in aesni_cbc_hmac_sha1_cipher()
408 sctx->md.Nh += blocks >> 29; in aesni_cbc_hmac_sha1_cipher()
409 sctx->md.Nl += blocks <<= 3; in aesni_cbc_hmac_sha1_cipher()
410 if (sctx->md.Nl < (unsigned int)blocks) in aesni_cbc_hmac_sha1_cipher()