/optee_os-3.20.0/core/lib/libtomcrypt/src/mac/pmac/ |
A D | pmac_init.c | 54 if (polys[poly].len == pmac->block_len) { in pmac_init() 61 if (polys[poly].len != pmac->block_len) { in pmac_init() 78 L = XMALLOC(pmac->block_len); in pmac_init() 84 zeromem(L, pmac->block_len); in pmac_init() 90 XMEMCPY(pmac->Ls[0], L, pmac->block_len); in pmac_init() 93 for (y = 0; y < pmac->block_len-1; y++) { in pmac_init() 96 pmac->Ls[x][pmac->block_len-1] = (pmac->Ls[x-1][pmac->block_len-1] << 1) & 255; in pmac_init() 106 m = L[pmac->block_len-1] & 1; in pmac_init() 109 for (x = pmac->block_len - 1; x > 0; x--) { in pmac_init() 115 for (x = 0; x < pmac->block_len; x++) { in pmac_init() [all …]
|
A D | pmac_done.c | 23 (pmac->block_len > (int)sizeof(pmac->block)) || (pmac->buflen > pmac->block_len)) { in pmac_done() 30 if (pmac->buflen == pmac->block_len) { in pmac_done() 32 for (x = 0; x < pmac->block_len; x++) { in pmac_done() 50 for (x = 0; x < pmac->block_len && x < (int)*outlen; x++) { in pmac_done()
|
A D | pmac_process.c | 33 (pmac->block_len > (int)sizeof(pmac->block)) || (pmac->buflen > pmac->block_len)) { in pmac_process() 59 if (pmac->buflen == pmac->block_len) { in pmac_process() 61 for (x = 0; x < (unsigned long)pmac->block_len; x++) { in pmac_process() 67 for (x = 0; x < (unsigned long)pmac->block_len; x++) { in pmac_process() 74 n = MIN(inlen, (unsigned long)(pmac->block_len - pmac->buflen)); in pmac_process()
|
A D | pmac_shift_xor.c | 21 for (x = 0; x < pmac->block_len; x += sizeof(LTC_FAST_TYPE)) { in pmac_shift_xor() 26 for (x = 0; x < pmac->block_len; x++) { in pmac_shift_xor()
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/encauth/ocb/ |
A D | ocb_init.c | 57 if (polys[poly].len == ocb->block_len) { in ocb_init() 64 if (polys[poly].len != ocb->block_len) { in ocb_init() 74 zeromem(ocb->L, ocb->block_len); in ocb_init() 80 for (x = 0; x < ocb->block_len; x++) { in ocb_init() 88 XMEMCPY(ocb->Ls[0], ocb->L, ocb->block_len); in ocb_init() 94 ocb->Ls[x][ocb->block_len-1] = (ocb->Ls[x-1][ocb->block_len-1] << 1) & 255; in ocb_init() 104 m = ocb->L[ocb->block_len-1] & 1; in ocb_init() 107 for (x = ocb->block_len - 1; x > 0; x--) { in ocb_init() 113 for (x = 0; x < ocb->block_len; x++) { in ocb_init() 119 zeromem(ocb->Li, ocb->block_len); in ocb_init() [all …]
|
A D | s_ocb_done.c | 46 if (ocb->block_len != cipher_descriptor[ocb->cipher]->block_length || in s_ocb_done() 47 (int)ptlen > ocb->block_len || (int)ptlen < 0) { in s_ocb_done() 70 XMEMCPY(Z, X, ocb->block_len); in s_ocb_done() 72 X[ocb->block_len-1] ^= (ptlen*8)&255; in s_ocb_done() 73 X[ocb->block_len-2] ^= ((ptlen*8)>>8)&255; in s_ocb_done() 74 for (x = 0; x < ocb->block_len; x++) { in s_ocb_done() 105 for (x = 0; x < ocb->block_len; x++) { in s_ocb_done() 116 for (x = 0; x < ocb->block_len && x < (int)*taglen; x++) { in s_ocb_done()
|
A D | ocb_encrypt_authenticate_memory.c | 52 while (ptlen > (unsigned long)ocb->block_len) { in ocb_encrypt_authenticate_memory() 56 ptlen -= ocb->block_len; in ocb_encrypt_authenticate_memory() 57 pt += ocb->block_len; in ocb_encrypt_authenticate_memory() 58 ct += ocb->block_len; in ocb_encrypt_authenticate_memory()
|
A D | ocb_decrypt_verify_memory.c | 54 while (ctlen > (unsigned long)ocb->block_len) { in ocb_decrypt_verify_memory() 58 ctlen -= ocb->block_len; in ocb_decrypt_verify_memory() 59 pt += ocb->block_len; in ocb_decrypt_verify_memory() 60 ct += ocb->block_len; in ocb_decrypt_verify_memory()
|
A D | ocb_encrypt.c | 30 if (ocb->block_len != cipher_descriptor[ocb->cipher].block_length) { in ocb_encrypt() 35 for (x = 0; x < ocb->block_len; x++) { in ocb_encrypt() 43 for (x = 0; x < ocb->block_len; x++) { in ocb_encrypt() 49 for (x = 0; x < ocb->block_len; x++) { in ocb_encrypt()
|
A D | ocb_decrypt.c | 35 if (ocb->block_len != cipher_descriptor[ocb->cipher]->block_length) { in ocb_decrypt() 43 for (x = 0; x < ocb->block_len; x++) { in ocb_decrypt() 49 for (x = 0; x < ocb->block_len; x++) { in ocb_decrypt() 54 for (x = 0; x < ocb->block_len; x++) { in ocb_decrypt()
|
A D | ocb_shift_xor.c | 21 for (x = 0; x < ocb->block_len; x++) { in ocb_shift_xor()
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/encauth/ocb3/ |
A D | ocb3_init.c | 29 bottom = iNonce[ocb->block_len-1] & 0x3F; in s_ocb3_int_calc_offset_zero() 32 iNonce[ocb->block_len-1] = iNonce[ocb->block_len-1] & 0xC0; in s_ocb3_int_calc_offset_zero() 39 for (x = 0; x < ocb->block_len; x++) { in s_ocb3_int_calc_offset_zero() 49 for (x = 0; x < ocb->block_len; x++) { in s_ocb3_int_calc_offset_zero() 121 if (polys[poly].len == ocb->block_len) { in ocb3_init() 128 if (polys[poly].len != ocb->block_len) { in ocb3_init() 138 zeromem(ocb->L_star, ocb->block_len); in ocb3_init() 158 for (y = 0; y < ocb->block_len-1; y++) { in ocb3_init() 161 current[ocb->block_len-1] = (previous[ocb->block_len-1] << 1) & 255; in ocb3_init() 172 zeromem(ocb->checksum, ocb->block_len); in ocb3_init() [all …]
|
A D | ocb3_decrypt.c | 34 if (ocb->block_len != cipher_descriptor[ocb->cipher]->block_length) { in ocb3_decrypt() 38 if (ctlen % ocb->block_len) { /* ctlen has to bu multiple of block_len */ in ocb3_decrypt() 42 full_blocks = ctlen/ocb->block_len; in ocb3_decrypt() 44 pt_b = (unsigned char *)pt+i*ocb->block_len; in ocb3_decrypt() 45 ct_b = (unsigned char *)ct+i*ocb->block_len; in ocb3_decrypt() 48 …ocb->Offset_current, ocb->Offset_current, ocb->L_[ocb3_int_ntz(ocb->block_index)], ocb->block_len); in ocb3_decrypt() 51 ocb3_int_xor_blocks(tmp, ct_b, ocb->Offset_current, ocb->block_len); in ocb3_decrypt() 59 ocb3_int_xor_blocks(pt_b, tmp, ocb->Offset_current, ocb->block_len); in ocb3_decrypt() 62 ocb3_int_xor_blocks(ocb->checksum, ocb->checksum, pt_b, ocb->block_len); in ocb3_decrypt()
|
A D | ocb3_encrypt.c | 34 if (ocb->block_len != cipher_descriptor[ocb->cipher]->block_length) { in ocb3_encrypt() 38 if (ptlen % ocb->block_len) { /* ptlen has to bu multiple of block_len */ in ocb3_encrypt() 42 full_blocks = ptlen/ocb->block_len; in ocb3_encrypt() 44 pt_b = (unsigned char *)pt+i*ocb->block_len; in ocb3_encrypt() 45 ct_b = (unsigned char *)ct+i*ocb->block_len; in ocb3_encrypt() 48 …ocb->Offset_current, ocb->Offset_current, ocb->L_[ocb3_int_ntz(ocb->block_index)], ocb->block_len); in ocb3_encrypt() 51 ocb3_int_xor_blocks(tmp, pt_b, ocb->Offset_current, ocb->block_len); in ocb3_encrypt() 59 ocb3_int_xor_blocks(ct_b, tmp, ocb->Offset_current, ocb->block_len); in ocb3_encrypt() 62 ocb3_int_xor_blocks(ocb->checksum, ocb->checksum, pt_b, ocb->block_len); in ocb3_encrypt()
|
A D | ocb3_add_aad.c | 24 …->aOffset_current, ocb->aOffset_current, ocb->L_[ocb3_int_ntz(ocb->ablock_index)], ocb->block_len); in s_ocb3_int_aad_add_block() 27 ocb3_int_xor_blocks(tmp, aad_block, ocb->aOffset_current, ocb->block_len); in s_ocb3_int_aad_add_block() 31 ocb3_int_xor_blocks(ocb->aSum_current, ocb->aSum_current, tmp, ocb->block_len); in s_ocb3_int_aad_add_block() 56 l = ocb->block_len - ocb->adata_buffer_bytes; in ocb3_add_aad() 61 if (ocb->adata_buffer_bytes == ocb->block_len) { in ocb3_add_aad() 78 full_blocks = datalen/ocb->block_len; in ocb3_add_aad() 79 full_blocks_len = full_blocks * ocb->block_len; in ocb3_add_aad() 83 if ((err = s_ocb3_int_aad_add_block(ocb, data+x*ocb->block_len)) != CRYPT_OK) { in ocb3_add_aad()
|
A D | ocb3_int_xor_blocks.c | 19 …ned char *out, const unsigned char *block_a, const unsigned char *block_b, unsigned long block_len) in ocb3_int_xor_blocks() argument 23 for (x = 0; x < (int)block_len; x++) out[x] ^= block_b[x]; in ocb3_int_xor_blocks() 26 for (x = 0; x < (int)block_len; x++) out[x] = block_a[x] ^ block_b[x]; in ocb3_int_xor_blocks()
|
A D | ocb3_decrypt_last.c | 37 full_blocks = ctlen/ocb->block_len; in ocb3_decrypt_last() 38 full_blocks_len = full_blocks * ocb->block_len; in ocb3_decrypt_last() 50 ocb3_int_xor_blocks(iOffset_star, ocb->Offset_current, ocb->L_star, ocb->block_len); in ocb3_decrypt_last() 62 for(x=last_block_len; x<ocb->block_len; x++) { in ocb3_decrypt_last() 72 for(x=0; x<ocb->block_len; x++) { in ocb3_decrypt_last() 82 for(x=0; x<ocb->block_len; x++) { in ocb3_decrypt_last()
|
A D | ocb3_encrypt_last.c | 37 full_blocks = ptlen/ocb->block_len; in ocb3_encrypt_last() 38 full_blocks_len = full_blocks * ocb->block_len; in ocb3_encrypt_last() 52 ocb3_int_xor_blocks(iOffset_star, ocb->Offset_current, ocb->L_star, ocb->block_len); in ocb3_encrypt_last() 64 for(x=last_block_len; x<ocb->block_len; x++) { in ocb3_encrypt_last() 74 for(x=0; x<ocb->block_len; x++) { in ocb3_encrypt_last() 83 for(x=0; x<ocb->block_len; x++) { in ocb3_encrypt_last()
|
A D | ocb3_done.c | 41 ocb3_int_xor_blocks(ocb->aOffset_current, ocb->aOffset_current, ocb->L_star, ocb->block_len); in ocb3_done() 45 for(x=ocb->adata_buffer_bytes; x<ocb->block_len; x++) { in ocb3_done() 58 ocb3_int_xor_blocks(ocb->aSum_current, ocb->aSum_current, tmp, ocb->block_len); in ocb3_done() 65 ocb3_int_xor_blocks(tmp, ocb->tag_part, ocb->aSum_current, ocb->block_len); in ocb3_done()
|
/optee_os-3.20.0/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-3.20.0/core/lib/libtomcrypt/src/headers/ |
A D | tomcrypt_mac.h | 72 block_len, /* length of block */ member 303 block_len; /* length of block */ member 368 block_len; /* length of block */ member
|
A D | tomcrypt_private.h | 156 …ed char *out, const unsigned char *block_a, const unsigned char *block_b, unsigned long block_len);
|