Home
last modified time | relevance | path

Searched refs:key_size (Results 1 – 25 of 53) sorted by relevance

123

/optee_os/core/lib/libtomcrypt/src/pk/dh/
H A Ddh_make_key.c52 int key_size = 0; /* max key size, in bytes */ in dh_make_key() local
73 key_size = xbits / 8; in dh_make_key()
78 if (key_size) { in dh_make_key()
80 LTC_ARGCHK(key_size <= key_size_p); in dh_make_key()
81 LTC_ARGCHK((q == NULL) || (key_size <= key_size_q)); in dh_make_key()
84 key_size = MIN(key_size_p, key_size_q); in dh_make_key()
86 key_size =key_size_p; in dh_make_key()
103 buf = XMALLOC(key_size); in dh_make_key()
110 if (prng_descriptor[wprng]->read(buf, key_size, prng) != in dh_make_key()
111 (unsigned long)key_size) { in dh_make_key()
[all …]
/optee_os/core/lib/libtomcrypt/
H A Ded25519.c20 size_t key_size) in crypto_acipher_alloc_ed25519_keypair() argument
22 if (!key || key_size != ED25519_KEY_SIZE) in crypto_acipher_alloc_ed25519_keypair()
27 key->priv = calloc(1, key_size >> 3); in crypto_acipher_alloc_ed25519_keypair()
28 key->pub = calloc(1, key_size >> 3); in crypto_acipher_alloc_ed25519_keypair()
41 size_t key_size) in crypto_acipher_alloc_ed25519_public_key() argument
43 if (!key || key_size != ED25519_KEY_SIZE) in crypto_acipher_alloc_ed25519_public_key()
48 key->pub = calloc(1, key_size >> 3); in crypto_acipher_alloc_ed25519_public_key()
57 size_t key_size) in crypto_acipher_gen_ed25519_key() argument
61 if (key_size != ED25519_KEY_SIZE) in crypto_acipher_gen_ed25519_key()
68 assert(key_size >= sizeof(ltc_tmp_key.pub) && in crypto_acipher_gen_ed25519_key()
[all …]
H A Dx25519.c20 size_t key_size) in crypto_acipher_alloc_x25519_keypair() argument
22 size_t key_size_bytes = key_size / 8; in crypto_acipher_alloc_x25519_keypair()
45 size_t key_size) in crypto_acipher_gen_x25519_key() argument
48 size_t key_size_bytes = key_size / 8; in crypto_acipher_gen_x25519_key()
H A Ddh.c39 size_t xbits, size_t key_size) in crypto_acipher_gen_dh_key() argument
45 if (key_size != 8 * mp_unsigned_bin_size(key->p)) in crypto_acipher_gen_dh_key()
/optee_os/core/lib/libtomcrypt/src/pk/ecc/
H A Decc_export.c25 unsigned long key_size; in ecc_export() local
37 key_size = key->dp.size; in ecc_export()
43 LTC_ASN1_SHORT_INTEGER, 1UL, &key_size, in ecc_export()
52 LTC_ASN1_SHORT_INTEGER, 1UL, &key_size, in ecc_export()
H A Decc_import.c35 unsigned long key_size; in ecc_import_ex() local
45 LTC_ASN1_SHORT_INTEGER, 1UL, &key_size, in ecc_import_ex()
53 if ((err = ecc_set_curve_by_size(key_size, key)) != CRYPT_OK) { goto done; } in ecc_import_ex()
63 LTC_ASN1_SHORT_INTEGER, 1UL, &key_size, in ecc_import_ex()
75 LTC_ASN1_SHORT_INTEGER, 1UL, &key_size, in ecc_import_ex()
/optee_os/core/drivers/crypto/caam/acipher/
H A Dcaam_prime_rsa.c376 size_t key_size = data->key_size / 8; in do_desc_setup() local
387 caam_desc_add_word(desc, 5 * (data->key_size / 2)); in do_desc_setup()
395 if ((key_size / 2) > (MR_PRIME_SIZE / 8)) in do_desc_setup()
405 key_size / 2)); in do_desc_setup()
427 caam_desc_add_word(desc, key_size / 2); in do_desc_setup()
519 caam_desc_add_word(desc, (data->key_size / 8 / 2) - 16); in do_desc_prime()
585 caam_desc_add_word(desc, (data->key_size / 8 / 2)); in do_desc_prime()
604 FIFO_ST(CLASS_NO, PKHA_N, (data->key_size / 8 / 2))); in do_desc_prime()
634 size_t key_size) in do_checks_primes() argument
642 caam_desc_add_word(desc, FIFO_LD(CLASS_1, PKHA_B, NOACTION, key_size)); in do_checks_primes()
[all …]
H A Dcaam_dh.c100 size_t key_size = inkey->xbits / 8; in do_keypriv_conv() local
103 if (!key_size) in do_keypriv_conv()
104 key_size = crypto_bignum_num_bytes(inkey->x); in do_keypriv_conv()
106 DH_TRACE("DH Convert Private Key size %zu bytes", key_size); in do_keypriv_conv()
137 size_t key_size = 0; in do_keypub_conv() local
139 key_size = crypto_bignum_num_bytes((struct bignum *)inkey); in do_keypub_conv()
140 DH_TRACE("DH Convert Keypair size %zu bytes", key_size); in do_keypub_conv()
143 retstatus = caam_calloc_buf(&outkey->y, key_size); in do_keypub_conv()
217 struct bignum *q __unused, size_t key_size) in do_gen_keypair() argument
223 size_t n_bytes = key_size / 8; in do_gen_keypair()
[all …]
H A Dcaam_ecc.c254 static TEE_Result do_gen_keypair(struct ecc_keypair *key, size_t key_size) in do_gen_keypair() argument
266 ECC_TRACE("Generate Keypair of %zu bits", key_size); in do_gen_keypair()
269 key_size = ROUNDUP(key_size, 8); in do_gen_keypair()
289 d.sec_size = ROUNDUP_DIV(key_size, 8); in do_gen_keypair()
298 retstatus = caam_alloc_align_buf(&xy, (key_size / 8) * 2); in do_gen_keypair()
357 ECC_DUMPBUF("D", d.buf.data, key_size / 8); in do_gen_keypair()
386 static bool msg_mes_rep(size_t msg_length, size_t key_size) in msg_mes_rep() argument
389 key_size > 40; in msg_mes_rep()
403 static bool padding_required(size_t msg_length, size_t key_size) in padding_required() argument
405 return msg_mes_rep(msg_length, key_size) && msg_length < key_size; in padding_required()
[all …]
H A Dlocal.h17 size_t key_size; /* Key size in bits */ member
/optee_os/core/drivers/crypto/crypto_api/acipher/
H A Ddh.c34 size_t xbits, size_t key_size) in crypto_acipher_gen_dh_key() argument
44 if (key_size != 8 * crypto_bignum_num_bytes(key->p)) in crypto_acipher_gen_dh_key()
52 key_size, ret); in crypto_acipher_gen_dh_key()
H A Ddsa.c93 TEE_Result crypto_acipher_gen_dsa_key(struct dsa_keypair *key, size_t key_size) in crypto_acipher_gen_dsa_key() argument
100 if (!key || !key_size) { in crypto_acipher_gen_dsa_key()
102 (uintptr_t)key, key_size); in crypto_acipher_gen_dsa_key()
106 ret = get_keys_size(key_size, &l_bits, &n_bits); in crypto_acipher_gen_dsa_key()
116 key_size, ret); in crypto_acipher_gen_dsa_key()
/optee_os/core/tee/
H A Dtee_svc_cryp.c60 uint32_t key_size; member
731 key->key_size = size; in op_attr_secret_value_from_user()
743 uint64_t key_size; in op_attr_secret_value_to_user() local
749 key_size = key->key_size; in op_attr_secret_value_to_user()
750 res = copy_to_user(size, &key_size, sizeof(key_size)); in op_attr_secret_value_to_user()
754 if (s < key->key_size || !buffer) in op_attr_secret_value_to_user()
757 return copy_to_user(buffer, key + 1, key->key_size); in op_attr_secret_value_to_user()
767 res = op_u32_to_binary_helper(key->key_size, data, data_len, offs); in op_attr_secret_value_to_binary()
771 if (ADD_OVERFLOW(*offs, key->key_size, &next_offs)) in op_attr_secret_value_to_binary()
775 memcpy((uint8_t *)data + *offs, key + 1, key->key_size); in op_attr_secret_value_to_binary()
[all …]
/optee_os/core/drivers/crypto/stm32/
H A Dstm32_cryp.h52 size_t key_size; member
66 const void *key, size_t key_size, const void *iv,
H A Dstm32_saes.c536 const void *key, size_t key_size, const void *iv, in stm32_saes_init() argument
558 memcpy(local_key, key, key_size); in stm32_saes_init()
610 switch (key_size) { in stm32_saes_init()
627 switch (key_size) { in stm32_saes_init()
1130 const void *key, size_t key_size, in stm32_saes_cmac_prf_128() argument
1148 key, key_size, NULL, 0); in stm32_saes_cmac_prf_128()
1182 key_sel, key, key_size, block, in stm32_saes_cmac_prf_128()
1222 key_size, l, sizeof(l)); in stm32_saes_cmac_prf_128()
1231 const void *key, size_t key_size, in stm32_saes_kdf() argument
1267 res = stm32_saes_cmac_prf_128(ctx, key_sel, key, key_size, in stm32_saes_kdf()
H A Dstm32_saes.h64 const void *key, size_t key_size,
/optee_os/core/include/crypto/
H A Dcrypto.h219 size_t key_size);
224 TEE_Result crypto_acipher_gen_rsa_key(struct rsa_keypair *key, size_t key_size);
225 TEE_Result crypto_acipher_gen_dsa_key(struct dsa_keypair *key, size_t key_size);
227 size_t xbits, size_t key_size);
228 TEE_Result crypto_acipher_gen_ecc_key(struct ecc_keypair *key, size_t key_size);
230 size_t key_size);
232 size_t key_size);
234 size_t key_size);
/optee_os/core/drivers/crypto/ele/
H A Dele.c378 uint8_t *key, size_t key_size) in imx_ele_derive_key() argument
386 uint16_t key_size; in imx_ele_derive_key() member
401 if (key_size != 16 && key_size != 32) in imx_ele_derive_key()
408 res = imx_ele_buf_alloc(&ele_key, key, key_size); in imx_ele_derive_key()
414 cmd.key_size = key_size; in imx_ele_derive_key()
427 res = imx_ele_buf_copy(&ele_key, key, key_size); in imx_ele_derive_key()
/optee_os/lib/libmbedtls/mbedtls/library/
H A Dlmots.h94 const unsigned char *key, size_t key_size);
116 unsigned char *key, size_t key_size,
H A Dlms.c243 const unsigned char *key, size_t key_size) in mbedtls_lms_import_public_key() argument
245 if (key_size < 4) { in mbedtls_lms_import_public_key()
255 if (key_size != MBEDTLS_LMS_PUBLIC_KEY_LEN(ctx->params.type)) { in mbedtls_lms_import_public_key()
278 size_t key_size, size_t *key_len) in mbedtls_lms_export_public_key() argument
280 if (key_size < MBEDTLS_LMS_PUBLIC_KEY_LEN(ctx->params.type)) { in mbedtls_lms_export_public_key()
/optee_os/scripts/
H A Dsign_helper_kms.py39 def key_size(self): member in _RSAPrivateKeyInKMS
40 return self.public_key.key_size
/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/
H A Dlms.h271 const unsigned char *key, size_t key_size);
297 unsigned char *key, size_t key_size,
/optee_os/core/drivers/crypto/hisilicon/
H A Dhpre_montgomery.c97 size_t key_size = BITS_TO_BYTES(size_bits); in hpre_montgomery_alloc_keypair() local
105 key->priv = calloc(1, key_size); in hpre_montgomery_alloc_keypair()
109 key->pub = calloc(1, key_size); in hpre_montgomery_alloc_keypair()
125 size_t key_size = BITS_TO_BYTES(key_bits); in gen_random_privkey() local
133 ret = hw_get_random_bytes(priv, key_size); in gen_random_privkey()
/optee_os/lib/libmbedtls/core/
H A Ddh.c47 size_t xbits, size_t key_size) in crypto_acipher_gen_dh_key() argument
63 if (key_size != 8 * len) { in crypto_acipher_gen_dh_key()
/optee_os/core/crypto/
H A Dcrypto.c573 size_t key_size __unused) in crypto_acipher_gen_rsa_key()
660 size_t key_size __unused) in crypto_acipher_gen_dsa_key()
696 size_t key_size __unused) in crypto_acipher_gen_dh_key()
847 size_t key_size __unused) in crypto_acipher_gen_x25519_key()
872 size_t key_size __unused) in crypto_acipher_gen_x448_key()
898 size_t key_size __unused) in crypto_acipher_alloc_ed25519_public_key()
904 size_t key_size __unused) in crypto_acipher_gen_ed25519_key()

123