mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-04-01 04:20:45 +00:00
replace use_psa_crypto with psa_crypto_c
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
This commit is contained in:
parent
b6875bc17a
commit
b02ee18e64
@ -649,8 +649,7 @@
|
|||||||
#if defined(MBEDTLS_SSL_PROTO_TLS1_3) && \
|
#if defined(MBEDTLS_SSL_PROTO_TLS1_3) && \
|
||||||
( ( !defined(MBEDTLS_HKDF_C) ) || \
|
( ( !defined(MBEDTLS_HKDF_C) ) || \
|
||||||
( !defined(MBEDTLS_SHA256_C) && !defined(MBEDTLS_SHA384_C) ) || \
|
( !defined(MBEDTLS_SHA256_C) && !defined(MBEDTLS_SHA384_C) ) || \
|
||||||
( !defined(MBEDTLS_PSA_CRYPTO_C) ) || \
|
( !defined(MBEDTLS_PSA_CRYPTO_C) ) )
|
||||||
( !defined(MBEDTLS_USE_PSA_CRYPTO) ) )
|
|
||||||
#error "MBEDTLS_SSL_PROTO_TLS1_3 defined, but not all prerequisites"
|
#error "MBEDTLS_SSL_PROTO_TLS1_3 defined, but not all prerequisites"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
#include "mbedtls/build_info.h"
|
#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"
|
#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_ECP_C */
|
||||||
|
|
||||||
#endif /* MBEDTLS_USE_PSA_CRYPTO */
|
#endif /* MBEDTLS_PSA_CRYPTO_C */
|
||||||
|
|
||||||
/* Expose whatever RNG the PSA subsystem uses to applications using the
|
/* Expose whatever RNG the PSA subsystem uses to applications using the
|
||||||
* mbedtls_xxx API. The declarations and definitions here need to be
|
* mbedtls_xxx API. The declarations and definitions here need to be
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
#include "mbedtls/ecdsa.h"
|
#include "mbedtls/ecdsa.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(MBEDTLS_USE_PSA_CRYPTO)
|
#if defined(MBEDTLS_PSA_CRYPTO_C)
|
||||||
#include "mbedtls/psa_util.h"
|
#include "mbedtls/psa_util.h"
|
||||||
#endif
|
#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 ) );
|
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(
|
return( mbedtls_pk_psa_sign_ext( PSA_ALG_RSA_PSS(
|
||||||
mbedtls_psa_translate_md( md_alg ) ),
|
mbedtls_psa_translate_md( md_alg ) ),
|
||||||
ctx->pk_ctx, hash, hash_len,
|
ctx->pk_ctx, hash, hash_len,
|
||||||
|
@ -65,7 +65,7 @@
|
|||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <stdint.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 )
|
int mbedtls_pk_error_from_psa( psa_status_t status )
|
||||||
{
|
{
|
||||||
switch( status )
|
switch( status )
|
||||||
@ -191,7 +191,7 @@ static int rsa_verify_wrap( void *ctx, mbedtls_md_type_t md_alg,
|
|||||||
return( 0 );
|
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,
|
int mbedtls_pk_psa_sign_ext( psa_algorithm_t psa_alg_md, void *pk_ctx,
|
||||||
const unsigned char *hash, size_t hash_len,
|
const unsigned char *hash, size_t hash_len,
|
||||||
unsigned char *sig, size_t sig_size,
|
unsigned char *sig, size_t sig_size,
|
||||||
|
@ -27,6 +27,10 @@
|
|||||||
|
|
||||||
#include "mbedtls/pk.h"
|
#include "mbedtls/pk.h"
|
||||||
|
|
||||||
|
#if defined(MBEDTLS_PSA_CRYPTO_C)
|
||||||
|
#include "psa/crypto.h"
|
||||||
|
#endif /* MBEDTLS_PSA_CRYPTO_C */
|
||||||
|
|
||||||
struct mbedtls_pk_info_t
|
struct mbedtls_pk_info_t
|
||||||
{
|
{
|
||||||
/** Public key type */
|
/** 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;
|
extern const mbedtls_pk_info_t mbedtls_pk_opaque_info;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(MBEDTLS_USE_PSA_CRYPTO)
|
#if defined(MBEDTLS_PSA_CRYPTO_C)
|
||||||
int mbedtls_pk_error_from_psa( psa_status_t status );
|
int mbedtls_pk_error_from_psa( psa_status_t status );
|
||||||
|
|
||||||
#if defined(PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY)
|
#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 );
|
int mbedtls_pk_error_from_psa_rsa( psa_status_t status );
|
||||||
#endif
|
#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,
|
int mbedtls_pk_psa_sign_ext( psa_algorithm_t psa_alg_md, void *ctx,
|
||||||
const unsigned char *hash, size_t hash_len,
|
const unsigned char *hash, size_t hash_len,
|
||||||
unsigned char *sig, size_t sig_size,
|
unsigned char *sig, size_t sig_size,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user