Home
last modified time | relevance | path

Searched refs:key_bytes (Results 1 – 9 of 9) sorted by relevance

/optee_os/core/drivers/crypto/hisilicon/
H A Dhpre_ecc.c45 #define HPRE_ECC_DH_TOTAL_BUF_SIZE(key_bytes) ((key_bytes) * 8) argument
46 #define HPRE_ECC_SIGN_TOTAL_BUF_SIZE(key_bytes) ((key_bytes) * 11) argument
47 #define HPRE_ECC_VERIFY_TOTAL_BUF_SIZE(key_bytes) ((key_bytes) * 11) argument
48 #define HPRE_SM2_ENC_TOTAL_BUF_SIZE(key_bytes, sm2_mlen) \ argument
49 ((key_bytes) * 12 + (sm2_mlen) * 2)
50 #define HPRE_SM2_DEC_TOTAL_BUF_SIZE(key_bytes, sm2_mlen) \ argument
51 ((key_bytes) * 7 + (sm2_mlen) * 2)
387 uint32_t key_bytes) in hpre_ecc_curve_to_hpre_bin() argument
391 ret = hpre_bin_from_crypto_bin(p, p, key_bytes, curve_bytes); in hpre_ecc_curve_to_hpre_bin()
397 ret = hpre_bin_from_crypto_bin(a, a, key_bytes, curve_bytes); in hpre_ecc_curve_to_hpre_bin()
[all …]
H A Dhpre_dh.c71 sqe->task_len1 = TASK_LENGTH(msg->key_bytes); in hpre_dh_fill_sqe()
94 if (hpre_bin_to_crypto_bin(msg->out, msg->out, msg->key_bytes, in hpre_dh_parse_sqe()
137 static size_t round_key_size_to_hw_size(size_t key_bytes) in round_key_size_to_hw_size() argument
141 if (key_bytes <= 96) in round_key_size_to_hw_size()
143 else if (key_bytes <= 128) in round_key_size_to_hw_size()
145 else if (key_bytes <= 192) in round_key_size_to_hw_size()
147 else if (key_bytes <= 256) in round_key_size_to_hw_size()
149 else if (key_bytes <= 384) in round_key_size_to_hw_size()
151 else if (key_bytes <= 512) in round_key_size_to_hw_size()
154 EMSG("Invalid key_bytes[%zu]", key_bytes); in round_key_size_to_hw_size()
[all …]
H A Dhpre_montgomery.c145 uint32_t size = HPRE_MONTGOMERY_TOTAL_BUF_SIZE(msg->key_bytes); in hpre_montgomery_params_alloc()
154 msg->in = msg->key + HPRE_X_KEY_SIZE(msg->key_bytes); in hpre_montgomery_params_alloc()
155 msg->in_dma = msg->key_dma + HPRE_X_KEY_SIZE(msg->key_bytes); in hpre_montgomery_params_alloc()
156 msg->out = msg->in + msg->key_bytes; in hpre_montgomery_params_alloc()
157 msg->out_dma = msg->in_dma + msg->key_bytes; in hpre_montgomery_params_alloc()
165 memzero_explicit(msg->key, HPRE_X_KEY_SIZE(msg->key_bytes)); in hpre_montgomery_params_free()
175 uint8_t *a = p + msg->key_bytes; in hpre_montgomery_params_pretreatment()
176 uint8_t *k = a + msg->key_bytes; in hpre_montgomery_params_pretreatment()
179 uint32_t bsize = msg->key_bytes; in hpre_montgomery_params_pretreatment()
198 if (msg->key_bytes == BITS_TO_BYTES(X25519_KEY_BITS)) { in hpre_montgomery_params_pretreatment()
[all …]
H A Dhpre_dh.h14 #define HPRE_DH_TOTAL_BUF_SIZE(key_bytes) ((key_bytes) * 4) argument
24 uint32_t key_bytes; member
H A Dhpre_montgomery.h17 #define HPRE_MONTGOMERY_TOTAL_BUF_SIZE(key_bytes) ((key_bytes) * 5) argument
28 uint32_t key_bytes; member
H A Dhpre_rsa.c54 sqe->task_len1 = TASK_LENGTH(msg->key_bytes); in hpre_rsa_fill_sqe()
185 uint32_t size = HPRE_RSA_NCRT_TOTAL_BUF_SIZE(msg->key_bytes); in hpre_rsa_encrypt_alloc()
197 msg->in = data + (msg->key_bytes * 2); in hpre_rsa_encrypt_alloc()
198 msg->in_dma = msg->pubkey_dma + (msg->key_bytes * 2); in hpre_rsa_encrypt_alloc()
200 msg->out = msg->in + msg->key_bytes; in hpre_rsa_encrypt_alloc()
201 msg->out_dma = msg->in_dma + msg->key_bytes; in hpre_rsa_encrypt_alloc()
216 n = msg->pubkey + msg->key_bytes; in hpre_rsa_encrypt_bn2bin()
224 msg->key_bytes, e_len); in hpre_rsa_encrypt_bn2bin()
230 ret = hpre_bin_from_crypto_bin(n, n, msg->key_bytes, n_len); in hpre_rsa_encrypt_bn2bin()
237 msg->key_bytes, in hpre_rsa_encrypt_bn2bin()
[all …]
H A Dhpre_rsa.h47 uint32_t key_bytes; member
H A Dhpre_ecc.h71 uint32_t key_bytes; member
/optee_os/core/drivers/crypto/se050/core/
H A Decc.c434 size_t key_bytes = 0; in shared_secret() local
439 ret = ecc_get_key_size(private_key->curve, 0, &key_bytes, &key_bits); in shared_secret()
448 ret = se050_inject_keypair(&kobject, private_key, key_bytes); in shared_secret()
461 ret = set_binary_data(public_key->x, key_bytes, &key.x, &key.x_len); in shared_secret()
467 ret = set_binary_data(public_key->y, key_bytes, &key.y, &key.y_len); in shared_secret()
499 size_t key_bytes = 0; in sign() local
503 res = ecc_get_key_size(key->curve, algo, &key_bytes, &key_bits); in sign()
512 sig_der_len = 2 * key_bytes + DER_SIGNATURE_SZ; in sign()
525 res = se050_inject_keypair(&kobject, key, key_bytes); in sign()
576 size_t key_bytes = 0; in verify() local
[all …]