Home
last modified time | relevance | path

Searched refs:block_len (Results 1 – 22 of 22) sorted by relevance

/optee_os/core/lib/libtomcrypt/src/encauth/ocb3/
A Docb3_init.c36 bottom = iNonce[ocb->block_len-1] & 0x3F; in _ocb3_int_calc_offset_zero()
39 iNonce[ocb->block_len-1] = iNonce[ocb->block_len-1] & 0xC0; in _ocb3_int_calc_offset_zero()
46 for (x = 0; x < ocb->block_len; x++) { in _ocb3_int_calc_offset_zero()
56 for (x = 0; x < ocb->block_len; x++) { in _ocb3_int_calc_offset_zero()
128 if (polys[poly].len == ocb->block_len) { in ocb3_init()
135 if (polys[poly].len != ocb->block_len) { in ocb3_init()
145 zeromem(ocb->L_star, ocb->block_len); in ocb3_init()
165 for (y = 0; y < ocb->block_len-1; y++) { in ocb3_init()
168 current[ocb->block_len-1] = (previous[ocb->block_len-1] << 1) & 255; in ocb3_init()
179 zeromem(ocb->checksum, ocb->block_len); in ocb3_init()
[all …]
A Docb3_decrypt.c41 if (ocb->block_len != cipher_descriptor[ocb->cipher]->block_length) { in ocb3_decrypt()
45 if (ctlen % ocb->block_len) { /* ctlen has to bu multiple of block_len */ in ocb3_decrypt()
49 full_blocks = ctlen/ocb->block_len; in ocb3_decrypt()
51 pt_b = (unsigned char *)pt+i*ocb->block_len; in ocb3_decrypt()
52 ct_b = (unsigned char *)ct+i*ocb->block_len; in ocb3_decrypt()
55 …ocb->Offset_current, ocb->Offset_current, ocb->L_[ocb3_int_ntz(ocb->block_index)], ocb->block_len); in ocb3_decrypt()
58 ocb3_int_xor_blocks(tmp, ct_b, ocb->Offset_current, ocb->block_len); in ocb3_decrypt()
66 ocb3_int_xor_blocks(pt_b, tmp, ocb->Offset_current, ocb->block_len); in ocb3_decrypt()
69 ocb3_int_xor_blocks(ocb->checksum, ocb->checksum, pt_b, ocb->block_len); in ocb3_decrypt()
A Docb3_encrypt.c41 if (ocb->block_len != cipher_descriptor[ocb->cipher]->block_length) { in ocb3_encrypt()
45 if (ptlen % ocb->block_len) { /* ptlen has to bu multiple of block_len */ in ocb3_encrypt()
49 full_blocks = ptlen/ocb->block_len; in ocb3_encrypt()
51 pt_b = (unsigned char *)pt+i*ocb->block_len; in ocb3_encrypt()
52 ct_b = (unsigned char *)ct+i*ocb->block_len; in ocb3_encrypt()
55 …ocb->Offset_current, ocb->Offset_current, ocb->L_[ocb3_int_ntz(ocb->block_index)], ocb->block_len); in ocb3_encrypt()
58 ocb3_int_xor_blocks(tmp, pt_b, ocb->Offset_current, ocb->block_len); in ocb3_encrypt()
66 ocb3_int_xor_blocks(ct_b, tmp, ocb->Offset_current, ocb->block_len); in ocb3_encrypt()
69 ocb3_int_xor_blocks(ocb->checksum, ocb->checksum, pt_b, ocb->block_len); in ocb3_encrypt()
A Docb3_add_aad.c31 …->aOffset_current, ocb->aOffset_current, ocb->L_[ocb3_int_ntz(ocb->ablock_index)], ocb->block_len); in _ocb3_int_aad_add_block()
34 ocb3_int_xor_blocks(tmp, aad_block, ocb->aOffset_current, ocb->block_len); in _ocb3_int_aad_add_block()
38 ocb3_int_xor_blocks(ocb->aSum_current, ocb->aSum_current, tmp, ocb->block_len); in _ocb3_int_aad_add_block()
63 l = ocb->block_len - ocb->adata_buffer_bytes; in ocb3_add_aad()
68 if (ocb->adata_buffer_bytes == ocb->block_len) { in ocb3_add_aad()
85 full_blocks = datalen/ocb->block_len; in ocb3_add_aad()
86 full_blocks_len = full_blocks * ocb->block_len; in ocb3_add_aad()
90 if ((err = _ocb3_int_aad_add_block(ocb, data+x*ocb->block_len)) != CRYPT_OK) { in ocb3_add_aad()
A Docb3_decrypt_last.c44 full_blocks = ctlen/ocb->block_len; in ocb3_decrypt_last()
45 full_blocks_len = full_blocks * ocb->block_len; in ocb3_decrypt_last()
57 ocb3_int_xor_blocks(iOffset_star, ocb->Offset_current, ocb->L_star, ocb->block_len); in ocb3_decrypt_last()
69 for(x=last_block_len; x<ocb->block_len; x++) { in ocb3_decrypt_last()
79 for(x=0; x<ocb->block_len; x++) { in ocb3_decrypt_last()
89 for(x=0; x<ocb->block_len; x++) { in ocb3_decrypt_last()
A Docb3_encrypt_last.c44 full_blocks = ptlen/ocb->block_len; in ocb3_encrypt_last()
45 full_blocks_len = full_blocks * ocb->block_len; in ocb3_encrypt_last()
59 ocb3_int_xor_blocks(iOffset_star, ocb->Offset_current, ocb->L_star, ocb->block_len); in ocb3_encrypt_last()
71 for(x=last_block_len; x<ocb->block_len; x++) { in ocb3_encrypt_last()
81 for(x=0; x<ocb->block_len; x++) { in ocb3_encrypt_last()
90 for(x=0; x<ocb->block_len; x++) { in ocb3_encrypt_last()
A Docb3_int_xor_blocks.c26 …ned char *out, const unsigned char *block_a, const unsigned char *block_b, unsigned long block_len) in ocb3_int_xor_blocks() argument
30 for (x = 0; x < (int)block_len; x++) out[x] ^= block_b[x]; in ocb3_int_xor_blocks()
33 for (x = 0; x < (int)block_len; x++) out[x] = block_a[x] ^ block_b[x]; in ocb3_int_xor_blocks()
A Docb3_done.c48 ocb3_int_xor_blocks(ocb->aOffset_current, ocb->aOffset_current, ocb->L_star, ocb->block_len); in ocb3_done()
52 for(x=ocb->adata_buffer_bytes; x<ocb->block_len; x++) { in ocb3_done()
65 ocb3_int_xor_blocks(ocb->aSum_current, ocb->aSum_current, tmp, ocb->block_len); in ocb3_done()
72 ocb3_int_xor_blocks(tmp, ocb->tag_part, ocb->aSum_current, ocb->block_len); in ocb3_done()
/optee_os/core/lib/libtomcrypt/src/mac/pmac/
A Dpmac_init.c61 if (polys[poly].len == pmac->block_len) { in pmac_init()
68 if (polys[poly].len != pmac->block_len) { in pmac_init()
85 L = XMALLOC(pmac->block_len); in pmac_init()
91 zeromem(L, pmac->block_len); in pmac_init()
97 XMEMCPY(pmac->Ls[0], L, pmac->block_len); in pmac_init()
100 for (y = 0; y < pmac->block_len-1; y++) { in pmac_init()
103 pmac->Ls[x][pmac->block_len-1] = (pmac->Ls[x-1][pmac->block_len-1] << 1) & 255; in pmac_init()
113 m = L[pmac->block_len-1] & 1; in pmac_init()
116 for (x = pmac->block_len - 1; x > 0; x--) { in pmac_init()
122 for (x = 0; x < pmac->block_len; x++) { in pmac_init()
[all …]
A Dpmac_process.c40 (pmac->block_len > (int)sizeof(pmac->block)) || (pmac->buflen > pmac->block_len)) { in pmac_process()
66 if (pmac->buflen == pmac->block_len) { in pmac_process()
68 for (x = 0; x < (unsigned long)pmac->block_len; x++) { in pmac_process()
74 for (x = 0; x < (unsigned long)pmac->block_len; x++) { in pmac_process()
81 n = MIN(inlen, (unsigned long)(pmac->block_len - pmac->buflen)); in pmac_process()
A Dpmac_done.c30 (pmac->block_len > (int)sizeof(pmac->block)) || (pmac->buflen > pmac->block_len)) { in pmac_done()
37 if (pmac->buflen == pmac->block_len) { in pmac_done()
39 for (x = 0; x < pmac->block_len; x++) { in pmac_done()
57 for (x = 0; x < pmac->block_len && x < (int)*outlen; x++) { in pmac_done()
A Dpmac_shift_xor.c28 for (x = 0; x < pmac->block_len; x += sizeof(LTC_FAST_TYPE)) { in pmac_shift_xor()
33 for (x = 0; x < pmac->block_len; x++) { in pmac_shift_xor()
/optee_os/core/lib/libtomcrypt/src/encauth/ocb/
A Docb_init.c64 if (polys[poly].len == ocb->block_len) { in ocb_init()
71 if (polys[poly].len != ocb->block_len) { in ocb_init()
81 zeromem(ocb->L, ocb->block_len); in ocb_init()
87 for (x = 0; x < ocb->block_len; x++) { in ocb_init()
95 XMEMCPY(ocb->Ls[0], ocb->L, ocb->block_len); in ocb_init()
101 ocb->Ls[x][ocb->block_len-1] = (ocb->Ls[x-1][ocb->block_len-1] << 1) & 255; in ocb_init()
111 m = ocb->L[ocb->block_len-1] & 1; in ocb_init()
114 for (x = ocb->block_len - 1; x > 0; x--) { in ocb_init()
120 for (x = 0; x < ocb->block_len; x++) { in ocb_init()
126 zeromem(ocb->Li, ocb->block_len); in ocb_init()
[all …]
A Ds_ocb_done.c53 if (ocb->block_len != cipher_descriptor[ocb->cipher]->block_length || in s_ocb_done()
54 (int)ptlen > ocb->block_len || (int)ptlen < 0) { in s_ocb_done()
77 XMEMCPY(Z, X, ocb->block_len); in s_ocb_done()
79 X[ocb->block_len-1] ^= (ptlen*8)&255; in s_ocb_done()
80 X[ocb->block_len-2] ^= ((ptlen*8)>>8)&255; in s_ocb_done()
81 for (x = 0; x < ocb->block_len; x++) { in s_ocb_done()
112 for (x = 0; x < ocb->block_len; x++) { in s_ocb_done()
123 for (x = 0; x < ocb->block_len && x < (int)*taglen; x++) { in s_ocb_done()
A Docb_encrypt_authenticate_memory.c59 while (ptlen > (unsigned long)ocb->block_len) { in ocb_encrypt_authenticate_memory()
63 ptlen -= ocb->block_len; in ocb_encrypt_authenticate_memory()
64 pt += ocb->block_len; in ocb_encrypt_authenticate_memory()
65 ct += ocb->block_len; in ocb_encrypt_authenticate_memory()
A Docb_decrypt_verify_memory.c61 while (ctlen > (unsigned long)ocb->block_len) { in ocb_decrypt_verify_memory()
65 ctlen -= ocb->block_len; in ocb_decrypt_verify_memory()
66 pt += ocb->block_len; in ocb_decrypt_verify_memory()
67 ct += ocb->block_len; in ocb_decrypt_verify_memory()
A Docb_encrypt.c37 if (ocb->block_len != cipher_descriptor[ocb->cipher].block_length) { in ocb_encrypt()
42 for (x = 0; x < ocb->block_len; x++) { in ocb_encrypt()
50 for (x = 0; x < ocb->block_len; x++) { in ocb_encrypt()
56 for (x = 0; x < ocb->block_len; x++) { in ocb_encrypt()
A Docb_decrypt.c42 if (ocb->block_len != cipher_descriptor[ocb->cipher]->block_length) { in ocb_decrypt()
50 for (x = 0; x < ocb->block_len; x++) { in ocb_decrypt()
56 for (x = 0; x < ocb->block_len; x++) { in ocb_decrypt()
61 for (x = 0; x < ocb->block_len; x++) { in ocb_decrypt()
A Docb_shift_xor.c28 for (x = 0; x < ocb->block_len; x++) { in ocb_shift_xor()
/optee_os/core/crypto/
A Dcbc-mac.c28 unsigned char block_len; member
54 NULL, 0, mc->block, mc->block_len); in crypto_cbc_mac_init()
75 false, mc->block, mc->block_len, in crypto_cbc_mac_update()
83 nblocks = MIN(len / mc->block_len, in crypto_cbc_mac_update()
88 while (len >= mc->block_len) { in crypto_cbc_mac_update()
89 nblocks = MIN(len / mc->block_len, in crypto_cbc_mac_update()
93 out_len = nblocks * mc->block_len; in crypto_cbc_mac_update()
96 out_len = mc->block_len; in crypto_cbc_mac_update()
112 mc->block_len); in crypto_cbc_mac_update()
169 assert(dst->block_len == src->block_len); in crypto_cbc_mac_copy_state()
[all …]
/optee_os/core/lib/libtomcrypt/src/headers/
A Dtomcrypt_mac.h78 block_len, /* length of block */ member
297 block_len; /* length of block */ member
362 block_len; /* length of block */ member
A Dtomcrypt_private.h143 …ed char *out, const unsigned char *block_a, const unsigned char *block_b, unsigned long block_len);

Completed in 20 milliseconds