replace use_psa_crypto with psa_crypto_c

Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
This commit is contained in:
Jerry Yu 2022-03-16 10:30:41 +08:00
parent b6875bc17a
commit b02ee18e64
5 changed files with 12 additions and 12 deletions

View File

@ -649,8 +649,7 @@
#if defined(MBEDTLS_SSL_PROTO_TLS1_3) && \
( ( !defined(MBEDTLS_HKDF_C) ) || \
( !defined(MBEDTLS_SHA256_C) && !defined(MBEDTLS_SHA384_C) ) || \
( !defined(MBEDTLS_PSA_CRYPTO_C) ) || \
( !defined(MBEDTLS_USE_PSA_CRYPTO) ) )
( !defined(MBEDTLS_PSA_CRYPTO_C) ) )
#error "MBEDTLS_SSL_PROTO_TLS1_3 defined, but not all prerequisites"
#endif

View File

@ -29,7 +29,7 @@
#include "mbedtls/build_info.h"
#if defined(MBEDTLS_USE_PSA_CRYPTO) || defined(MBEDTLS_SSL_PROTO_TLS1_3)
#if defined(MBEDTLS_PSA_CRYPTO_C)
#include "psa/crypto.h"
@ -277,7 +277,7 @@ static inline psa_key_type_t mbedtls_psa_parse_tls_ecc_group(
}
#endif /* MBEDTLS_ECP_C */
#endif /* MBEDTLS_USE_PSA_CRYPTO */
#endif /* MBEDTLS_PSA_CRYPTO_C */
/* Expose whatever RNG the PSA subsystem uses to applications using the
* mbedtls_xxx API. The declarations and definitions here need to be

View File

@ -36,7 +36,7 @@
#include "mbedtls/ecdsa.h"
#endif
#if defined(MBEDTLS_USE_PSA_CRYPTO)
#if defined(MBEDTLS_PSA_CRYPTO_C)
#include "mbedtls/psa_util.h"
#endif
@ -545,7 +545,7 @@ int mbedtls_pk_sign_ext( mbedtls_pk_type_t pk_type,
sig, sig_size, sig_len, f_rng, p_rng ) );
}
#if defined(MBEDTLS_X509_RSASSA_PSS_SUPPORT) && defined(MBEDTLS_USE_PSA_CRYPTO)
#if defined(MBEDTLS_X509_RSASSA_PSS_SUPPORT)
return( mbedtls_pk_psa_sign_ext( PSA_ALG_RSA_PSS(
mbedtls_psa_translate_md( md_alg ) ),
ctx->pk_ctx, hash, hash_len,

View File

@ -65,7 +65,7 @@
#include <limits.h>
#include <stdint.h>
#if defined(MBEDTLS_USE_PSA_CRYPTO)
#if defined(MBEDTLS_PSA_CRYPTO_C)
int mbedtls_pk_error_from_psa( psa_status_t status )
{
switch( status )
@ -191,7 +191,7 @@ static int rsa_verify_wrap( void *ctx, mbedtls_md_type_t md_alg,
return( 0 );
}
#if defined(MBEDTLS_USE_PSA_CRYPTO)
#if defined(MBEDTLS_PSA_CRYPTO_C)
int mbedtls_pk_psa_sign_ext( psa_algorithm_t psa_alg_md, void *pk_ctx,
const unsigned char *hash, size_t hash_len,
unsigned char *sig, size_t sig_size,

View File

@ -27,6 +27,10 @@
#include "mbedtls/pk.h"
#if defined(MBEDTLS_PSA_CRYPTO_C)
#include "psa/crypto.h"
#endif /* MBEDTLS_PSA_CRYPTO_C */
struct mbedtls_pk_info_t
{
/** Public key type */
@ -135,7 +139,7 @@ extern const mbedtls_pk_info_t mbedtls_rsa_alt_info;
extern const mbedtls_pk_info_t mbedtls_pk_opaque_info;
#endif
#if defined(MBEDTLS_USE_PSA_CRYPTO)
#if defined(MBEDTLS_PSA_CRYPTO_C)
int mbedtls_pk_error_from_psa( psa_status_t status );
#if defined(PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY)
@ -146,9 +150,6 @@ int mbedtls_pk_error_from_psa_ecdca( psa_status_t status );
int mbedtls_pk_error_from_psa_rsa( psa_status_t status );
#endif
#endif /* MBEDTLS_USE_PSA_CRYPTO */
#if defined(MBEDTLS_USE_PSA_CRYPTO)
int mbedtls_pk_psa_sign_ext( psa_algorithm_t psa_alg_md, void *ctx,
const unsigned char *hash, size_t hash_len,
unsigned char *sig, size_t sig_size,