Home
last modified time | relevance | path

Searched refs:block_size (Results 1 – 25 of 29) sorted by relevance

12

/optee_os/core/crypto/
H A Daes-cts.c101 int block_size = 16; in cbc_cts_update() local
109 nb_blocks = (len + block_size - 1) / block_size; in cbc_cts_update()
112 len_last_block = len % block_size; in cbc_cts_update()
114 len_last_block = block_size; in cbc_cts_update()
118 data + ((nb_blocks - 1) * block_size), in cbc_cts_update()
122 block_size - len_last_block); in cbc_cts_update()
126 (nb_blocks - 1) * block_size, dst); in cbc_cts_update()
130 memcpy(dst + (nb_blocks - 1) * block_size, in cbc_cts_update()
131 dst + (nb_blocks - 2) * block_size, in cbc_cts_update()
135 mode, 0, tmp_block, block_size, in cbc_cts_update()
[all …]
H A Dcbc-mac.c194 size_t block_size = 0; in crypto_cbc_mac_alloc_ctx() local
196 res = crypto_cipher_get_block_size(cbc_algo, &block_size); in crypto_cbc_mac_alloc_ctx()
213 ctx->block_len = block_size; in crypto_cbc_mac_alloc_ctx()
/optee_os/core/lib/libtomcrypt/
H A Dsha3_accel.c122 unsigned int block_size = 0; in sha3_process() local
131 block_size = 200 - md->sha3.capacity_words * 8; in sha3_process()
136 l = MIN(block_size - md->sha3.byte_index, inlen); in sha3_process()
141 if (md->sha3.byte_index == block_size) { in sha3_process()
151 if (inlen > block_size) { in sha3_process()
152 block_count = inlen / block_size; in sha3_process()
155 in += block_count * block_size; in sha3_process()
156 inlen -= block_count * block_size; in sha3_process()
182 unsigned int block_size = 0; in sha3_done() local
189 block_size = 200 - md->sha3.capacity_words * 8; in sha3_done()
[all …]
/optee_os/lib/libmbedtls/mbedtls/library/
H A Dcmac.c101 size_t olen, block_size; in cmac_generate_subkeys() local
105 block_size = mbedtls_cipher_info_get_block_size(ctx->cipher_info); in cmac_generate_subkeys()
108 if ((ret = mbedtls_cipher_update(ctx, L, block_size, L, &olen)) != 0) { in cmac_generate_subkeys()
115 if ((ret = cmac_multiply_by_u(K1, L, block_size)) != 0) { in cmac_generate_subkeys()
119 if ((ret = cmac_multiply_by_u(K2, K1, block_size)) != 0) { in cmac_generate_subkeys()
212 size_t n, j, olen, block_size; in mbedtls_cipher_cmac_update() local
220 block_size = mbedtls_cipher_info_get_block_size(ctx->cipher_info); in mbedtls_cipher_cmac_update()
225 MBEDTLS_ASSUME(block_size <= MBEDTLS_CMAC_MAX_BLOCK_SIZE); in mbedtls_cipher_cmac_update()
230 ilen > block_size - cmac_ctx->unprocessed_len) { in mbedtls_cipher_cmac_update()
233 block_size - cmac_ctx->unprocessed_len); in mbedtls_cipher_cmac_update()
[all …]
H A Dpsa_crypto_mac.c40 size_t block_size = PSA_HASH_BLOCK_LENGTH(hash_alg); in psa_hmac_setup_internal() local
51 if (block_size > sizeof(ipad)) { in psa_hmac_setup_internal()
54 if (block_size > sizeof(hmac->opad)) { in psa_hmac_setup_internal()
57 if (block_size < hash_size) { in psa_hmac_setup_internal()
61 if (key_length > block_size) { in psa_hmac_setup_internal()
81 memset(ipad + key_length, 0x36, block_size - key_length); in psa_hmac_setup_internal()
88 memset(hmac->opad + key_length, 0x5C, block_size - key_length); in psa_hmac_setup_internal()
95 status = psa_hash_update(&hmac->hash_ctx, ipad, block_size); in psa_hmac_setup_internal()
119 size_t block_size = PSA_HASH_BLOCK_LENGTH(hash_alg); in psa_hmac_finish_internal() local
133 status = psa_hash_update(&hmac->hash_ctx, hmac->opad, block_size); in psa_hmac_finish_internal()
H A Dmd.c68 #define MD_INFO(type, out_size, block_size) type, out_size, block_size, argument
70 #define MD_INFO(type, out_size, block_size) type, out_size, argument
327 2 * ctx->md_info->block_size); in mbedtls_md_free()
407 memcpy(dst->hmac_ctx, src->hmac_ctx, 2 * src->md_info->block_size); in mbedtls_md_clone()
501 ctx->hmac_ctx = mbedtls_calloc(2, md_info->block_size); in mbedtls_md_setup()
982 if (keylen > (size_t) ctx->md_info->block_size) { in mbedtls_md_hmac_starts()
998 opad = (unsigned char *) ctx->hmac_ctx + ctx->md_info->block_size; in mbedtls_md_hmac_starts()
1000 memset(ipad, 0x36, ctx->md_info->block_size); in mbedtls_md_hmac_starts()
1001 memset(opad, 0x5C, ctx->md_info->block_size); in mbedtls_md_hmac_starts()
1010 ctx->md_info->block_size)) != 0) { in mbedtls_md_hmac_starts()
[all …]
H A Dpsa_crypto_cipher.c424 size_t block_size = mbedtls_cipher_info_get_block_size(ctx->cipher_info); in psa_cipher_update_ecb() local
435 size_t bytes_to_copy = block_size - ctx->unprocessed_len; in psa_cipher_update_ecb()
447 if (ctx->unprocessed_len == block_size) { in psa_cipher_update_ecb()
451 block_size, in psa_cipher_update_ecb()
464 while (input_length >= block_size) { in psa_cipher_update_ecb()
468 block_size, in psa_cipher_update_ecb()
475 input_length -= block_size; in psa_cipher_update_ecb()
476 input += block_size; in psa_cipher_update_ecb()
H A Dmd_wrap.h38 unsigned char block_size; member
H A Dcipher.c623 size_t block_size; in mbedtls_cipher_update() local
639 block_size = mbedtls_cipher_get_block_size(ctx); in mbedtls_cipher_update()
640 if (0 == block_size) { in mbedtls_cipher_update()
645 if (ilen != block_size) { in mbedtls_cipher_update()
685 (ctx->unprocessed_len != 0 || ilen % block_size)) { in mbedtls_cipher_update()
697 ilen <= block_size - ctx->unprocessed_len) || in mbedtls_cipher_update()
699 ilen < block_size - ctx->unprocessed_len) || in mbedtls_cipher_update()
701 ilen < block_size - ctx->unprocessed_len)) { in mbedtls_cipher_update()
713 copy_len = block_size - ctx->unprocessed_len; in mbedtls_cipher_update()
720 block_size, ctx->iv, in mbedtls_cipher_update()
[all …]
H A Dpkcs5.c209 padlen = cipher_info->block_size - (datalen % cipher_info->block_size); in mbedtls_pkcs5_pbes2_ext()
H A Dpkcs12.c184 padlen = cipher_info->block_size - (len % cipher_info->block_size); in mbedtls_pkcs12_pbe_ext()
/optee_os/lib/libmbedtls/core/
H A Dcmac.c75 size_t block_size = TEE_AES_BLOCK_SIZE; in mbed_cmac_final() local
85 block_size = TEE_DES_BLOCK_SIZE; in mbed_cmac_final()
87 if (len < block_size) in mbed_cmac_final()
95 if (len < block_size) in mbed_cmac_final()
H A Ddes_ecb.c64 size_t block_size = TEE_DES_BLOCK_SIZE; in mbed_des_ecb_update() local
67 if (len % block_size) in mbed_des_ecb_update()
70 for (offs = 0; offs < len; offs += block_size) { in mbed_des_ecb_update()
H A Ddes3_ecb.c72 size_t block_size = TEE_DES_BLOCK_SIZE; in mbed_des3_ecb_update() local
75 if (len % block_size) in mbed_des3_ecb_update()
78 for (offs = 0; offs < len; offs += block_size) { in mbed_des3_ecb_update()
H A Daes_ecb.c71 size_t block_size = TEE_AES_BLOCK_SIZE; in mbed_aes_ecb_update() local
74 if (len % block_size) in mbed_aes_ecb_update()
77 for (offs = 0; offs < len; offs += block_size) { in mbed_aes_ecb_update()
/optee_os/core/lib/libtomcrypt/src/headers/
H A Dtomcrypt_private.h116 #define HASH_PROCESS_(func_name, compress_name, compress_n_name, state_var, block_size) \ argument
133 if (md-> state_var .curlen == 0 && inlen >= block_size) { \
135 blocks = inlen / block_size; \
143 md-> state_var .length += blocks * block_size * 8; \
144 in += blocks * block_size; \
145 inlen -= blocks * block_size; \
147 n = MIN(inlen, (block_size - md-> state_var .curlen)); \
152 if (md-> state_var .curlen == block_size) { \
161 md-> state_var .length += 8*block_size; \
170 #define HASH_PROCESS(func_name, compress_name, state_var, block_size) \ argument
[all …]
/optee_os/lib/libutee/
H A Dtee_api_operations.c31 size_t block_size; /* Block size of cipher */ member
45 size_t block_size = 1; in TEE_AllocateOperation() local
153 block_size = TEE_AES_BLOCK_SIZE; in TEE_AllocateOperation()
155 block_size = TEE_SM4_BLOCK_SIZE; in TEE_AllocateOperation()
157 block_size = TEE_DES_BLOCK_SIZE; in TEE_AllocateOperation()
334 block_size = op->info.digestLength; in TEE_AllocateOperation()
336 if (block_size > 1) { in TEE_AllocateOperation()
337 size_t buffer_size = block_size; in TEE_AllocateOperation()
349 op->block_size = block_size; in TEE_AllocateOperation()
860 dst_op->block_size != src_op->block_size) in TEE_CopyOperation()
[all …]
/optee_os/core/tee/
H A Dtee_cryp_utl.c103 size_t block_size; in tee_do_cipher_update() local
112 res = tee_cipher_get_block_size(algo, &block_size); in tee_do_cipher_update()
115 if ((len % block_size) != 0) { in tee_do_cipher_update()
H A Dfs_htree.c895 ht->stor->block_size); in tee_fs_htree_write_block()
899 ht->stor->block_size, enc_block); in tee_fs_htree_write_block()
945 if (len != ht->stor->block_size) { in tee_fs_htree_read_block()
951 ht->stor->block_size); in tee_fs_htree_read_block()
956 ht->stor->block_size, block); in tee_fs_htree_read_block()
/optee_os/core/drivers/crypto/stm32/
H A Dstm32_hash.c378 if (len > c->block_size) in hw_init()
468 c->block_size = MD5_BLOCK_SIZE; in stm32_hash_alloc()
476 c->block_size = SHA1_BLOCK_SIZE; in stm32_hash_alloc()
484 c->block_size = SHA224_BLOCK_SIZE; in stm32_hash_alloc()
492 c->block_size = SHA256_BLOCK_SIZE; in stm32_hash_alloc()
500 c->block_size = SHA384_BLOCK_SIZE; in stm32_hash_alloc()
508 c->block_size = SHA512_BLOCK_SIZE; in stm32_hash_alloc()
516 c->block_size = SHA3_224_BLOCK_SIZE; in stm32_hash_alloc()
524 c->block_size = SHA3_256_BLOCK_SIZE; in stm32_hash_alloc()
532 c->block_size = SHA3_384_BLOCK_SIZE; in stm32_hash_alloc()
[all …]
H A Dstm32_hash.h43 size_t block_size; member
/optee_os/lib/libmbedtls/mbedtls/include/psa/
H A Dcrypto_sizes.h45 #define PSA_ROUND_UP_TO_MULTIPLE(block_size, length) \ argument
46 (((length) + (block_size) - 1) / (block_size) * (block_size))
/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/
H A Dcipher.h271 unsigned int MBEDTLS_PRIVATE(block_size) : 5;
545 return (size_t) (info->MBEDTLS_PRIVATE(block_size)); in mbedtls_cipher_info_get_block_size()
711 return (unsigned int) ctx->MBEDTLS_PRIVATE(cipher_info)->MBEDTLS_PRIVATE(block_size); in mbedtls_cipher_get_block_size()
/optee_os/core/include/tee/
H A Dfs_htree.h88 size_t block_size; member
/optee_os/core/mm/
H A Dcore_mmu.c1939 size_t size_left, paddr_t block_size, in can_map_at_level() argument
1943 if ((vaddr | paddr) & (block_size - 1)) in can_map_at_level()
1947 if (size_left < block_size) in can_map_at_level()
1954 if (mm->region_size < block_size) in can_map_at_level()
1963 block_size != SMALL_PAGE_SIZE) in can_map_at_level()
1990 paddr_t block_size = 0; in core_mmu_map_region() local
1999 block_size = BIT64(tbl_info.shift); in core_mmu_map_region()
2003 block_size, mm)) { in core_mmu_map_region()
2031 paddr += block_size; in core_mmu_map_region()
2032 vaddr += block_size; in core_mmu_map_region()
[all …]

12