/optee_os/core/drivers/crypto/crypto_api/math/ |
A D | modulus.c | 19 if (!data->a.data || !data->a.length || !data->b.data || in drvcrypt_xor_mod_n() 20 !data->b.length || !data->result.data || !data->result.length || in drvcrypt_xor_mod_n() 24 if (data->result.length < data->n.length) in drvcrypt_xor_mod_n() 36 min = MIN(data->a.length, data->b.length); in drvcrypt_xor_mod_n() 40 data->result.data[idx] = in drvcrypt_xor_mod_n() 41 data->a.data[idx] ^ data->b.data[idx]; in drvcrypt_xor_mod_n() 46 memcpy(&data->result.data[idx], in drvcrypt_xor_mod_n() 47 &data->a.data[idx], in drvcrypt_xor_mod_n() 50 memcpy(&data->result.data[idx], in drvcrypt_xor_mod_n() 51 &data->b.data[idx], in drvcrypt_xor_mod_n() [all …]
|
/optee_os/core/arch/arm/plat-marvell/armada3700/ |
A D | hal_sec_perf.c | 66 #define TZ_IS_VALID(data) ((data) & (0x1)) argument 67 #define TZ_SET_VALID(data) ((data) |= (0x1)) argument 69 #define TZ_GET_PERM(data, ret) ((ret) = (((data) & (0x3 << 1)) >> 1)) argument 72 (data) &= (~(0x3 << 1)); \ 76 #define TZ_GET_RZ_EN(data, ret) ((ret) = (((data) & (0x1 << 3)) >> 3)) argument 79 (data) &= (~(0x1 << 3)); \ 83 #define TZ_GET_AREA_LEN_CODE(data, ret) ((ret) = (((data) & (0x1F << 8)) >> 8)) argument 100 #define TZ_GET_UR_PERM(data, val) ((ret) = (((data) & (0x3 << 4)) >> 4)) argument 152 uint32_t data; in set_range() local 183 TZ_SET_VALID(data); in set_range() [all …]
|
/optee_os/core/kernel/ |
A D | ubsan.c | 117 print_loc(__func__, &data->loc); in __ubsan_handle_type_mismatch() 126 print_loc(__func__, &data->loc); in __ubsan_handle_add_overflow() 135 print_loc(__func__, &data->loc); in __ubsan_handle_sub_overflow() 144 print_loc(__func__, &data->loc); in __ubsan_handle_mul_overflow() 152 print_loc(__func__, &data->loc); in __ubsan_handle_negate_overflow() 161 print_loc(__func__, &data->loc); in __ubsan_handle_divrem_overflow() 170 print_loc(__func__, &data->loc); in __ubsan_handle_shift_out_of_bounds() 178 print_loc(__func__, &data->loc); in __ubsan_handle_out_of_bounds() 185 print_loc(__func__, &data->loc); in __ubsan_handle_unreachable() 192 print_loc(__func__, &data->loc); in __ubsan_handle_missing_return() [all …]
|
/optee_os/core/arch/arm/plat-marvell/armada7k8k/ |
A D | hal_sec_perf.c | 65 #define TZ_IS_VALID(data) ((data) & (0x1)) argument 66 #define TZ_SET_VALID(data) ((data) |= (0x1)) argument 68 #define TZ_GET_PERM(data, ret) ((ret) = (((data) & (0x3 << 1)) >> 1)) argument 71 (data) &= (~(0x3 << 1)); \ 75 #define TZ_GET_RZ_EN(data, ret) ((ret) = (((data) & (0x1 << 3)) >> 3)) argument 78 (data) &= (~(0x1 << 3)); \ 82 #define TZ_GET_AREA_LEN_CODE(data, ret) ((ret) = (((data) & (0x1F << 7)) >> 7)) argument 99 #define TZ_GET_UR_PERM(data, val) ((ret) = (((data) & (0x3 << 4)) >> 4)) argument 154 uint32_t data; in set_range() local 192 TZ_SET_VALID(data); in set_range() [all …]
|
/optee_os/core/drivers/crypto/caam/acipher/ |
A D | caam_prime_rsa.c | 355 prime->data = (uint8_t *)smallprimes[idx].data; in search_smallprime() 731 cache_operation(TEE_CACHEFLUSH, data->p->data, data->p->length); in run_primes() 734 cache_operation(TEE_CACHEFLUSH, data->q->data, data->q->length); in run_primes() 747 cache_operation(TEE_CACHEINVALIDATE, data->p->data, in run_primes() 749 cache_operation(TEE_CACHEINVALIDATE, data->q->data, in run_primes() 752 RSA_DUMPBUF("Prime P", data->p->data, data->p->length); in run_primes() 753 RSA_DUMPBUF("Prime Q", data->q->data, data->q->length); in run_primes() 757 cache_operation(TEE_CACHEINVALIDATE, data->p->data, in run_primes() 760 RSA_DUMPBUF("Prime", data->p->data, data->p->length); in run_primes() 823 data->p->length, data->key_size, data->era); in caam_prime_rsa_gen() [all …]
|
A D | caam_rsa.c | 811 maskedSeed.data = &EM.data[1]; in do_oaep_decoding() 830 mgf_data.mask.data = seed.data; in do_oaep_decoding() 846 mod_op.b.data = seed.data; in do_oaep_decoding() 878 mod_op.a.data = maskedDB.data; in do_oaep_decoding() 880 mod_op.b.data = dbMask.data; in do_oaep_decoding() 882 mod_op.result.data = DB.data; in do_oaep_decoding() 997 lHash.data = DB.data; in do_oaep_encoding() 1085 mod_op.a.data = DB.data; in do_oaep_encoding() 1087 mod_op.b.data = dbMask.data; in do_oaep_encoding() 1103 maskedSeed.data = &EM.data[1]; in do_oaep_encoding() [all …]
|
A D | caam_math.c | 25 static TEE_Result do_xor_mod_n(struct drvcrypt_mod_op *data) in do_xor_mod_n() argument 37 ret = caam_dmaobj_input_sgtbuf(&data_a, data->a.data, data->a.length); in do_xor_mod_n() 41 ret = caam_dmaobj_input_sgtbuf(&data_b, data->b.data, data->b.length); in do_xor_mod_n() 49 ret = caam_dmaobj_output_sgtbuf(&res, data->result.data, in do_xor_mod_n() 50 data->result.length, in do_xor_mod_n() 51 data->result.length); in do_xor_mod_n() 71 caam_desc_add_word(desc, data->n.length); in do_xor_mod_n() 94 RSA_DUMPBUF("Output", data->result.data, data->result.length); in do_xor_mod_n()
|
/optee_os/core/drivers/crypto/crypto_api/acipher/ |
A D | rsassa.c | 217 rsa_data.cipher.data = EM.data; in rsassa_pkcs1_v1_5_sign() 251 if (!EM.data || !EM_gen.data) { in rsassa_pkcs1_v1_5_verify() 270 rsa_data.cipher.data = EM.data; in rsassa_pkcs1_v1_5_verify() 401 hash.data = &EM->data[db_size]; in emsa_pss_encode() 439 dbMask.data = EM->data; in emsa_pss_encode() 444 mgf_data.seed.data = hash.data; in emsa_pss_encode() 462 mod_op.a.data = DB.data; in emsa_pss_encode() 464 mod_op.b.data = dbMask.data; in emsa_pss_encode() 576 hash.data = &EM->data[db_size]; in emsa_pss_verify() 587 mgf_data.seed.data = hash.data; in emsa_pss_verify() [all …]
|
/optee_os/scripts/ |
A D | tee_bin_parser.py | 23 data = f.read(4) 24 magic = struct.unpack('<I', data)[0] 27 data = f.read(1) 31 data = f.read(1) 35 data = f.read(2) 36 flags = struct.unpack('<H', data)[0] 39 data = f.read(4) 43 data = f.read(4) 47 data = f.read(4) 51 data = f.read(4) [all …]
|
/optee_os/core/drivers/crypto/caam/cipher/ |
A D | caam_cipher_xts.c | 27 tmptmp = buf->data[idx] >> 7; in do_galois_mult() 28 buf->data[idx] = (buf->data[idx] << 1) | tmp; in do_galois_mult() 33 buf->data[0] ^= 0x87; in do_galois_mult() 58 tmp->orig.data[idx] = srcbuf->data[idx] ^ enc_tweak->data[idx]; in do_tweak_block() 69 dstbuf->data[idx] = tmp->orig.data[idx] ^ enc_tweak->data[idx]; in do_tweak_block() 157 srcbuf.data = dupdate->src.data; in caam_cipher_update_xts() 161 dstbuf.data = dupdate->dst.data; in caam_cipher_update_xts() 203 memcpy(tmpsrc.data, enc_tweak.orig.data, in caam_cipher_update_xts() 221 tmpsrc.data[idx] = in caam_cipher_update_xts() 224 tmpdst.orig.data[idx]; in caam_cipher_update_xts() [all …]
|
/optee_os/core/drivers/ |
A D | ls_dspi.c | 199 uint16_t data) in dspi_tx() argument 203 uint32_t dspi_val = ctrl | data; in dspi_tx() 277 *spi_rd++ = dspi_rx(data); in ls_dspi_txrx8() 280 dspi_rx(data); in ls_dspi_txrx8() 283 *spi_rd++ = dspi_rx(data); in ls_dspi_txrx8() 330 *spi_rd++ = dspi_rx(data); in ls_dspi_txrx16() 333 dspi_rx(data); in ls_dspi_txrx16() 336 *spi_rd++ = dspi_rx(data); in ls_dspi_txrx16() 374 dspi_rx(data); in ls_dspi_end() 522 dspi_config_slave_state(data, data->slave_cs, data->slave_speed_max_hz, in ls_dspi_configure() [all …]
|
/optee_os/core/drivers/imx/dcp/ |
A D | dcp.c | 348 if (!init || !data) in dcp_cipher_do_init() 396 data->initialized = true; in dcp_cipher_do_init() 412 if (!data->initialized) { in dcp_cipher_do_update() 437 memcpy(data->payload.data, data->key, DCP_AES128_KEY_SIZE); in dcp_cipher_do_update() 440 memcpy(data->payload.data + DCP_AES128_KEY_SIZE, data->iv, in dcp_cipher_do_update() 450 cache_operation(TEE_CACHECLEAN, data->payload.data, in dcp_cipher_do_update() 451 data->payload_size); in dcp_cipher_do_update() 473 if (data) in dcp_cipher_do_final() 557 memcpy(input.data, hashdata->ctx.data, hashdata->ctx_size); in dcp_sha_do_update() 558 memcpy(input.data + hashdata->ctx_size, data, offset); in dcp_sha_do_update() [all …]
|
/optee_os/core/drivers/crypto/caam/utils/ |
A D | utils_sgt.c | 123 if (data->sgt_type) in caam_sgtbuf_free() 124 caam_free(data->sgt); in caam_sgtbuf_free() 126 caam_free(data->buf); in caam_sgtbuf_free() 128 data->sgt = NULL; in caam_sgtbuf_free() 129 data->buf = NULL; in caam_sgtbuf_free() 136 if (!data || !data->number) in caam_sgtbuf_alloc() 139 if (data->sgt_type) { in caam_sgtbuf_alloc() 143 data->buf = (void *)(((uint8_t *)data->sgt) + in caam_sgtbuf_alloc() 146 data->buf = caam_calloc(data->number * sizeof(struct caambuf)); in caam_sgtbuf_alloc() 147 data->sgt = NULL; in caam_sgtbuf_alloc() [all …]
|
/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/choice/ |
A D | der_decode_choice.c | 31 void *data; in der_decode_choice() local 50 data = list[x].data; in der_decode_choice() 54 if (der_decode_boolean(in, *inlen, data) == CRYPT_OK) { in der_decode_choice() 64 if (der_decode_integer(in, *inlen, data) == CRYPT_OK) { in der_decode_choice() 65 if (der_length_integer(data, &z) == CRYPT_OK) { in der_decode_choice() 74 if (der_decode_short_integer(in, *inlen, data) == CRYPT_OK) { in der_decode_choice() 148 if (der_length_ia5_string(data, size, &z) == CRYPT_OK) { in der_decode_choice() 170 if (der_length_utf8_string(data, size, &z) == CRYPT_OK) { in der_decode_choice() 181 if (der_decode_utctime(in, &z, data) == CRYPT_OK) { in der_decode_choice() 190 if (der_decode_generalizedtime(in, &z, data) == CRYPT_OK) { in der_decode_choice() [all …]
|
/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/sequence/ |
A D | der_decode_sequence_flexi.c | 139 l->data = XCALLOC(1, sizeof(int)); in der_decode_sequence_flexi() 158 if ((err = mp_init(&l->data)) != CRYPT_OK) { in der_decode_sequence_flexi() 182 if ((l->data = XCALLOC(1, l->size)) == NULL) { in der_decode_sequence_flexi() 205 if ((l->data = XCALLOC(1, l->size)) == NULL) { in der_decode_sequence_flexi() 232 l->data = NULL; in der_decode_sequence_flexi() 265 l->data = realloc_tmp; in der_decode_sequence_flexi() 300 if ((l->data = XCALLOC(1, l->size)) == NULL) { in der_decode_sequence_flexi() 323 if ((l->data = XCALLOC(1, l->size)) == NULL) { in der_decode_sequence_flexi() 346 if ((l->data = XCALLOC(1, l->size)) == NULL) { in der_decode_sequence_flexi() 432 if ((l->data = XMALLOC(len)) == NULL) { in der_decode_sequence_flexi() [all …]
|
A D | der_encode_sequence_ex.c | 35 void *data; in der_encode_sequence_ex() local 67 data = list[i].data; in der_encode_sequence_ex() 76 if ((err = der_encode_boolean(*((int *)data), out + x, &z)) != CRYPT_OK) { in der_encode_sequence_ex() 83 if ((err = der_encode_integer(data, out + x, &z)) != CRYPT_OK) { in der_encode_sequence_ex() 97 if ((err = der_encode_bit_string(data, size, out + x, &z)) != CRYPT_OK) { in der_encode_sequence_ex() 131 if ((err = der_encode_ia5_string(data, size, out + x, &z)) != CRYPT_OK) { in der_encode_sequence_ex() 145 if ((err = der_encode_utf8_string(data, size, out + x, &z)) != CRYPT_OK) { in der_encode_sequence_ex() 152 if ((err = der_encode_utctime(data, out + x, &z)) != CRYPT_OK) { in der_encode_sequence_ex() 159 if ((err = der_encode_generalizedtime(data, out + x, &z)) != CRYPT_OK) { in der_encode_sequence_ex() 166 if ((err = der_encode_set(data, size, out + x, &z)) != CRYPT_OK) { in der_encode_sequence_ex() [all …]
|
A D | der_length_sequence.c | 38 void *data; in der_length_sequence_ex() local 48 data = list[i].data; in der_length_sequence_ex() 66 if ((err = der_length_integer(data, &x)) != CRYPT_OK) { in der_length_sequence_ex() 99 if ((err = der_length_object_identifier(data, size, &x)) != CRYPT_OK) { in der_length_sequence_ex() 106 if ((err = der_length_ia5_string(data, size, &x)) != CRYPT_OK) { in der_length_sequence_ex() 113 if ((err = der_length_teletex_string(data, size, &x)) != CRYPT_OK) { in der_length_sequence_ex() 120 if ((err = der_length_printable_string(data, size, &x)) != CRYPT_OK) { in der_length_sequence_ex() 127 if ((err = der_length_utctime(data, &x)) != CRYPT_OK) { in der_length_sequence_ex() 134 if ((err = der_length_generalizedtime(data, &x)) != CRYPT_OK) { in der_length_sequence_ex() 141 if ((err = der_length_utf8_string(data, size, &x)) != CRYPT_OK) { in der_length_sequence_ex() [all …]
|
/optee_os/core/drivers/crypto/crypto_api/authenc/ |
A D | authenc.c | 124 if (!data && len) { in authenc_update_aad() 132 .aad.data = (uint8_t *)data, in authenc_update_aad() 164 if (!data && len) { in authenc_update_payload() 173 .src.data = (uint8_t *)data, in authenc_update_payload() 175 .dst.data = dst, in authenc_update_payload() 210 if (!data && len) { in authenc_enc_final() 218 .src.data = (uint8_t *)data, in authenc_enc_final() 220 .dst.data = dst, in authenc_enc_final() 222 .tag.data = tag, in authenc_enc_final() 266 .src.data = (uint8_t *)data, in authenc_dec_final() [all …]
|
/optee_os/ta/pkcs11/src/ |
A D | sanitize_object.c | 52 void **data) in read_attr_advance() argument 65 *data = b + data_pos; in read_attr_advance() 82 void *data = NULL; in sanitize_class_and_type() local 177 void *data = NULL; in sanitize_boolprops() local 228 char *data) in sanitize_indirect_attr() argument 258 void *data = NULL; in sanitize_client_object() local 335 uint8_t data[4] = { 0 }; in __trace_attributes() local 361 prefix, data[0], data[1]); in __trace_attributes() 365 prefix, data[0], data[1], data[2]); in __trace_attributes() 369 prefix, data[0], data[1], data[2], data[3]); in __trace_attributes() [all …]
|
/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/custom_type/ |
A D | der_encode_custom_type.c | 38 void *data; in der_encode_custom_type() local 69 list = root->data; in der_encode_custom_type() 88 data = list[i].data; in der_encode_custom_type() 97 if ((err = der_encode_boolean(*((int *)data), out + x, &z)) != CRYPT_OK) { in der_encode_custom_type() 104 if ((err = der_encode_integer(data, out + x, &z)) != CRYPT_OK) { in der_encode_custom_type() 118 if ((err = der_encode_bit_string(data, size, out + x, &z)) != CRYPT_OK) { in der_encode_custom_type() 152 if ((err = der_encode_ia5_string(data, size, out + x, &z)) != CRYPT_OK) { in der_encode_custom_type() 173 if ((err = der_encode_utctime(data, out + x, &z)) != CRYPT_OK) { in der_encode_custom_type() 180 if ((err = der_encode_generalizedtime(data, out + x, &z)) != CRYPT_OK) { in der_encode_custom_type() 187 if ((err = der_encode_set(data, size, out + x, &z)) != CRYPT_OK) { in der_encode_custom_type() [all …]
|
A D | der_decode_custom_type.c | 59 void *data; in der_decode_custom_type_ex() local 105 list = root->data; in der_decode_custom_type_ex() 152 data = list[i].data; in der_decode_custom_type_ex() 178 if ((err = der_decode_integer(in + x, z, data)) != CRYPT_OK) { in der_decode_custom_type_ex() 182 if ((err = der_length_integer(data, &z)) != CRYPT_OK) { in der_decode_custom_type_ex() 275 if ((err = der_length_ia5_string(data, size, &z)) != CRYPT_OK) { in der_decode_custom_type_ex() 306 if ((err = der_decode_utctime(in + x, &z, data)) != CRYPT_OK) { in der_decode_custom_type_ex() 322 if ((err = der_decode_set(in + x, z, data, size)) != CRYPT_OK) { in der_decode_custom_type_ex() 326 if ((err = der_length_sequence(data, size, &z)) != CRYPT_OK) { in der_decode_custom_type_ex() 340 err = der_decode_sequence_ex(in + x, z, data, size, flags); in der_decode_custom_type_ex() [all …]
|
A D | der_length_custom_type.c | 36 void *data; in der_length_custom_type() local 51 list = root->data; in der_length_custom_type() 61 data = list[i].data; in der_length_custom_type() 79 if ((err = der_length_integer(data, &x)) != CRYPT_OK) { in der_length_custom_type() 119 if ((err = der_length_ia5_string(data, size, &x)) != CRYPT_OK) { in der_length_custom_type() 126 if ((err = der_length_teletex_string(data, size, &x)) != CRYPT_OK) { in der_length_custom_type() 133 if ((err = der_length_printable_string(data, size, &x)) != CRYPT_OK) { in der_length_custom_type() 140 if ((err = der_length_utctime(data, &x)) != CRYPT_OK) { in der_length_custom_type() 147 if ((err = der_length_generalizedtime(data, &x)) != CRYPT_OK) { in der_length_custom_type() 154 if ((err = der_length_utf8_string(data, size, &x)) != CRYPT_OK) { in der_length_custom_type() [all …]
|
/optee_os/core/lib/libtomcrypt/src/misc/padding/ |
A D | padding_depad.c | 24 int padding_depad(const unsigned char *data, unsigned long *length, unsigned long mode) in padding_depad() argument 30 LTC_ARGCHK(data != NULL); in padding_depad() 38 pad = data[padded_length - 1]; in padding_depad() 55 if (data[n] != pad) return CRYPT_INVALID_PACKET; in padding_depad() 64 while (unpadded_length > 0 && data[unpadded_length - 1] != 0x80) { in padding_depad() 65 if (data[unpadded_length - 1] != 0x0) return CRYPT_INVALID_PACKET; in padding_depad() 70 if (data[unpadded_length] != 0x80) return CRYPT_INVALID_PACKET; in padding_depad() 74 while (unpadded_length > 0 && data[unpadded_length - 1] == 0x0) { in padding_depad() 79 if (data[unpadded_length] != 0x0) return CRYPT_INVALID_PACKET; in padding_depad()
|
A D | padding_pad.c | 86 int padding_pad(unsigned char *data, unsigned long length, unsigned long* padded_length, unsigned l… in padding_pad() argument 92 LTC_ARGCHK(data != NULL); in padding_pad() 120 XMEMSET(&data[length], diff, diff); in padding_pad() 124 if (rng_get_bytes(&data[length], diff-1, NULL) != diff-1) { in padding_pad() 127 data[l-1] = diff; in padding_pad() 131 XMEMSET(&data[length], 0, diff-1); in padding_pad() 132 data[l-1] = diff; in padding_pad() 135 XMEMSET(&data[length + 1], 0, diff); in padding_pad() 136 data[length] = 0x80; in padding_pad() 140 XMEMSET(&data[length], 0, diff); in padding_pad()
|
/optee_os/lib/libmbedtls/mbedtls/library/ |
A D | entropy_poll.c | 65 ((void) data); in mbedtls_platform_entropy_poll() 164 int mbedtls_platform_entropy_poll( void *data, in mbedtls_platform_entropy_poll() argument 170 ((void) data); in mbedtls_platform_entropy_poll() 218 int mbedtls_null_entropy_poll( void *data, in mbedtls_null_entropy_poll() argument 221 ((void) data); in mbedtls_null_entropy_poll() 235 int mbedtls_hardclock_poll( void *data, in mbedtls_hardclock_poll() argument 239 ((void) data); in mbedtls_hardclock_poll() 253 int mbedtls_havege_poll( void *data, in mbedtls_havege_poll() argument 256 mbedtls_havege_state *hs = (mbedtls_havege_state *) data; in mbedtls_havege_poll() 269 int mbedtls_nv_seed_poll( void *data, in mbedtls_nv_seed_poll() argument [all …]
|