| /optee_os/core/lib/libtomcrypt/src/pk/asn1/der/sequence/ |
| H A D | der_decode_sequence_flexi.c | 12 static int s_new_element(ltc_asn1_list **l) in s_new_element() argument 15 if (*l == NULL) { in s_new_element() 16 *l = XCALLOC(1, sizeof(ltc_asn1_list)); in s_new_element() 17 if (*l == NULL) { in s_new_element() 21 (*l)->next = XCALLOC(1, sizeof(ltc_asn1_list)); in s_new_element() 22 if ((*l)->next == NULL) { in s_new_element() 25 (*l)->next->prev = *l; in s_new_element() 26 *l = (*l)->next; in s_new_element() 41 ltc_asn1_list *l; in s_der_decode_sequence_flexi() local 49 l = NULL; in s_der_decode_sequence_flexi() [all …]
|
| H A D | der_sequence_free.c | 18 ltc_asn1_list *l; in der_sequence_free() local 47 l = in->next; in der_sequence_free() 49 in = l; in der_sequence_free()
|
| /optee_os/core/lib/libtomcrypt/src/pk/asn1/x509/ |
| H A D | x509_decode_public_key_from_certificate.c | 13 #define LOOKS_LIKE_SPKI(l) ((l) != NULL) \ argument 14 && ((l)->type == LTC_ASN1_SEQUENCE) \ 15 && ((l)->child != NULL) \ 16 && ((l)->child->type == LTC_ASN1_OBJECT_IDENTIFIER) \ 17 && ((l)->next != NULL) \ 18 && ((l)->next->type == LTC_ASN1_BIT_STRING) 40 ltc_asn1_list *decoded_list = NULL, *l; in x509_decode_public_key_from_certificate() local 55 l = decoded_list; in x509_decode_public_key_from_certificate() 64 if ((l->type == LTC_ASN1_SEQUENCE) && (l->child != NULL)) { in x509_decode_public_key_from_certificate() 65 l = l->child; in x509_decode_public_key_from_certificate() [all …]
|
| /optee_os/core/lib/libtomcrypt/src/pk/asn1/pkcs8/ |
| H A D | pkcs8_decode_flexi.c | 24 ltc_asn1_list *l = NULL; in pkcs8_decode_flexi() local 31 if ((err = der_decode_sequence_flexi(in, &len, &l)) == CRYPT_OK) { in pkcs8_decode_flexi() 41 if (l->type == LTC_ASN1_SEQUENCE && in pkcs8_decode_flexi() 42 LTC_ASN1_IS_TYPE(l->child, LTC_ASN1_SEQUENCE) && in pkcs8_decode_flexi() 43 LTC_ASN1_IS_TYPE(l->child->child, LTC_ASN1_OBJECT_IDENTIFIER) && in pkcs8_decode_flexi() 44 LTC_ASN1_IS_TYPE(l->child->child->next, LTC_ASN1_SEQUENCE) && in pkcs8_decode_flexi() 45 LTC_ASN1_IS_TYPE(l->child->next, LTC_ASN1_OCTET_STRING)) { in pkcs8_decode_flexi() 46 ltc_asn1_list *lalgoid = l->child->child; in pkcs8_decode_flexi() 61 pbes.enc_data = l->child->next; in pkcs8_decode_flexi() 73 der_free_sequence_flexi(l); in pkcs8_decode_flexi() [all …]
|
| /optee_os/core/kernel/ |
| H A D | spin_lock_debug.c | 12 struct thread_core_local *l = thread_get_core_local(); in spinlock_count_incr() local 14 l->locked_count++; in spinlock_count_incr() 15 assert(l->locked_count); in spinlock_count_incr() 20 struct thread_core_local *l = thread_get_core_local(); in spinlock_count_decr() local 22 assert(l->locked_count); in spinlock_count_decr() 23 l->locked_count--; in spinlock_count_decr() 28 struct thread_core_local *l; in have_spinlock() local 39 l = thread_get_core_local(); in have_spinlock() 41 return !!l->locked_count; in have_spinlock()
|
| H A D | thread.c | 102 size_t l = stack_size_to_alloc_size(stack_size); in stack_end_va_to_top_hard() local 104 return end_va - l + STACK_CANARY_SIZE; in stack_end_va_to_top_hard() 334 struct thread_core_local *l = get_core_local(pos); in get_stackcheck_recursion_flag() local 335 int ct = l->curr_thread; in get_stackcheck_recursion_flag() 338 if (l->flags & (THREAD_CLF_ABORT | THREAD_CLF_TMP)) in get_stackcheck_recursion_flag() 339 p = &l->stackcheck_recursion; in get_stackcheck_recursion_flag() 340 else if (!l->flags) in get_stackcheck_recursion_flag() 374 struct thread_core_local *l = thread_get_core_local(); in thread_init_boot_thread() local 376 l->curr_thread = 0; in thread_init_boot_thread() 382 struct thread_core_local *l = thread_get_core_local(); in thread_clr_boot_thread() local [all …]
|
| H A D | secstor_ta.c | 16 size_t l; in secstor_ta_open() local 24 l = prop->custom_size; in secstor_ta_open() 25 res = tee_tadb_ta_read(ta, NULL, NULL, &l); in secstor_ta_open() 28 if (l != prop->custom_size) { in secstor_ta_open() 62 size_t l = len; in secstor_ta_read() local 63 TEE_Result res = tee_tadb_ta_read(ta, data_core, data_user, &l); in secstor_ta_read() 67 if (l != len) in secstor_ta_read()
|
| /optee_os/core/lib/libtomcrypt/src/misc/padding/ |
| H A D | padding_pad.c | 82 unsigned long l, n; in padding_pad() local 90 l = length; in padding_pad() 91 if ((err = s_padding_padded_length(&l, mode)) != CRYPT_OK) { in padding_pad() 97 if (*padded_length < l) { in padding_pad() 100 *padded_length = l; in padding_pad() 105 *padded_length = l; in padding_pad() 110 if (l - length > 255) return CRYPT_INVALID_ARG; in padding_pad() 111 diff = (unsigned char)(l - length); in padding_pad() 122 data[l-1] = diff; in padding_pad() 127 data[l-1] = diff; in padding_pad() [all …]
|
| /optee_os/lib/libutils/ext/include/ |
| H A D | fault_mitigation.h | 155 #define __FTMN_FUNC_BYTE(f, o, l) ((o) < (l) ? (uint8_t)(f)[(o)] : 0) argument 158 #define __FTMN_GET_FUNC_U32(f, o, l) \ argument 159 (SHIFT_U32(__FTMN_FUNC_BYTE((f), (o), (l)), 0) | \ 160 SHIFT_U32(__FTMN_FUNC_BYTE((f), (o) + 1, (l)), 8) | \ 161 SHIFT_U32(__FTMN_FUNC_BYTE((f), (o) + 2, (l)), 16) | \ 162 SHIFT_U32(__FTMN_FUNC_BYTE((f), (o) + 3, (l)), 24)) 164 #define __FTMN_FUNC_HASH64(f, o, l) \ argument 165 (__FTMN_GET_FUNC_U32((f), (o), (l)) ^ \ 166 __FTMN_GET_FUNC_U32((f), (o) + 4, (l))) 168 #define __FTMN_FUNC_HASH32(f, o, l) \ argument [all …]
|
| /optee_os/lib/libutee/ |
| H A D | tee_api_property.c | 80 size_t l; in propget_get_ext_prop() local 85 l = sizeof(bool); in propget_get_ext_prop() 88 l = sizeof(uint32_t); in propget_get_ext_prop() 91 l = sizeof(uint64_t); in propget_get_ext_prop() 94 l = sizeof(TEE_UUID); in propget_get_ext_prop() 97 l = sizeof(TEE_Identity); in propget_get_ext_prop() 101 l = strlen(ep->value) + 1; in propget_get_ext_prop() 110 l = *len; in propget_get_ext_prop() 111 if (!base64_dec(ep->value, strlen(ep->value), buf, &l) && in propget_get_ext_prop() 112 l <= *len) in propget_get_ext_prop() [all …]
|
| /optee_os/core/arch/arm/plat-bcm/ |
| H A D | crc32.c | 82 size_t l = 0; in crc32i() local 84 for (l = 0; l < len; l++) in crc32i() 85 crc = ucrc32(buf[l], crc); in crc32i()
|
| /optee_os/core/lib/libtomcrypt/src/encauth/ocb3/ |
| H A D | ocb3_add_aad.c | 49 unsigned long datalen, l; in ocb3_add_aad() local 56 l = ocb->block_len - ocb->adata_buffer_bytes; in ocb3_add_aad() 57 if (l > aadlen) l = aadlen; in ocb3_add_aad() 58 XMEMCPY(ocb->adata_buffer+ocb->adata_buffer_bytes, aad, l); in ocb3_add_aad() 59 ocb->adata_buffer_bytes += l; in ocb3_add_aad() 68 data = (unsigned char *)aad + l; in ocb3_add_aad() 69 datalen = aadlen - l; in ocb3_add_aad()
|
| /optee_os/lib/libutils/isoc/ |
| H A D | strndup.c | 10 size_t l = strnlen(s, n) + 1; in strndup() local 11 char *p = malloc(l); in strndup() 14 memcpy(p, s, l - 1); in strndup() 15 p[l - 1] = '\0'; in strndup()
|
| H A D | strdup.c | 10 size_t l = strlen(s) + 1; in strdup() local 11 char *p = malloc(l); in strdup() 14 memcpy(p, s, l); in strdup()
|
| /optee_os/core/lib/libtomcrypt/src/pk/ec25519/ |
| H A D | ec25519_import_pkcs8.c | 27 ltc_asn1_list *l = NULL; in ec25519_import_pkcs8() local 38 if ((err = pkcs8_decode_flexi(in, inlen, pwd, pwdlen, &l)) == CRYPT_OK) { in ec25519_import_pkcs8() 43 if ((err = der_decode_sequence_multi(l->data, l->size, in ec25519_import_pkcs8() 79 if (l) der_free_sequence_flexi(l); in ec25519_import_pkcs8()
|
| /optee_os/core/lib/libtomcrypt/src/math/ |
| H A D | radix_to_bin.c | 30 unsigned long l; in radix_to_bin() local 40 if ((l = mp_unsigned_bin_size(mpi)) > *len) { in radix_to_bin() 41 *len = l; in radix_to_bin() 45 *len = l; in radix_to_bin()
|
| /optee_os/core/lib/libtomcrypt/src/pk/rsa/ |
| H A D | rsa_import_pkcs8.c | 54 ltc_asn1_list *l = NULL; in rsa_import_pkcs8() local 78 if ((err = pkcs8_decode_flexi(in, inlen, passwd, passwdlen, &l)) != CRYPT_OK) { in rsa_import_pkcs8() 81 decrypted = l->data; in rsa_import_pkcs8() 82 decryptedlen = l->size; in rsa_import_pkcs8() 108 if (l) der_free_sequence_flexi(l); in rsa_import_pkcs8()
|
| /optee_os/lib/libutils/ext/ |
| H A D | nex_strdup.c | 11 size_t l = strlen(s) + 1; in nex_strdup() local 12 char *p = nex_malloc(l); in nex_strdup() 15 memcpy(p, s, l); in nex_strdup()
|
| /optee_os/core/arch/riscv/kernel/ |
| H A D | thread_arch.c | 233 struct thread_core_local *l = thread_get_core_local(); in __thread_alloc_and_run() local 237 assert(l->curr_thread == THREAD_ID_INVALID); in __thread_alloc_and_run() 254 l->curr_thread = n; in __thread_alloc_and_run() 261 l->flags &= ~THREAD_CLF_TMP; in __thread_alloc_and_run() 322 struct thread_core_local *l = thread_get_core_local(); in thread_get_saved_thread_sp() local 323 int ct = l->curr_thread; in thread_get_saved_thread_sp() 340 struct thread_core_local *l = thread_get_core_local(); in thread_resume_from_rpc() local 343 assert(l->curr_thread == THREAD_ID_INVALID); in thread_resume_from_rpc() 357 l->curr_thread = n; in thread_resume_from_rpc() 389 l->flags &= ~THREAD_CLF_TMP; in thread_resume_from_rpc() [all …]
|
| /optee_os/core/lib/libtomcrypt/src/ciphers/ |
| H A D | tea.c | 149 unsigned long l; in tea_test() 156 l = sizeof(key); in tea_test() 157 … if ((err = base16_decode(tests[i].key, XSTRLEN(tests[i].key), key, &l)) != CRYPT_OK) return err; in tea_test() 158 l = sizeof(ptct[0]); in tea_test() 159 … if ((err = base16_decode(tests[i].pt, XSTRLEN(tests[i].pt), ptct[0], &l)) != CRYPT_OK) return err; in tea_test() 160 l = sizeof(ptct[1]); in tea_test() 161 … if ((err = base16_decode(tests[i].ct, XSTRLEN(tests[i].ct), ptct[1], &l)) != CRYPT_OK) return err; in tea_test()
|
| H A D | blowfish.c | 302 ulong32 l, r; in s_blowfish_encipher() local 312 l = *L; in s_blowfish_encipher() 317 l ^= skey->blowfish.K[rounds++]; r ^= F(l); in s_blowfish_encipher() 318 r ^= skey->blowfish.K[rounds++]; l ^= F(r); in s_blowfish_encipher() 319 l ^= skey->blowfish.K[rounds++]; r ^= F(l); in s_blowfish_encipher() 320 r ^= skey->blowfish.K[rounds++]; l ^= F(r); in s_blowfish_encipher() 324 l ^= skey->blowfish.K[16]; in s_blowfish_encipher() 328 *R = l; in s_blowfish_encipher()
|
| /optee_os/core/lib/libtomcrypt/src/misc/ |
| H A D | compare_testvector.c | 12 static void s_print_hex(const char* what, const void* v, const unsigned long l) in s_print_hex() argument 17 for (x = 0; x < l; ) { in s_print_hex() 19 if (!(++x % 16) || x == l) { in s_print_hex()
|
| /optee_os/core/include/drivers/ |
| H A D | imx_i2c.h | 12 TEE_Result imx_i2c_write(uint8_t bid, uint8_t chip, const uint8_t *p, int l); 13 TEE_Result imx_i2c_read(uint8_t bid, uint8_t chip, uint8_t *p, int l);
|
| /optee_os/core/crypto/ |
| H A D | aes-gcm.c | 144 size_t l = len; in __gcm_update_aad() local 153 while (l) { in __gcm_update_aad() 156 l < TEE_AES_BLOCK_SIZE) { in __gcm_update_aad() 157 n = MIN(TEE_AES_BLOCK_SIZE - state->buf_pos, l); in __gcm_update_aad() 167 l -= n; in __gcm_update_aad() 171 n = l / TEE_AES_BLOCK_SIZE; in __gcm_update_aad() 176 l -= n * TEE_AES_BLOCK_SIZE; in __gcm_update_aad() 198 size_t l = len; in __gcm_update_payload() local 210 while (l) { in __gcm_update_payload() 211 if (state->buf_pos || l < TEE_AES_BLOCK_SIZE) { in __gcm_update_payload() [all …]
|
| /optee_os/core/pta/ |
| H A D | secstor_ta_mgmt.c | 106 size_t l = MIN(buf_size, nw_size - offs); in install_ta() local 108 memcpy(buf, nw + offs, l); in install_ta() 109 res = crypto_hash_update(hash_ctx, buf, l); in install_ta() 112 res = tee_tadb_ta_write(ta, buf, l); in install_ta() 115 offs += l; in install_ta()
|