Lines Matching refs:blocks

59 void aesni_cbc_sha1_enc(const void *inp, void *out, size_t blocks,
63 void aesni256_cbc_sha1_dec(const void *inp, void *out, size_t blocks,
146 int blocks; member
154 int blocks; member
172 } blocks[8]; in tls1_1_multi_block_encrypt() local
183 if (RAND_bytes((IVs = blocks[0].c), 16 * x4) <= 0) in tls1_1_multi_block_encrypt()
215 memcpy(blocks[0].c, key->md.data, 8); in tls1_1_multi_block_encrypt()
216 seqnum = BSWAP8(blocks[0].q[0]); in tls1_1_multi_block_encrypt()
232 blocks[i].q[0] = BSWAP8(seqnum + i); in tls1_1_multi_block_encrypt()
235 blocks[i].c[j] = ((u8 *)key->md.data)[j] + carry; in tls1_1_multi_block_encrypt()
236 carry = (blocks[i].c[j] - carry) >> (sizeof(carry) * 8 - 1); in tls1_1_multi_block_encrypt()
239 blocks[i].c[8] = ((u8 *)key->md.data)[8]; in tls1_1_multi_block_encrypt()
240 blocks[i].c[9] = ((u8 *)key->md.data)[9]; in tls1_1_multi_block_encrypt()
241 blocks[i].c[10] = ((u8 *)key->md.data)[10]; in tls1_1_multi_block_encrypt()
243 blocks[i].c[11] = (u8)(len >> 8); in tls1_1_multi_block_encrypt()
244 blocks[i].c[12] = (u8)(len); in tls1_1_multi_block_encrypt()
246 memcpy(blocks[i].c + 13, hash_d[i].ptr, 64 - 13); in tls1_1_multi_block_encrypt()
248 hash_d[i].blocks = (len - (64 - 13)) / 64; in tls1_1_multi_block_encrypt()
250 edges[i].ptr = blocks[i].c; in tls1_1_multi_block_encrypt()
251 edges[i].blocks = 1; in tls1_1_multi_block_encrypt()
269 edges[i].blocks = MAXCHUNKSIZE / 64; in tls1_1_multi_block_encrypt()
270 ciph_d[i].blocks = MAXCHUNKSIZE / 16; in tls1_1_multi_block_encrypt()
278 hash_d[i].blocks -= MAXCHUNKSIZE / 64; in tls1_1_multi_block_encrypt()
279 edges[i].blocks = MAXCHUNKSIZE / 64; in tls1_1_multi_block_encrypt()
282 ciph_d[i].blocks = MAXCHUNKSIZE / 16; in tls1_1_multi_block_encrypt()
293 memset(blocks, 0, sizeof(blocks)); in tls1_1_multi_block_encrypt()
296 off = hash_d[i].blocks * 64; in tls1_1_multi_block_encrypt()
300 memcpy(blocks[i].c, ptr, off); in tls1_1_multi_block_encrypt()
301 blocks[i].c[off] = 0x80; in tls1_1_multi_block_encrypt()
306 blocks[i].d[15] = BSWAP4(len); in tls1_1_multi_block_encrypt()
308 PUTU32(blocks[i].c + 60, len); in tls1_1_multi_block_encrypt()
310 edges[i].blocks = 1; in tls1_1_multi_block_encrypt()
313 blocks[i].d[31] = BSWAP4(len); in tls1_1_multi_block_encrypt()
315 PUTU32(blocks[i].c + 124, len); in tls1_1_multi_block_encrypt()
317 edges[i].blocks = 2; in tls1_1_multi_block_encrypt()
319 edges[i].ptr = blocks[i].c; in tls1_1_multi_block_encrypt()
325 memset(blocks, 0, sizeof(blocks)); in tls1_1_multi_block_encrypt()
328 blocks[i].d[0] = BSWAP4(ctx->A[i]); in tls1_1_multi_block_encrypt()
330 blocks[i].d[1] = BSWAP4(ctx->B[i]); in tls1_1_multi_block_encrypt()
332 blocks[i].d[2] = BSWAP4(ctx->C[i]); in tls1_1_multi_block_encrypt()
334 blocks[i].d[3] = BSWAP4(ctx->D[i]); in tls1_1_multi_block_encrypt()
336 blocks[i].d[4] = BSWAP4(ctx->E[i]); in tls1_1_multi_block_encrypt()
338 blocks[i].c[20] = 0x80; in tls1_1_multi_block_encrypt()
339 blocks[i].d[15] = BSWAP4((64 + 20) * 8); in tls1_1_multi_block_encrypt()
341 PUTU32(blocks[i].c + 0, ctx->A[i]); in tls1_1_multi_block_encrypt()
343 PUTU32(blocks[i].c + 4, ctx->B[i]); in tls1_1_multi_block_encrypt()
345 PUTU32(blocks[i].c + 8, ctx->C[i]); in tls1_1_multi_block_encrypt()
347 PUTU32(blocks[i].c + 12, ctx->D[i]); in tls1_1_multi_block_encrypt()
349 PUTU32(blocks[i].c + 16, ctx->E[i]); in tls1_1_multi_block_encrypt()
351 blocks[i].c[20] = 0x80; in tls1_1_multi_block_encrypt()
352 PUTU32(blocks[i].c + 60, (64 + 20) * 8); in tls1_1_multi_block_encrypt()
354 edges[i].ptr = blocks[i].c; in tls1_1_multi_block_encrypt()
355 edges[i].blocks = 1; in tls1_1_multi_block_encrypt()
385 ciph_d[i].blocks = (len - processed) / 16; in tls1_1_multi_block_encrypt()
401 OPENSSL_cleanse(blocks, sizeof(blocks)); in tls1_1_multi_block_encrypt()
417 size_t aes_off = 0, blocks; in aesni_cbc_hmac_sha1_cipher() local
439 && (blocks = (plen - (sha_off + iv)) / SHA_CBLOCK)) { in aesni_cbc_hmac_sha1_cipher()
442 aesni_cbc_sha1_enc(in, out, blocks, &key->ks, ctx->iv, in aesni_cbc_hmac_sha1_cipher()
444 blocks *= SHA_CBLOCK; in aesni_cbc_hmac_sha1_cipher()
445 aes_off += blocks; in aesni_cbc_hmac_sha1_cipher()
446 sha_off += blocks; in aesni_cbc_hmac_sha1_cipher()
447 key->md.Nh += blocks >> 29; in aesni_cbc_hmac_sha1_cipher()
448 key->md.Nl += blocks <<= 3; in aesni_cbc_hmac_sha1_cipher()
449 if (key->md.Nl < (unsigned int)blocks) in aesni_cbc_hmac_sha1_cipher()
557 blocks = (len - (256 + 32 + SHA_CBLOCK)) / SHA_CBLOCK; in aesni_cbc_hmac_sha1_cipher()
558 aes_off = len - AES_BLOCK_SIZE - blocks * SHA_CBLOCK; in aesni_cbc_hmac_sha1_cipher()
565 out + aes_off, blocks, &key->ks, in aesni_cbc_hmac_sha1_cipher()
568 sha_off += blocks *= SHA_CBLOCK; in aesni_cbc_hmac_sha1_cipher()
573 key->md.Nl += (blocks << 3); /* at most 18 bits */ in aesni_cbc_hmac_sha1_cipher()
739 blocks = (len - 3 * SHA_CBLOCK) / SHA_CBLOCK; in aesni_cbc_hmac_sha1_cipher()
741 blocks = (len - 2 * SHA_CBLOCK) / SHA_CBLOCK; in aesni_cbc_hmac_sha1_cipher()
742 aes_off = len - blocks * SHA_CBLOCK; in aesni_cbc_hmac_sha1_cipher()
747 out + aes_off, blocks, &key->ks, in aesni_cbc_hmac_sha1_cipher()
750 sha_off += blocks *= SHA_CBLOCK; in aesni_cbc_hmac_sha1_cipher()
754 key->md.Nh += blocks >> 29; in aesni_cbc_hmac_sha1_cipher()
755 key->md.Nl += blocks <<= 3; in aesni_cbc_hmac_sha1_cipher()
756 if (key->md.Nl < (unsigned int)blocks) in aesni_cbc_hmac_sha1_cipher()