| /optee_os/core/lib/libtomcrypt/src/prngs/ |
| H A D | rng_make_prng.c | 28 unsigned long bytes; in rng_make_prng() local 39 bytes = prng_descriptor[wprng]->export_size; in rng_make_prng() 43 bytes = (unsigned long)((bits+7)/8) * 2; in rng_make_prng() 50 buf = XMALLOC(bytes); in rng_make_prng() 55 if (rng_get_bytes(buf, bytes, callback) != bytes) { in rng_make_prng() 61 if ((err = prng_descriptor[wprng]->pimport(buf, bytes, prng)) != CRYPT_OK) { in rng_make_prng() 65 if ((err = prng_descriptor[wprng]->add_entropy(buf, bytes, prng)) != CRYPT_OK) { in rng_make_prng() 75 zeromem(buf, bytes); in rng_make_prng()
|
| /optee_os/core/lib/libtomcrypt/src/math/ |
| H A D | rand_bn.c | 12 int res, bytes; in rand_bn_bits() local 21 bytes = (bits+7) >> 3; in rand_bn_bits() 25 if ((buf = XCALLOC(1, bytes)) == NULL) return CRYPT_MEM; in rand_bn_bits() 28 if (prng_descriptor[wprng]->read(buf, bytes, prng) != (unsigned long)bytes) { in rand_bn_bits() 35 if ((res = mp_read_unsigned_bin(N, buf, bytes)) != CRYPT_OK) goto cleanup; in rand_bn_bits() 41 zeromem(buf, bytes); in rand_bn_bits()
|
| /optee_os/core/arch/arm/kernel/ |
| H A D | tee_time_arm_cntpct.c | 49 int bytes = 0, n; in plat_prng_add_jitter_entropy() local 55 bytes = 2; in plat_prng_add_jitter_entropy() 64 bytes = 1; in plat_prng_add_jitter_entropy() 67 if (bytes) { in plat_prng_add_jitter_entropy() 68 FMSG("0x%02X", (int)acc & ((1 << (bytes * 8)) - 1)); in plat_prng_add_jitter_entropy() 69 crypto_rng_add_event(sid, pnum, (uint8_t *)&acc, bytes); in plat_prng_add_jitter_entropy()
|
| /optee_os/core/drivers/crypto/stm32/ |
| H A D | ecc.c | 76 size_t bytes = 0; in stm32_gen_keypair() local 86 res = stm32_pka_get_max_size(&bytes, NULL, cid); in stm32_gen_keypair() 90 if (size_bits > bytes * 8 || in stm32_gen_keypair() 91 crypto_bignum_num_bytes(key->d) > bytes || in stm32_gen_keypair() 92 crypto_bignum_num_bytes(key->x) > bytes || in stm32_gen_keypair() 93 crypto_bignum_num_bytes(key->y) > bytes) in stm32_gen_keypair() 96 d.val = calloc(1, bytes); in stm32_gen_keypair() 97 d.size = bytes; in stm32_gen_keypair() 108 pk.x.val = calloc(1, bytes); in stm32_gen_keypair() 109 pk.x.size = bytes; in stm32_gen_keypair() [all …]
|
| H A D | stm32_pka.h | 44 TEE_Result stm32_pka_get_max_size(size_t *bytes, size_t *bits,
|
| /optee_os/scripts/ |
| H A D | gen_stmm_hex.py | 31 bytes = inf.read() 32 uncompressed_size = len(bytes) 33 bytes = zlib.compress(bytes) 34 size = len(bytes) 42 outf.write('0x{:02x},'.format(bytes[i]))
|
| H A D | bin_to_c.py | 41 bytes = indata.read() 43 bytes += b'\0' 44 size = len(bytes) 60 if args.text and i != size - 1 and bytes[i] == b'\0': 63 f.write(hex(bytes[i]) + ',')
|
| H A D | sign_helper_kms.py | 45 def sign(self, data: bytes, padding: AsymmetricPadding, argument 48 ) -> bytes: 86 def decrypt(self, ciphertext: bytes, padding: AsymmetricPadding) -> bytes: argument 97 ) -> bytes:
|
| H A D | ts_bin_to_c.py | 108 bytes = _ts.read() 109 uncompressed_size = len(bytes) 111 bytes = zlib.compress(bytes) 112 size = len(bytes) 118 f.write(hex(bytes[i]) + ',')
|
| H A D | derive_rpmb_key.py | 12 h = bytes.fromhex(str) 16 h = bytes.fromhex('0' + str) 87 key = bytes.fromhex('''D3 EB 3E C3 6E 33 4C 9F
|
| H A D | sign_encrypt.py | 46 h.update(namespace_bytes + bytes(name, 'utf-8')) 48 return UUID(bytes=digest[:16], version=5) 397 cipher = AESGCM(bytes.fromhex(enc_key)) 410 self.ta_uuid = uuid.bytes 419 self.ta_uuid = uuid.bytes 455 def int_to_bytes(x: int) -> bytes: 469 self.img = uuid.bytes + shdr_subkey + n_bytes + e_bytes 583 print(' uuid: {}'.format(uuid.UUID(bytes=ta_uuid))) 714 print(' uuid: {}'.format(uuid.UUID(bytes=img_uuid))) 727 cipher = AESGCM(bytes.fromhex(enc_key)) [all …]
|
| /optee_os/core/drivers/crypto/se050/glue/ |
| H A D | i2c.c | 15 static TEE_Result (*transfer)(struct rpc_i2c_request *req, size_t *bytes); 27 size_t bytes = 0; in i2c_transfer() local 31 if ((*transfer)(&request, &bytes) == TEE_SUCCESS) in i2c_transfer() 32 return bytes; in i2c_transfer()
|
| H A D | i2c_imx.c | 12 size_t *bytes) in native_i2c_transfer() argument 24 *bytes = req->buffer_len; in native_i2c_transfer()
|
| H A D | i2c_stm32.c | 19 TEE_Result native_i2c_transfer(struct rpc_i2c_request *req, size_t *bytes) in native_i2c_transfer() argument 31 *bytes = req->buffer_len; in native_i2c_transfer()
|
| /optee_os/core/drivers/crypto/versal/ |
| H A D | ecc.c | 84 static TEE_Result ecc_get_key_size(uint32_t curve, size_t *bytes, size_t *bits) in ecc_get_key_size() argument 89 *bytes = 48; in ecc_get_key_size() 93 *bytes = 66; in ecc_get_key_size() 115 size_t bytes = 0; in crypto_bignum_bn2bin_eswap() local 118 if (ecc_get_key_size(curve, &bytes, &bits)) in crypto_bignum_bn2bin_eswap() 121 crypto_bignum_bn2bin(from, pad + bytes - len); in crypto_bignum_bn2bin_eswap() 122 memcpy_swp(to, pad, bytes); in crypto_bignum_bn2bin_eswap() 158 size_t bytes = 0; in verify() local 164 ret = ecc_get_key_size(key->curve, &bytes, &bits); in verify() 177 versal_mbox_alloc(bytes * 2, NULL, &x); in verify() [all …]
|
| /optee_os/core/arch/arm/plat-telechips/scripts/ |
| H A D | tcmktool.py | 31 imagename = bytes(argv[3], 'utf-8') 32 imageversion = bytes(argv[4], 'utf-8') 34 socname = bytes(argv[6], 'utf-8')
|
| /optee_os/core/drivers/crypto/se050/core/ |
| H A D | ecc.c | 135 size_t *bytes, size_t *bits) in ecc_get_key_size() argument 140 *bytes = 24; in ecc_get_key_size() 144 *bytes = 28; in ecc_get_key_size() 148 *bytes = 32; in ecc_get_key_size() 152 *bytes = 48; in ecc_get_key_size() 156 *bytes = 66; in ecc_get_key_size() 640 size_t bytes = 0; in gen_keypair() local 643 ret = ecc_get_key_size(key->curve, 0, &bytes, &bits); in gen_keypair() 672 bytes = sizeof(kf); in gen_keypair() 674 &bytes); in gen_keypair() [all …]
|
| /optee_os/core/include/tee/ |
| H A D | tadb.h | 38 size_t pos, uint8_t **data, size_t bytes); 40 size_t *bytes);
|
| /optee_os/core/drivers/ |
| H A D | zynqmp_pm.c | 81 .bytes = ZYNQMP_EFUSE_##__x##_LENGTH, \ 86 uint32_t bytes; member 135 efuse_op->size = efuse_tbl[id].bytes / sizeof(uint32_t); in efuse_op()
|
| /optee_os/core/drivers/crypto/se050/glue/include/ |
| H A D | i2c_native.h | 13 size_t *bytes);
|
| /optee_os/core/tee/ |
| H A D | tee_svc_storage.c | 86 size_t bytes; in tee_svc_storage_read_head() local 99 bytes = sizeof(struct tee_svc_storage_head); in tee_svc_storage_read_head() 100 res = fops->read(o->fh, 0, &head, NULL, &bytes); in tee_svc_storage_read_head() 116 if (bytes != sizeof(struct tee_svc_storage_head)) { in tee_svc_storage_read_head() 135 bytes = head.attr_size; in tee_svc_storage_read_head() 137 attr, NULL, &bytes); in tee_svc_storage_read_head() 140 if (bytes != head.attr_size) { in tee_svc_storage_read_head() 723 size_t bytes = 0; in syscall_storage_obj_read() local 747 bytes = len; in syscall_storage_obj_read() 752 res = o->pobj->fops->read(o->fh, pos_tmp, NULL, data, &bytes); in syscall_storage_obj_read() [all …]
|
| H A D | tee_rpmb_fs.c | 344 static void u32_to_bytes(uint32_t u32, uint8_t *bytes) in u32_to_bytes() argument 346 *bytes = (uint8_t) (u32 >> 24); in u32_to_bytes() 347 *(bytes + 1) = (uint8_t) (u32 >> 16); in u32_to_bytes() 348 *(bytes + 2) = (uint8_t) (u32 >> 8); in u32_to_bytes() 349 *(bytes + 3) = (uint8_t) u32; in u32_to_bytes() 352 static void bytes_to_u32(uint8_t *bytes, uint32_t *u32) in bytes_to_u32() argument 354 *u32 = (uint32_t) ((*(bytes) << 24) + in bytes_to_u32() 355 (*(bytes + 1) << 16) + in bytes_to_u32() 356 (*(bytes + 2) << 8) + (*(bytes + 3))); in bytes_to_u32() 359 static void u16_to_bytes(uint16_t u16, uint8_t *bytes) in u16_to_bytes() argument [all …]
|
| /optee_os/core/include/kernel/ |
| H A D | rpc_io_i2c.h | 36 TEE_Result rpc_io_i2c_transfer(struct rpc_i2c_request *p, size_t *bytes);
|
| /optee_os/lib/libmbedtls/mbedtls/library/ |
| H A D | psa_crypto.c | 723 slot->key.bytes = buffer_length; in psa_allocate_buffer_to_slot() 1187 if (slot->key.bytes > 0) { in psa_remove_key_data_from_memory() 1192 mbedtls_zeroize_and_free(slot->key.data, slot->key.bytes); in psa_remove_key_data_from_memory() 1198 slot->key.bytes = 0; in psa_remove_key_data_from_memory() 1540 slot->key.data, slot->key.bytes, in psa_export_key() 1657 &slot->attr, slot->key.data, slot->key.bytes, in psa_export_public_key() 1951 slot->key.bytes); in psa_finish_key_creation() 2112 if (slot->key.bytes == 0) { in psa_import_key() 2130 slot->key.bytes, in psa_import_key() 2131 &slot->key.bytes, &bits); in psa_import_key() [all …]
|
| /optee_os/core/pta/tests/ |
| H A D | fs_htree.c | 119 size_t *bytes) in test_read_final() argument 126 *bytes = sz; in test_read_final() 128 *bytes = a->data_len - offs; in test_read_final() 130 *bytes = 0; in test_read_final() 132 memcpy(a->block, a->data + offs, *bytes); in test_read_final()
|