Skip to content

Commit 0168f2f

Browse files
Better documentation in crypto_compat.h
Note that the identifiers declared in this header are deprecated. Indicate what API version identifiers were from.
1 parent 2ff02c3 commit 0168f2f

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

include/psa/crypto_compat.h

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
*
44
* \brief PSA cryptography module: Backward compatibility aliases
55
*
6+
* This header declares alternative names for macro and functions.
7+
* New application code should not use these names.
8+
* These names may be removed in a future version of Mbed Crypto.
9+
*
610
* \note This file may not be included directly. Applications must
711
* include psa/crypto.h.
812
*/
@@ -34,6 +38,9 @@ extern "C" {
3438

3539
#if !defined(MBEDTLS_DEPRECATED_REMOVED)
3640

41+
/*
42+
* Mechanism for declaring deprecated values
43+
*/
3744
#if defined(MBEDTLS_DEPRECATED_WARNING) && !defined(MBEDTLS_PSA_DEPRECATED)
3845
#define MBEDTLS_PSA_DEPRECATED __attribute__((deprecated))
3946
#else
@@ -48,7 +55,7 @@ typedef MBEDTLS_PSA_DEPRECATED psa_key_usage_t mbedtls_deprecated_psa_key_usage_
4855
( (mbedtls_deprecated_##type) ( value ) )
4956

5057
/*
51-
* Deprecated PSA Crypto error code definitions
58+
* Deprecated PSA Crypto error code definitions (PSA Crypto API <= 1.0 beta2)
5259
*/
5360
#define PSA_ERROR_UNKNOWN_ERROR \
5461
MBEDTLS_DEPRECATED_CONSTANT( psa_status_t, PSA_ERROR_GENERIC_ERROR )
@@ -62,23 +69,23 @@ typedef MBEDTLS_PSA_DEPRECATED psa_key_usage_t mbedtls_deprecated_psa_key_usage_
6269
MBEDTLS_DEPRECATED_CONSTANT( psa_status_t, PSA_ERROR_CORRUPTION_DETECTED )
6370

6471
/*
65-
* Deprecated PSA Crypto numerical encodings
72+
* Deprecated PSA Crypto numerical encodings (PSA Crypto API <= 1.0 beta3)
6673
*/
6774
#define PSA_KEY_USAGE_SIGN \
6875
MBEDTLS_DEPRECATED_CONSTANT( psa_key_usage_t, PSA_KEY_USAGE_SIGN_HASH )
6976
#define PSA_KEY_USAGE_VERIFY \
7077
MBEDTLS_DEPRECATED_CONSTANT( psa_key_usage_t, PSA_KEY_USAGE_VERIFY_HASH )
7178

7279
/*
73-
* Deprecated PSA Crypto size calculation macros
80+
* Deprecated PSA Crypto size calculation macros (PSA Crypto API <= 1.0 beta3)
7481
*/
7582
#define PSA_ASYMMETRIC_SIGNATURE_MAX_SIZE \
7683
MBEDTLS_DEPRECATED_CONSTANT( size_t, PSA_SIGNATURE_MAX_SIZE )
7784
#define PSA_ASYMMETRIC_SIGN_OUTPUT_SIZE( key_type, key_bits, alg ) \
7885
MBEDTLS_DEPRECATED_CONSTANT( size_t, PSA_SIGN_OUTPUT_SIZE( key_type, key_bits, alg ) )
7986

8087
/*
81-
* Deprecated PSA Crypto function names
88+
* Deprecated PSA Crypto function names (PSA Crypto API <= 1.0 beta3)
8289
*/
8390
/* Make these macros and not wrappers so that there is no cost to
8491
* applications that don't use the deprecated names.

0 commit comments

Comments
 (0)