/optee_os-3.20.0/core/lib/libtomcrypt/ |
A D | ed25519.c | 63 uint8_t *sig, size_t *sig_len) in crypto_acipher_ed25519_sign() argument 72 if (!key || !sig_len) in crypto_acipher_ed25519_sign() 75 siglen = *sig_len; in crypto_acipher_ed25519_sign() 86 *sig_len = siglen; in crypto_acipher_ed25519_sign() 92 uint8_t *sig, size_t *sig_len, in crypto_acipher_ed25519ctx_sign() argument 103 if (!key || !sig_len) in crypto_acipher_ed25519ctx_sign() 106 siglen = *sig_len; in crypto_acipher_ed25519ctx_sign() 123 *sig_len = siglen; in crypto_acipher_ed25519ctx_sign() 129 const uint8_t *sig, size_t sig_len) in crypto_acipher_ed25519_verify() argument 142 if (ed25519_verify(msg, msg_len, sig, sig_len, &stat, in crypto_acipher_ed25519_verify() [all …]
|
A D | dsa.c | 97 uint8_t *sig, size_t *sig_len) in crypto_acipher_dsa_sign() argument 131 if (*sig_len < 2 * mp_unsigned_bin_size(ltc_key.q)) { in crypto_acipher_dsa_sign() 132 *sig_len = 2 * mp_unsigned_bin_size(ltc_key.q); in crypto_acipher_dsa_sign() 147 *sig_len = 2 * mp_unsigned_bin_size(ltc_key.q); in crypto_acipher_dsa_sign() 148 memset(sig, 0, *sig_len); in crypto_acipher_dsa_sign() 149 mp_to_unsigned_bin(r, (uint8_t *)sig + *sig_len/2 - in crypto_acipher_dsa_sign() 151 mp_to_unsigned_bin(s, (uint8_t *)sig + *sig_len - in crypto_acipher_dsa_sign() 166 const uint8_t *sig, size_t sig_len) in crypto_acipher_dsa_verify() argument 192 mp_read_unsigned_bin(r, (uint8_t *)sig, sig_len/2); in crypto_acipher_dsa_verify() 193 mp_read_unsigned_bin(s, (uint8_t *)sig + sig_len/2, sig_len/2); in crypto_acipher_dsa_verify()
|
A D | acipher_helpers.h | 57 size_t *sig_len); 61 const uint8_t *sig, size_t sig_len); 66 uint8_t *sig __unused, size_t *sig_len __unused) in sm2_ltc_dsa_sign() 74 const uint8_t *sig __unused, size_t sig_len __unused) in sm2_ltc_dsa_verify()
|
A D | sm2-dsa.c | 23 size_t *sig_len) in sm2_ltc_dsa_sign() argument 35 if (*sig_len < 2 * SM2_INT_SIZE_BYTES) { in sm2_ltc_dsa_sign() 36 *sig_len = 64; in sm2_ltc_dsa_sign() 125 *sig_len = 2 * SM2_INT_SIZE_BYTES; in sm2_ltc_dsa_sign() 126 memset(sig, 0, *sig_len); in sm2_ltc_dsa_sign() 141 const uint8_t *sig, size_t sig_len) in sm2_ltc_dsa_verify() argument 156 if (sig_len != 64) in sm2_ltc_dsa_verify()
|
A D | ecc.c | 252 uint8_t *sig, size_t *sig_len) in _ltc_ecc_sign() argument 268 if (*sig_len < 2 * key_size_bytes) { in _ltc_ecc_sign() 269 *sig_len = 2 * key_size_bytes; in _ltc_ecc_sign() 274 ltc_sig_len = *sig_len; in _ltc_ecc_sign() 282 *sig_len = ltc_sig_len; in _ltc_ecc_sign() 291 const uint8_t *sig, size_t sig_len) in _ltc_ecc_verify() argument 307 if ((key_size_bytes * 2) != sig_len) { in _ltc_ecc_verify() 312 ltc_res = ecc_verify_hash_rfc7518(sig, sig_len, msg, msg_len, <c_stat, in _ltc_ecc_verify()
|
A D | rsa.c | 491 size_t *sig_len) 497 size_t *sig_len) in sw_crypto_acipher_rsassa_sign() argument 561 if (*sig_len < mod_size) { in sw_crypto_acipher_rsassa_sign() 562 *sig_len = mod_size; in sw_crypto_acipher_rsassa_sign() 573 *sig_len = ltc_sig_len; in sw_crypto_acipher_rsassa_sign() 589 size_t sig_len) 596 size_t sig_len) in sw_crypto_acipher_rsassa_verify() argument 628 if (sig_len < bigint_size) { in sw_crypto_acipher_rsassa_verify() 665 ltc_res = rsa_verify_hash_ex(sig, sig_len, msg, msg_len, ltc_rsa_algo, in sw_crypto_acipher_rsassa_verify()
|
/optee_os-3.20.0/lib/libmbedtls/mbedtls/library/ |
A D | pk_wrap.c | 90 if( sig_len < rsa_len ) in rsa_verify_wrap() 103 if( sig_len > rsa_len ) in rsa_verify_wrap() 111 unsigned char *sig, size_t *sig_len, in rsa_sign_wrap() argument 121 *sig_len = mbedtls_rsa_get_len( rsa ); in rsa_sign_wrap() 610 if( p != sig + sig_len ) in ecdsa_verify_wrap() 659 hash, hash_len, sig, sig_len, in ecdsa_verify_rs_wrap() 770 if( *sig_len > MBEDTLS_PK_SIGNATURE_MAX_SIZE ) in rsa_alt_sign_wrap() 799 size_t sig_len = 0; in rsa_alt_check_pair() local 977 const size_t rs_len = *sig_len / 2; in pk_ecdsa_sig_asn1_from_psa() 988 *sig_len = len; in pk_ecdsa_sig_asn1_from_psa() [all …]
|
A D | pkcs11.c | 172 size_t sig_len = 0, asn_len = 0, oid_size = 0; in mbedtls_pkcs11_sign() local 195 sig_len = ctx->len; in mbedtls_pkcs11_sign() 196 if( hashlen > sig_len || asn_len > sig_len || in mbedtls_pkcs11_sign() 197 hashlen + asn_len > sig_len ) in mbedtls_pkcs11_sign() 230 asn_len + hashlen, sig, &sig_len ) != CKR_OK ) in mbedtls_pkcs11_sign()
|
A D | pk.c | 281 const unsigned char *sig, size_t sig_len, in mbedtls_pk_verify_restartable() argument 305 md_alg, hash, hash_len, sig, sig_len, rs_ctx->rs_ctx ); in mbedtls_pk_verify_restartable() 320 sig, sig_len ) ); in mbedtls_pk_verify_restartable() 328 const unsigned char *sig, size_t sig_len ) in mbedtls_pk_verify() argument 331 sig, sig_len, NULL ) ); in mbedtls_pk_verify() 340 const unsigned char *sig, size_t sig_len ) in mbedtls_pk_verify_ext() argument 369 if( sig_len < mbedtls_pk_get_len( ctx ) ) in mbedtls_pk_verify_ext() 381 if( sig_len > mbedtls_pk_get_len( ctx ) ) in mbedtls_pk_verify_ext() 403 unsigned char *sig, size_t *sig_len, in mbedtls_pk_sign_restartable() argument 443 sig, sig_len, f_rng, p_rng ) ); in mbedtls_pk_sign_restartable() [all …]
|
A D | x509write_csr.c | 147 size_t pub_len = 0, sig_and_oid_len = 0, sig_len; in x509write_csr_der_internal() local 237 if( ( ret = mbedtls_pk_sign( ctx->key, ctx->md_alg, hash, 0, sig, &sig_len, in x509write_csr_der_internal() 270 sig, sig_len ) ); in x509write_csr_der_internal()
|
A D | x509write_crt.c | 335 size_t sub_len = 0, pub_len = 0, sig_and_oid_len = 0, sig_len; in mbedtls_x509write_crt_der() local 476 hash, 0, sig, &sig_len, in mbedtls_x509write_crt_der() 492 sig_oid, sig_oid_len, sig, sig_len ) ); in mbedtls_x509write_crt_der()
|
/optee_os-3.20.0/core/drivers/crypto/crypto_api/acipher/ |
A D | dsa.c | 123 uint8_t *sig, size_t *sig_len) in crypto_acipher_dsa_sign() argument 131 if (!key || !msg || !sig_len) { 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() 165 sdata.signature.length = *sig_len; in crypto_acipher_dsa_sign() 170 *sig_len = sdata.signature.length; in crypto_acipher_dsa_sign() 183 const uint8_t *sig, size_t sig_len) in crypto_acipher_dsa_verify() argument 205 if (sig_len != 2 * n_bytes) { in crypto_acipher_dsa_verify() 207 sig_len, 2 * n_bytes); in crypto_acipher_dsa_verify() [all …]
|
A D | ecc.c | 156 size_t *sig_len) in ecc_sign() argument 164 if (!key || !msg || !sig_len) { in ecc_sign() 177 if (*sig_len < 2 * size_bytes) { in ecc_sign() 179 *sig_len, 2 * size_bytes); in ecc_sign() 180 *sig_len = 2 * size_bytes; in ecc_sign() 200 sdata.signature.length = *sig_len; in ecc_sign() 205 *sig_len = sdata.signature.length; in ecc_sign() 228 const uint8_t *sig, size_t sig_len) in ecc_verify() argument 249 if (sig_len != 2 * size_bytes) { in ecc_verify() 251 sig_len, 2 * size_bytes); in ecc_verify() [all …]
|
A D | rsa.c | 350 size_t *sig_len) in crypto_acipher_rsassa_sign() argument 356 if (!key || !msg || !sig_len) { in crypto_acipher_rsassa_sign() 386 if (rsa_ssa.key.n_size > *sig_len) { in crypto_acipher_rsassa_sign() 388 *sig_len, rsa_ssa.key.n_size); in crypto_acipher_rsassa_sign() 389 *sig_len = rsa_ssa.key.n_size; in crypto_acipher_rsassa_sign() 417 *sig_len = rsa_ssa.signature.length; in crypto_acipher_rsassa_sign() 432 size_t sig_len) in crypto_acipher_rsassa_verify() argument 469 if (rsa_ssa.key.n_size > sig_len) { in crypto_acipher_rsassa_verify() 483 rsa_ssa.signature.length = sig_len; in crypto_acipher_rsassa_verify()
|
/optee_os-3.20.0/lib/libmbedtls/mbedtls/include/mbedtls/ |
A D | pk_internal.h | 51 const unsigned char *sig, size_t sig_len ); 56 unsigned char *sig, size_t *sig_len, 64 const unsigned char *sig, size_t sig_len, 70 unsigned char *sig, size_t *sig_len,
|
A D | pk.h | 415 const unsigned char *sig, size_t sig_len ); 440 const unsigned char *sig, size_t sig_len, 475 const unsigned char *sig, size_t sig_len ); 509 unsigned char *sig, size_t *sig_len, 543 unsigned char *sig, size_t *sig_len,
|
/optee_os-3.20.0/lib/libmbedtls/core/ |
A D | sm2-dsa.h | 15 uint8_t *sig, size_t *sig_len); 19 const uint8_t *sig, size_t sig_len);
|
A D | sm2-dsa.c | 27 uint8_t *sig, size_t *sig_len) in sm2_mbedtls_dsa_sign() argument 39 if (*sig_len < 2 * SM2_INT_SIZE_BYTES) { in sm2_mbedtls_dsa_sign() 40 *sig_len = 64; in sm2_mbedtls_dsa_sign() 124 *sig_len = 2 * SM2_INT_SIZE_BYTES; in sm2_mbedtls_dsa_sign() 125 memset(sig, 0, *sig_len); in sm2_mbedtls_dsa_sign() 152 const uint8_t *sig, size_t sig_len) in sm2_mbedtls_dsa_verify() argument 165 if (sig_len != 64) in sm2_mbedtls_dsa_verify()
|
A D | ecc.c | 206 size_t *sig_len) in ecc_sign() argument 245 if (*sig_len < 2 * key_size_bytes) { in ecc_sign() 246 *sig_len = 2 * key_size_bytes; in ecc_sign() 260 *sig_len = 2 * key_size_bytes; in ecc_sign() 261 memset(sig, 0, *sig_len); in ecc_sign() 262 mbedtls_mpi_write_binary(&r, sig + *sig_len / 2 - in ecc_sign() 266 mbedtls_mpi_write_binary(&s, sig + *sig_len - in ecc_sign() 285 const uint8_t *sig, size_t sig_len) in ecc_verify() argument 328 if ((key_size_bytes * 2) != sig_len) { in ecc_verify() 333 mbedtls_mpi_read_binary(&r, sig, sig_len / 2); in ecc_verify() [all …]
|
A D | rsa.c | 571 uint8_t *sig, size_t *sig_len) 577 uint8_t *sig, size_t *sig_len) in sw_crypto_acipher_rsassa_sign() argument 623 if (*sig_len < mod_size) { in sw_crypto_acipher_rsassa_sign() 624 *sig_len = mod_size; in sw_crypto_acipher_rsassa_sign() 646 sig_len, NULL, NULL); in sw_crypto_acipher_rsassa_sign() 649 sig_len, mbd_rand, NULL); in sw_crypto_acipher_rsassa_sign() 666 size_t sig_len) 674 size_t sig_len) in sw_crypto_acipher_rsassa_verify() argument 710 if (sig_len < bigint_size) { in sw_crypto_acipher_rsassa_verify() 756 sig, sig_len); in sw_crypto_acipher_rsassa_verify()
|
/optee_os-3.20.0/core/include/crypto/ |
A D | crypto.h | 225 uint8_t *sig, size_t *sig_len); 228 uint8_t *sig, size_t *sig_len, 233 const uint8_t *sig, size_t sig_len); 236 const uint8_t *sig, size_t sig_len, 263 size_t *sig_len); 268 size_t sig_len); 271 uint8_t *sig, size_t *sig_len); 274 const uint8_t *sig, size_t sig_len); 277 uint8_t *sig, size_t *sig_len); 280 const uint8_t *sig, size_t sig_len);
|
A D | crypto_impl.h | 336 const uint8_t *sig, size_t sig_len); 355 size_t *sig_len); 469 size_t *sig_len); 475 size_t sig_len);
|
/optee_os-3.20.0/core/drivers/crypto/versal/ |
A D | ecc.c | 167 const uint8_t *sig, size_t sig_len) in verify() argument 186 return pub_ops->verify(algo, key, msg, msg_len, sig, sig_len); in verify() 210 versal_mbox_alloc(sig_len, sig, &s); in verify() 241 uint8_t *sig, size_t *sig_len) in sign() argument 262 return keypair_ops->sign(algo, key, msg, msg_len, sig, sig_len); in sign() 296 versal_mbox_alloc(*sig_len, NULL, &s); in sign() 320 *sig_len = 2 * bytes; in sign() 321 memcpy(sig, s.buf, *sig_len); in sign()
|
/optee_os-3.20.0/core/drivers/crypto/se050/core/ |
A D | ecc.c | 422 const uint8_t *sig, size_t sig_len) in verify_fallback() argument 428 return pub_ops->verify(algo, key, msg, msg_len, sig, sig_len); in verify_fallback() 433 uint8_t *sig, size_t *sig_len) in sign_fallback() argument 442 return pair_ops->sign(algo, key, msg, msg_len, sig, sig_len); in sign_fallback() 512 uint8_t *sig, size_t *sig_len) in sign() argument 529 return sign_fallback(algo, key, msg, msg_len, sig, sig_len); in sign() 568 if (sig_der_len > *sig_len) { in sign() 574 *sig_len = sig_der_len; in sign() 589 const uint8_t *sig, size_t sig_len) in verify() argument 606 return verify_fallback(algo, key, msg, msg_len, sig, sig_len); in verify() [all …]
|
/optee_os-3.20.0/core/crypto/ |
A D | crypto.c | 597 size_t *sig_len __unused) in crypto_acipher_rsassa_sign() 608 size_t sig_len __unused) in crypto_acipher_rsassa_verify() 639 size_t *sig_len __unused) in crypto_acipher_dsa_sign() 649 size_t sig_len __unused) in crypto_acipher_dsa_verify() 732 uint8_t *sig, size_t *sig_len) in crypto_acipher_ecc_sign() argument 739 return key->ops->sign(algo, key, msg, msg_len, sig, sig_len); in crypto_acipher_ecc_sign() 744 const uint8_t *sig, size_t sig_len) in crypto_acipher_ecc_verify() argument 849 size_t *sig_len __unused) in crypto_acipher_ed25519_sign() 858 size_t sig_len __unused) in crypto_acipher_ed25519_verify() 867 size_t *sig_len __unused, in crypto_acipher_ed25519ctx_sign() [all …]
|