/optee_os/core/lib/libtomcrypt/src/encauth/ocb3/ |
A D | ocb3_init.c | 36 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 D | ocb3_decrypt.c | 41 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 D | ocb3_encrypt.c | 41 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 D | ocb3_add_aad.c | 31 …->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 D | ocb3_decrypt_last.c | 44 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 D | ocb3_encrypt_last.c | 44 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 D | ocb3_int_xor_blocks.c | 26 …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 D | ocb3_done.c | 48 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 D | pmac_init.c | 61 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 D | pmac_process.c | 40 (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 D | pmac_done.c | 30 (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 D | pmac_shift_xor.c | 28 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 D | ocb_init.c | 64 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 D | s_ocb_done.c | 53 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 D | ocb_encrypt_authenticate_memory.c | 59 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 D | ocb_decrypt_verify_memory.c | 61 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 D | ocb_encrypt.c | 37 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 D | ocb_decrypt.c | 42 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 D | ocb_shift_xor.c | 28 for (x = 0; x < ocb->block_len; x++) { in ocb_shift_xor()
|
/optee_os/core/crypto/ |
A D | cbc-mac.c | 28 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 D | tomcrypt_mac.h | 78 block_len, /* length of block */ member 297 block_len; /* length of block */ member 362 block_len; /* length of block */ member
|
A D | tomcrypt_private.h | 143 …ed char *out, const unsigned char *block_a, const unsigned char *block_b, unsigned long block_len);
|