Home
last modified time | relevance | path

Searched refs:n_bytes (Results 1 – 7 of 7) sorted by relevance

/optee_os/core/drivers/crypto/crypto_api/acipher/
H A Ddsa.c129 size_t n_bytes = 0; in crypto_acipher_dsa_sign() local
143 n_bytes = crypto_bignum_num_bytes(key->q); in crypto_acipher_dsa_sign()
145 if (*sig_len < 2 * n_bytes) { in crypto_acipher_dsa_sign()
147 *sig_len, 2 * n_bytes); in crypto_acipher_dsa_sign()
148 *sig_len = 2 * n_bytes; in crypto_acipher_dsa_sign()
161 sdata.size_sec = n_bytes; in crypto_acipher_dsa_sign()
167 ret = dsa->sign(&sdata, l_bytes, n_bytes); in crypto_acipher_dsa_sign()
189 size_t n_bytes = 0; in crypto_acipher_dsa_verify() local
203 n_bytes = crypto_bignum_num_bytes(key->q); in crypto_acipher_dsa_verify()
205 if (sig_len != 2 * n_bytes) { in crypto_acipher_dsa_verify()
[all …]
/optee_os/core/drivers/crypto/hisilicon/
H A Dhpre_rsa.c248 size_t n_bytes = rsa_data->key.n_size; in hpre_rsa_encrypt_init() local
253 msg->key_bytes = hpre_rsa_get_hw_kbytes(BYTES_TO_BITS(n_bytes)); in hpre_rsa_encrypt_init()
272 size_t n_bytes = rsa_data->key.n_size; in rsa_nopad_encrypt() local
276 if (rsa_data->message.length > n_bytes) { in rsa_nopad_encrypt()
292 memcpy(rsa_data->cipher.data, msg.out + msg.key_bytes - n_bytes, in rsa_nopad_encrypt()
293 n_bytes); in rsa_nopad_encrypt()
294 rsa_data->cipher.length = n_bytes; in rsa_nopad_encrypt()
324 size_t n_bytes = rsa_data->key.n_size; in rsaes_pkcs_v1_5_encode() local
330 if ((msg_len + PKCS_V1_5_MSG_MIN_LEN) > n_bytes || out_len < n_bytes) { in rsaes_pkcs_v1_5_encode()
335 ps_len = n_bytes - PKCS_V1_5_FIXED_LEN - msg_len; in rsaes_pkcs_v1_5_encode()
[all …]
/optee_os/core/drivers/crypto/caam/acipher/
H A Dcaam_dsa.c72 size_t l_bytes, size_t n_bytes) in get_keypair_domain_params() argument
81 l_bytes, n_bytes); in get_keypair_domain_params()
83 retstatus = caam_calloc_buf(&outkey->q, n_bytes); in get_keypair_domain_params()
124 outkey->q.data + n_bytes - in_q_size); in get_keypair_domain_params()
154 size_t l_bytes, size_t n_bytes) in do_keypriv_conv() argument
160 l_bytes, n_bytes); in do_keypriv_conv()
181 retstatus = caam_calloc_buf(&outkey->q, n_bytes); in do_keypriv_conv()
187 crypto_bignum_bn2bin(inkey->q, outkey->q.data + n_bytes - field_size); in do_keypriv_conv()
189 retstatus = caam_key_deserialize_from_bn(inkey->x, &outkey->x, n_bytes); in do_keypriv_conv()
211 size_t l_bytes, size_t n_bytes) in do_keypub_conv() argument
[all …]
H A Dcaam_dh.c223 size_t n_bytes = key_size / 8; in do_gen_keypair() local
239 if (!n_bytes) in do_gen_keypair()
240 n_bytes = l_bytes; in do_gen_keypair()
246 if (n_bytes > PDB_DL_KEY_N_MASK) in do_gen_keypair()
247 n_bytes = PDB_DL_KEY_N_MASK; in do_gen_keypair()
250 n_bytes); in do_gen_keypair()
261 caam_dh_key.x.sec_size = n_bytes; in do_gen_keypair()
282 retstatus = caam_calloc_buf(&dh_r, n_bytes); in do_gen_keypair()
305 PDB_DL_KEY_N_SIZE(n_bytes)); in do_gen_keypair()
352 if (crypto_bignum_num_bytes(key->x) != n_bytes) { in do_gen_keypair()
[all …]
/optee_os/lib/libmbedtls/mbedtls/library/
H A Dbignum_core.c617 size_t n_bytes, in mbedtls_mpi_core_fill_random() argument
621 const size_t limbs = CHARS_TO_LIMBS(n_bytes); in mbedtls_mpi_core_fill_random()
622 const size_t overhead = (limbs * ciL) - n_bytes; in mbedtls_mpi_core_fill_random()
630 MBEDTLS_MPI_CHK(f_rng(p_rng, (unsigned char *) X + overhead, n_bytes)); in mbedtls_mpi_core_fill_random()
646 size_t n_bytes = (n_bits + 7) / 8; in mbedtls_mpi_core_random() local
666 int count = (n_bytes > 4 ? 30 : 250); in mbedtls_mpi_core_random()
678 n_bytes, in mbedtls_mpi_core_random()
680 mbedtls_mpi_core_shift_r(X, limbs, 8 * n_bytes - n_bits); in mbedtls_mpi_core_random()
/optee_os/core/drivers/crypto/crypto_api/include/
H A Ddrvcrypt_acipher.h223 size_t n_bytes);
226 size_t n_bytes);
/optee_os/scripts/
H A Dsign_encrypt.py458 n_bytes = int_to_bytes(subkey_pkey.public_numbers().n)
465 attrs_end_offs, len(n_bytes),
467 attrs_end_offs + len(n_bytes),
469 self.img = uuid.bytes + shdr_subkey + n_bytes + e_bytes
561 n_bytes = find_attr(TEE_ATTR_RSA_MODULUS)
564 n = int.from_bytes(n_bytes, 'big')