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,
147 int blocks; member
155 int blocks; member
173 } blocks[8]; in tls1_1_multi_block_encrypt() local
184 if (RAND_bytes((IVs = blocks[0].c), 16 * x4) <= 0) in tls1_1_multi_block_encrypt()
216 memcpy(blocks[0].c, key->md.data, 8); in tls1_1_multi_block_encrypt()
217 seqnum = BSWAP8(blocks[0].q[0]); in tls1_1_multi_block_encrypt()
233 blocks[i].q[0] = BSWAP8(seqnum + i); in tls1_1_multi_block_encrypt()
236 blocks[i].c[j] = ((u8 *)key->md.data)[j] + carry; in tls1_1_multi_block_encrypt()
237 carry = (blocks[i].c[j] - carry) >> (sizeof(carry) * 8 - 1); in tls1_1_multi_block_encrypt()
240 blocks[i].c[8] = ((u8 *)key->md.data)[8]; in tls1_1_multi_block_encrypt()
241 blocks[i].c[9] = ((u8 *)key->md.data)[9]; in tls1_1_multi_block_encrypt()
242 blocks[i].c[10] = ((u8 *)key->md.data)[10]; in tls1_1_multi_block_encrypt()
244 blocks[i].c[11] = (u8)(len >> 8); in tls1_1_multi_block_encrypt()
245 blocks[i].c[12] = (u8)(len); in tls1_1_multi_block_encrypt()
247 memcpy(blocks[i].c + 13, hash_d[i].ptr, 64 - 13); in tls1_1_multi_block_encrypt()
249 hash_d[i].blocks = (len - (64 - 13)) / 64; in tls1_1_multi_block_encrypt()
251 edges[i].ptr = blocks[i].c; in tls1_1_multi_block_encrypt()
252 edges[i].blocks = 1; in tls1_1_multi_block_encrypt()
270 edges[i].blocks = MAXCHUNKSIZE / 64; in tls1_1_multi_block_encrypt()
271 ciph_d[i].blocks = MAXCHUNKSIZE / 16; in tls1_1_multi_block_encrypt()
279 hash_d[i].blocks -= MAXCHUNKSIZE / 64; in tls1_1_multi_block_encrypt()
280 edges[i].blocks = MAXCHUNKSIZE / 64; in tls1_1_multi_block_encrypt()
283 ciph_d[i].blocks = MAXCHUNKSIZE / 16; in tls1_1_multi_block_encrypt()
294 memset(blocks, 0, sizeof(blocks)); in tls1_1_multi_block_encrypt()
297 off = hash_d[i].blocks * 64; in tls1_1_multi_block_encrypt()
301 memcpy(blocks[i].c, ptr, off); in tls1_1_multi_block_encrypt()
302 blocks[i].c[off] = 0x80; in tls1_1_multi_block_encrypt()
307 blocks[i].d[15] = BSWAP4(len); in tls1_1_multi_block_encrypt()
309 PUTU32(blocks[i].c + 60, len); in tls1_1_multi_block_encrypt()
311 edges[i].blocks = 1; in tls1_1_multi_block_encrypt()
314 blocks[i].d[31] = BSWAP4(len); in tls1_1_multi_block_encrypt()
316 PUTU32(blocks[i].c + 124, len); in tls1_1_multi_block_encrypt()
318 edges[i].blocks = 2; in tls1_1_multi_block_encrypt()
320 edges[i].ptr = blocks[i].c; in tls1_1_multi_block_encrypt()
326 memset(blocks, 0, sizeof(blocks)); in tls1_1_multi_block_encrypt()
329 blocks[i].d[0] = BSWAP4(ctx->A[i]); in tls1_1_multi_block_encrypt()
331 blocks[i].d[1] = BSWAP4(ctx->B[i]); in tls1_1_multi_block_encrypt()
333 blocks[i].d[2] = BSWAP4(ctx->C[i]); in tls1_1_multi_block_encrypt()
335 blocks[i].d[3] = BSWAP4(ctx->D[i]); in tls1_1_multi_block_encrypt()
337 blocks[i].d[4] = BSWAP4(ctx->E[i]); in tls1_1_multi_block_encrypt()
339 blocks[i].c[20] = 0x80; in tls1_1_multi_block_encrypt()
340 blocks[i].d[15] = BSWAP4((64 + 20) * 8); in tls1_1_multi_block_encrypt()
342 PUTU32(blocks[i].c + 0, ctx->A[i]); in tls1_1_multi_block_encrypt()
344 PUTU32(blocks[i].c + 4, ctx->B[i]); in tls1_1_multi_block_encrypt()
346 PUTU32(blocks[i].c + 8, ctx->C[i]); in tls1_1_multi_block_encrypt()
348 PUTU32(blocks[i].c + 12, ctx->D[i]); in tls1_1_multi_block_encrypt()
350 PUTU32(blocks[i].c + 16, ctx->E[i]); in tls1_1_multi_block_encrypt()
352 blocks[i].c[20] = 0x80; in tls1_1_multi_block_encrypt()
353 PUTU32(blocks[i].c + 60, (64 + 20) * 8); in tls1_1_multi_block_encrypt()
355 edges[i].ptr = blocks[i].c; in tls1_1_multi_block_encrypt()
356 edges[i].blocks = 1; in tls1_1_multi_block_encrypt()
386 ciph_d[i].blocks = (len - processed) / 16; in tls1_1_multi_block_encrypt()
402 OPENSSL_cleanse(blocks, sizeof(blocks)); in tls1_1_multi_block_encrypt()
418 size_t aes_off = 0, blocks; in aesni_cbc_hmac_sha1_cipher() local
440 && (blocks = (plen - (sha_off + iv)) / SHA_CBLOCK)) { in aesni_cbc_hmac_sha1_cipher()
443 aesni_cbc_sha1_enc(in, out, blocks, &key->ks, ctx->iv, in aesni_cbc_hmac_sha1_cipher()
445 blocks *= SHA_CBLOCK; in aesni_cbc_hmac_sha1_cipher()
446 aes_off += blocks; in aesni_cbc_hmac_sha1_cipher()
447 sha_off += blocks; in aesni_cbc_hmac_sha1_cipher()
448 key->md.Nh += blocks >> 29; in aesni_cbc_hmac_sha1_cipher()
449 key->md.Nl += blocks <<= 3; in aesni_cbc_hmac_sha1_cipher()
450 if (key->md.Nl < (unsigned int)blocks) in aesni_cbc_hmac_sha1_cipher()
564 blocks = (len - (256 + 32 + SHA_CBLOCK)) / SHA_CBLOCK; in aesni_cbc_hmac_sha1_cipher()
565 aes_off = len - AES_BLOCK_SIZE - blocks * SHA_CBLOCK; in aesni_cbc_hmac_sha1_cipher()
572 out + aes_off, blocks, &key->ks, in aesni_cbc_hmac_sha1_cipher()
575 sha_off += blocks *= SHA_CBLOCK; in aesni_cbc_hmac_sha1_cipher()
580 key->md.Nl += (blocks << 3); /* at most 18 bits */ in aesni_cbc_hmac_sha1_cipher()
746 blocks = (len - 3 * SHA_CBLOCK) / SHA_CBLOCK; in aesni_cbc_hmac_sha1_cipher()
748 blocks = (len - 2 * SHA_CBLOCK) / SHA_CBLOCK; in aesni_cbc_hmac_sha1_cipher()
749 aes_off = len - blocks * SHA_CBLOCK; in aesni_cbc_hmac_sha1_cipher()
754 out + aes_off, blocks, &key->ks, in aesni_cbc_hmac_sha1_cipher()
757 sha_off += blocks *= SHA_CBLOCK; in aesni_cbc_hmac_sha1_cipher()
761 key->md.Nh += blocks >> 29; in aesni_cbc_hmac_sha1_cipher()
762 key->md.Nl += blocks <<= 3; in aesni_cbc_hmac_sha1_cipher()
763 if (key->md.Nl < (unsigned int)blocks) in aesni_cbc_hmac_sha1_cipher()