crypto_compat.h File Reference

PSA cryptography module: Backward compatibility aliases. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Macros

#define | PSA_KEY_HANDLE_INIT MBEDTLS_SVC_KEY_ID_INIT
#define | MBEDTLS_PSA_DEPRECATED
#define | PSA_KEY_TYPE_GET_CURVE PSA_KEY_TYPE_ECC_GET_FAMILY
#define | PSA_KEY_TYPE_GET_GROUP PSA_KEY_TYPE_DH_GET_FAMILY
#define | MBEDTLS_DEPRECATED_CONSTANT(type, value) ( (mbedtls_deprecated_##type) ( value ) )
#define | PSA_ERROR_UNKNOWN_ERROR MBEDTLS_DEPRECATED_CONSTANT( psa_status_t, PSA_ERROR_GENERIC_ERROR )
#define | PSA_ERROR_OCCUPIED_SLOT MBEDTLS_DEPRECATED_CONSTANT( psa_status_t, PSA_ERROR_ALREADY_EXISTS )
#define | PSA_ERROR_EMPTY_SLOT MBEDTLS_DEPRECATED_CONSTANT( psa_status_t, PSA_ERROR_DOES_NOT_EXIST )
#define | PSA_ERROR_INSUFFICIENT_CAPACITY MBEDTLS_DEPRECATED_CONSTANT( psa_status_t, PSA_ERROR_INSUFFICIENT_DATA )
#define | PSA_ERROR_TAMPERING_DETECTED MBEDTLS_DEPRECATED_CONSTANT( psa_status_t, PSA_ERROR_CORRUPTION_DETECTED )
#define | PSA_KEY_USAGE_SIGN MBEDTLS_DEPRECATED_CONSTANT( psa_key_usage_t, PSA_KEY_USAGE_SIGN_HASH )
#define | PSA_KEY_USAGE_VERIFY MBEDTLS_DEPRECATED_CONSTANT( psa_key_usage_t, PSA_KEY_USAGE_VERIFY_HASH )
#define | PSA_ASYMMETRIC_SIGNATURE_MAX_SIZE MBEDTLS_DEPRECATED_CONSTANT( size_t, PSA_SIGNATURE_MAX_SIZE )
#define | PSA_ASYMMETRIC_SIGN_OUTPUT_SIZE(key_type, key_bits, alg) MBEDTLS_DEPRECATED_CONSTANT( size_t, PSA_SIGN_OUTPUT_SIZE( key_type, key_bits, alg ) )
#define | PSA_KEY_EXPORT_MAX_SIZE(key_type, key_bits) MBEDTLS_DEPRECATED_CONSTANT( size_t, PSA_EXPORT_KEY_OUTPUT_SIZE( key_type, key_bits ) )
#define | PSA_BLOCK_CIPHER_BLOCK_SIZE(type) MBEDTLS_DEPRECATED_CONSTANT( size_t, PSA_BLOCK_CIPHER_BLOCK_LENGTH( type ) )
#define | PSA_MAX_BLOCK_CIPHER_BLOCK_SIZE MBEDTLS_DEPRECATED_CONSTANT( size_t, PSA_BLOCK_CIPHER_BLOCK_MAX_SIZE )
#define | PSA_HASH_SIZE(alg) MBEDTLS_DEPRECATED_CONSTANT( size_t, PSA_HASH_LENGTH( alg ) )
#define | PSA_MAC_FINAL_SIZE(key_type, key_bits, alg) MBEDTLS_DEPRECATED_CONSTANT( size_t, PSA_MAC_LENGTH( key_type, key_bits, alg ) )
#define | PSA_ALG_TLS12_PSK_TO_MS_MAX_PSK_LEN MBEDTLS_DEPRECATED_CONSTANT( size_t, PSA_TLS12_PSK_TO_MS_PSK_MAX_SIZE )
#define | PSA_ECC_CURVE_SECP160K1 MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_SECP_K1 )
#define | PSA_ECC_CURVE_SECP192K1 MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_SECP_K1 )
#define | PSA_ECC_CURVE_SECP224K1 MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_SECP_K1 )
#define | PSA_ECC_CURVE_SECP256K1 MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_SECP_K1 )
#define | PSA_ECC_CURVE_SECP160R1 MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_SECP_R1 )
#define | PSA_ECC_CURVE_SECP192R1 MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_SECP_R1 )
#define | PSA_ECC_CURVE_SECP224R1 MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_SECP_R1 )
#define | PSA_ECC_CURVE_SECP256R1 MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_SECP_R1 )
#define | PSA_ECC_CURVE_SECP384R1 MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_SECP_R1 )
#define | PSA_ECC_CURVE_SECP521R1 MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_SECP_R1 )
#define | PSA_ECC_CURVE_SECP160R2 MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_SECP_R2 )
#define | PSA_ECC_CURVE_SECT163K1 MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_SECT_K1 )
#define | PSA_ECC_CURVE_SECT233K1 MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_SECT_K1 )
#define | PSA_ECC_CURVE_SECT239K1 MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_SECT_K1 )
#define | PSA_ECC_CURVE_SECT283K1 MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_SECT_K1 )
#define | PSA_ECC_CURVE_SECT409K1 MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_SECT_K1 )
#define | PSA_ECC_CURVE_SECT571K1 MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_SECT_K1 )
#define | PSA_ECC_CURVE_SECT163R1 MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_SECT_R1 )
#define | PSA_ECC_CURVE_SECT193R1 MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_SECT_R1 )
#define | PSA_ECC_CURVE_SECT233R1 MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_SECT_R1 )
#define | PSA_ECC_CURVE_SECT283R1 MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_SECT_R1 )
#define | PSA_ECC_CURVE_SECT409R1 MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_SECT_R1 )
#define | PSA_ECC_CURVE_SECT571R1 MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_SECT_R1 )
#define | PSA_ECC_CURVE_SECT163R2 MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_SECT_R2 )
#define | PSA_ECC_CURVE_SECT193R2 MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_SECT_R2 )
#define | PSA_ECC_CURVE_BRAINPOOL_P256R1 MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_BRAINPOOL_P_R1 )
#define | PSA_ECC_CURVE_BRAINPOOL_P384R1 MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_BRAINPOOL_P_R1 )
#define | PSA_ECC_CURVE_BRAINPOOL_P512R1 MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_BRAINPOOL_P_R1 )
#define | PSA_ECC_CURVE_CURVE25519 MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_MONTGOMERY )
#define | PSA_ECC_CURVE_CURVE448 MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_MONTGOMERY )
#define | PSA_ECC_CURVE_SECP_K1 MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_SECP_K1 )
#define | PSA_ECC_CURVE_SECP_R1 MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_SECP_R1 )
#define | PSA_ECC_CURVE_SECP_R2 MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_SECP_R2 )
#define | PSA_ECC_CURVE_SECT_K1 MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_SECT_K1 )
#define | PSA_ECC_CURVE_SECT_R1 MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_SECT_R1 )
#define | PSA_ECC_CURVE_SECT_R2 MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_SECT_R2 )
#define | PSA_ECC_CURVE_BRAINPOOL_P_R1 MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_BRAINPOOL_P_R1 )
#define | PSA_ECC_CURVE_MONTGOMERY MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_MONTGOMERY )
#define | PSA_DH_GROUP_FFDHE2048 MBEDTLS_DEPRECATED_CONSTANT( psa_dh_family_t, PSA_DH_FAMILY_RFC7919 )
#define | PSA_DH_GROUP_FFDHE3072 MBEDTLS_DEPRECATED_CONSTANT( psa_dh_family_t, PSA_DH_FAMILY_RFC7919 )
#define | PSA_DH_GROUP_FFDHE4096 MBEDTLS_DEPRECATED_CONSTANT( psa_dh_family_t, PSA_DH_FAMILY_RFC7919 )
#define | PSA_DH_GROUP_FFDHE6144 MBEDTLS_DEPRECATED_CONSTANT( psa_dh_family_t, PSA_DH_FAMILY_RFC7919 )
#define | PSA_DH_GROUP_FFDHE8192 MBEDTLS_DEPRECATED_CONSTANT( psa_dh_family_t, PSA_DH_FAMILY_RFC7919 )
#define | PSA_DH_GROUP_RFC7919 MBEDTLS_DEPRECATED_CONSTANT( psa_dh_family_t, PSA_DH_FAMILY_RFC7919 )
#define | PSA_DH_GROUP_CUSTOM MBEDTLS_DEPRECATED_CONSTANT( psa_dh_family_t, PSA_DH_FAMILY_CUSTOM )
#define | PSA_ALG_ARC4 MBEDTLS_DEPRECATED_CONSTANT( psa_algorithm_t, PSA_ALG_STREAM_CIPHER )
#define | PSA_ALG_CHACHA20 MBEDTLS_DEPRECATED_CONSTANT( psa_algorithm_t, PSA_ALG_STREAM_CIPHER )
#define | PSA_ALG_AEAD_WITH_DEFAULT_TAG_LENGTH(aead_alg) MBEDTLS_DEPRECATED_CONSTANT( psa_algorithm_t, PSA_ALG_AEAD_WITH_DEFAULT_LENGTH_TAG( aead_alg ) )
#define | PSA_ALG_AEAD_WITH_TAG_LENGTH(aead_alg, tag_length) MBEDTLS_DEPRECATED_CONSTANT( psa_algorithm_t, PSA_ALG_AEAD_WITH_SHORTENED_TAG( aead_alg, tag_length ) )
#define | PSA_AEAD_TAG_LENGTH_1_ARG(alg)
#define | PSA_AEAD_ENCRYPT_OUTPUT_SIZE_2_ARG(alg, plaintext_length)
#define | PSA_AEAD_DECRYPT_OUTPUT_SIZE_2_ARG(alg, ciphertext_length)
#define | PSA_AEAD_UPDATE_OUTPUT_SIZE_2_ARG(alg, input_length)
#define | PSA_AEAD_FINISH_OUTPUT_SIZE_1_ARG(alg)
#define | PSA_AEAD_VERIFY_OUTPUT_SIZE_1_ARG(alg)

## Typedefs

typedef mbedtls_svc_key_id_t | psa_key_handle_t
typedef MBEDTLS_PSA_DEPRECATED size_t | mbedtls_deprecated_size_t
typedef MBEDTLS_PSA_DEPRECATED psa_status_t | mbedtls_deprecated_psa_status_t
typedef MBEDTLS_PSA_DEPRECATED psa_key_usage_t | mbedtls_deprecated_psa_key_usage_t
typedef MBEDTLS_PSA_DEPRECATED psa_ecc_family_t | mbedtls_deprecated_psa_ecc_family_t
typedef MBEDTLS_PSA_DEPRECATED psa_dh_family_t | mbedtls_deprecated_psa_dh_family_t
typedef MBEDTLS_PSA_DEPRECATED psa_ecc_family_t | psa_ecc_curve_t
typedef MBEDTLS_PSA_DEPRECATED psa_dh_family_t | psa_dh_group_t
typedef MBEDTLS_PSA_DEPRECATED psa_algorithm_t | mbedtls_deprecated_psa_algorithm_t

## Functions

static int | psa_key_handle_is_null (psa_key_handle_t handle)
static MBEDTLS_PSA_DEPRECATED psa_status_t | psa_asymmetric_sign (psa_key_handle_t key, psa_algorithm_t alg, const uint8_t *hash, size_t hash_length, uint8_t *signature, size_t signature_size, size_t *signature_length)
static MBEDTLS_PSA_DEPRECATED psa_status_t | psa_asymmetric_verify (psa_key_handle_t key, psa_algorithm_t alg, const uint8_t *hash, size_t hash_length, const uint8_t *signature, size_t signature_length)
psa_status_t | psa_open_key (mbedtls_svc_key_id_t key, psa_key_handle_t *handle)
psa_status_t | psa_close_key (psa_key_handle_t handle)

## Detailed Description

PSA cryptography module: Backward compatibility aliases.

This header declares alternative names for macro and functions. New application code should not use these names. These names may be removed in a future version of Mbed Crypto.

Note
  This file may not be included directly. Applications must include psa/crypto.h.

Definition in file crypto_compat.h.

## Macro Definition Documentation

## MBEDTLS_DEPRECATED_CONSTANT

#define MBEDTLS_DEPRECATED_CONSTANT | ( |  | type,
|  |  | value
| ) |  | ( (mbedtls_deprecated_##type) ( value ) )

Definition at line 81 of file crypto_compat.h.

## MBEDTLS_PSA_DEPRECATED

#define MBEDTLS_PSA_DEPRECATED

Definition at line 66 of file crypto_compat.h.

## PSA_AEAD_DECRYPT_OUTPUT_SIZE_2_ARG

#define PSA_AEAD_DECRYPT_OUTPUT_SIZE_2_ARG | ( |  | alg,
|  |  | ciphertext_length
| ) |  |

Value:
MBEDTLS_DEPRECATED_CONSTANT( size_t, \
PSA_ALG_IS_AEAD( alg ) && \
(ciphertext_length) > PSA_ALG_AEAD_GET_TAG_LENGTH( alg ) ? \
(ciphertext_length) - PSA_ALG_AEAD_GET_TAG_LENGTH( alg ) : \
0 )
MBEDTLS_DEPRECATED_CONSTANT
#define MBEDTLS_DEPRECATED_CONSTANT(type, value)
Definition: crypto_compat.h:81
PSA_ALG_AEAD_GET_TAG_LENGTH
#define PSA_ALG_AEAD_GET_TAG_LENGTH(aead_alg)
Definition: crypto_values.h:1219
PSA_ALG_IS_AEAD
#define PSA_ALG_IS_AEAD(alg)
Definition: crypto_values.h:744

The maximum size of the output of psa_aead_decrypt(), in bytes.

If the size of the plaintext buffer is at least this large, it is guaranteed that psa_aead_decrypt() will not fail due to an insufficient buffer size. Depending on the algorithm, the actual size of the plaintext may be smaller.

Warning
  This macro may evaluate its arguments multiple times or zero times, so you should not pass arguments that contain side effects.

Parameters

  alg | An AEAD algorithm (`PSA_ALG_XXX` value such that PSA_ALG_IS_AEAD(`alg`) is true).
  ciphertext_length | Size of the plaintext in bytes.

Returns
  The AEAD ciphertext size for the specified algorithm. If the AEAD algorithm is not recognized, return 0.

Definition at line 340 of file crypto_compat.h.

## PSA_AEAD_ENCRYPT_OUTPUT_SIZE_2_ARG

#define PSA_AEAD_ENCRYPT_OUTPUT_SIZE_2_ARG | ( |  | alg,
|  |  | plaintext_length
| ) |  |

Value:
MBEDTLS_DEPRECATED_CONSTANT( size_t, \
PSA_ALG_IS_AEAD( alg ) ? \
(plaintext_length) + PSA_ALG_AEAD_GET_TAG_LENGTH( alg ) : \
0 )

The maximum size of the output of psa_aead_encrypt(), in bytes.

If the size of the ciphertext buffer is at least this large, it is guaranteed that psa_aead_encrypt() will not fail due to an insufficient buffer size. Depending on the algorithm, the actual size of the ciphertext may be smaller.

Warning
  This macro may evaluate its arguments multiple times or zero times, so you should not pass arguments that contain side effects.

Parameters

  alg | An AEAD algorithm (`PSA_ALG_XXX` value such that PSA_ALG_IS_AEAD(`alg`) is true).
  plaintext_length | Size of the plaintext in bytes.

Returns
  The AEAD ciphertext size for the specified algorithm. If the AEAD algorithm is not recognized, return 0.

Definition at line 314 of file crypto_compat.h.

## PSA_AEAD_FINISH_OUTPUT_SIZE_1_ARG

#define PSA_AEAD_FINISH_OUTPUT_SIZE_1_ARG | ( |  | alg | ) |

Value:
MBEDTLS_DEPRECATED_CONSTANT( size_t, \
PSA_ALG_IS_AEAD_ON_BLOCK_CIPHER( alg ) ? \
PSA_BLOCK_CIPHER_BLOCK_MAX_SIZE : \
0 )
PSA_BLOCK_CIPHER_BLOCK_MAX_SIZE
#define PSA_BLOCK_CIPHER_BLOCK_MAX_SIZE
Definition: crypto_sizes.h:251
PSA_ALG_IS_AEAD_ON_BLOCK_CIPHER
#define PSA_ALG_IS_AEAD_ON_BLOCK_CIPHER(alg)
Definition: crypto_values.h:1143

A sufficient ciphertext buffer size for psa_aead_finish().

If the size of the ciphertext buffer is at least this large, it is guaranteed that psa_aead_finish() will not fail due to an insufficient ciphertext buffer size. The actual size of the output may be smaller in any given call.

Parameters

  alg | An AEAD algorithm (`PSA_ALG_XXX` value such that PSA_ALG_IS_AEAD(`alg`) is true).

Returns
  A sufficient ciphertext buffer size for the specified algorithm. If the AEAD algorithm is not recognized, return 0.

Definition at line 392 of file crypto_compat.h.

## PSA_AEAD_TAG_LENGTH_1_ARG

#define PSA_AEAD_TAG_LENGTH_1_ARG | ( |  | alg | ) |

Value:
MBEDTLS_DEPRECATED_CONSTANT( size_t, \
PSA_ALG_IS_AEAD( alg ) ? \
PSA_ALG_AEAD_GET_TAG_LENGTH( alg ) : \
0 )

The tag size for an AEAD algorithm, in bytes.

Parameters

  alg | An AEAD algorithm (`PSA_ALG_XXX` value such that PSA_ALG_IS_AEAD(`alg`) is true).

Returns
  The tag size for the specified algorithm. If the AEAD algorithm does not have an identified tag that can be distinguished from the rest of the ciphertext, return 0. If the AEAD algorithm is not recognized, return 0.

Definition at line 288 of file crypto_compat.h.

## PSA_AEAD_UPDATE_OUTPUT_SIZE_2_ARG

#define PSA_AEAD_UPDATE_OUTPUT_SIZE_2_ARG | ( |  | alg,
|  |  | input_length
| ) |  |

Value:
MBEDTLS_DEPRECATED_CONSTANT( size_t, \
PSA_ALG_IS_AEAD_ON_BLOCK_CIPHER( alg ) ? \
PSA_ROUND_UP_TO_MULTIPLE( PSA_BLOCK_CIPHER_BLOCK_MAX_SIZE, (input_length) ) : \
(input_length) )
PSA_ROUND_UP_TO_MULTIPLE
#define PSA_ROUND_UP_TO_MULTIPLE(block_size, length)
Definition: crypto_sizes.h:54

A sufficient output buffer size for psa_aead_update().

If the size of the output buffer is at least this large, it is guaranteed that psa_aead_update() will not fail due to an insufficient buffer size. The actual size of the output may be smaller in any given call.

Warning
  This macro may evaluate its arguments multiple times or zero times, so you should not pass arguments that contain side effects.

Parameters

  alg | An AEAD algorithm (`PSA_ALG_XXX` value such that PSA_ALG_IS_AEAD(`alg`) is true).
  input_length | Size of the input in bytes.

Returns
  A sufficient output buffer size for the specified algorithm. If the AEAD algorithm is not recognized, return 0.

Definition at line 371 of file crypto_compat.h.

## PSA_AEAD_VERIFY_OUTPUT_SIZE_1_ARG

#define PSA_AEAD_VERIFY_OUTPUT_SIZE_1_ARG | ( |  | alg | ) |

Value:
MBEDTLS_DEPRECATED_CONSTANT( size_t, \
PSA_ALG_IS_AEAD_ON_BLOCK_CIPHER( alg ) ? \
PSA_BLOCK_CIPHER_BLOCK_MAX_SIZE : \
0 )

A sufficient plaintext buffer size for psa_aead_verify().

If the size of the plaintext buffer is at least this large, it is guaranteed that psa_aead_verify() will not fail due to an insufficient plaintext buffer size. The actual size of the output may be smaller in any given call.

Parameters

  alg | An AEAD algorithm (`PSA_ALG_XXX` value such that PSA_ALG_IS_AEAD(`alg`) is true).

Returns
  A sufficient plaintext buffer size for the specified algorithm. If the AEAD algorithm is not recognized, return 0.

Definition at line 413 of file crypto_compat.h.

## PSA_ALG_AEAD_WITH_DEFAULT_TAG_LENGTH

#define PSA_ALG_AEAD_WITH_DEFAULT_TAG_LENGTH | ( |  | aead_alg | ) | MBEDTLS_DEPRECATED_CONSTANT( psa_algorithm_t, PSA_ALG_AEAD_WITH_DEFAULT_LENGTH_TAG( aead_alg ) )

Definition at line 267 of file crypto_compat.h.

## PSA_ALG_AEAD_WITH_TAG_LENGTH

#define PSA_ALG_AEAD_WITH_TAG_LENGTH | ( |  | aead_alg,
|  |  | tag_length
| ) |  | MBEDTLS_DEPRECATED_CONSTANT( psa_algorithm_t, PSA_ALG_AEAD_WITH_SHORTENED_TAG( aead_alg, tag_length ) )

Definition at line 269 of file crypto_compat.h.

## PSA_ALG_ARC4

#define PSA_ALG_ARC4 MBEDTLS_DEPRECATED_CONSTANT( psa_algorithm_t, PSA_ALG_STREAM_CIPHER )

Definition at line 259 of file crypto_compat.h.

## PSA_ALG_CHACHA20

#define PSA_ALG_CHACHA20 MBEDTLS_DEPRECATED_CONSTANT( psa_algorithm_t, PSA_ALG_STREAM_CIPHER )

Definition at line 261 of file crypto_compat.h.

## PSA_ALG_TLS12_PSK_TO_MS_MAX_PSK_LEN

#define PSA_ALG_TLS12_PSK_TO_MS_MAX_PSK_LEN MBEDTLS_DEPRECATED_CONSTANT( size_t, PSA_TLS12_PSK_TO_MS_PSK_MAX_SIZE )

Definition at line 123 of file crypto_compat.h.

## PSA_ASYMMETRIC_SIGN_OUTPUT_SIZE

#define PSA_ASYMMETRIC_SIGN_OUTPUT_SIZE | ( |  | key_type,
|  |  | key_bits,
|  |  | alg
| ) |  | MBEDTLS_DEPRECATED_CONSTANT( size_t, PSA_SIGN_OUTPUT_SIZE( key_type, key_bits, alg ) )

Definition at line 111 of file crypto_compat.h.

## PSA_ASYMMETRIC_SIGNATURE_MAX_SIZE

#define PSA_ASYMMETRIC_SIGNATURE_MAX_SIZE MBEDTLS_DEPRECATED_CONSTANT( size_t, PSA_SIGNATURE_MAX_SIZE )

Definition at line 109 of file crypto_compat.h.

## PSA_BLOCK_CIPHER_BLOCK_SIZE

#define PSA_BLOCK_CIPHER_BLOCK_SIZE | ( |  | type | ) | MBEDTLS_DEPRECATED_CONSTANT( size_t, PSA_BLOCK_CIPHER_BLOCK_LENGTH( type ) )

Definition at line 115 of file crypto_compat.h.

## PSA_DH_GROUP_CUSTOM

#define PSA_DH_GROUP_CUSTOM MBEDTLS_DEPRECATED_CONSTANT( psa_dh_family_t, PSA_DH_FAMILY_CUSTOM )

Definition at line 253 of file crypto_compat.h.

## PSA_DH_GROUP_FFDHE2048

#define PSA_DH_GROUP_FFDHE2048 MBEDTLS_DEPRECATED_CONSTANT( psa_dh_family_t, PSA_DH_FAMILY_RFC7919 )

Definition at line 237 of file crypto_compat.h.

## PSA_DH_GROUP_FFDHE3072

#define PSA_DH_GROUP_FFDHE3072 MBEDTLS_DEPRECATED_CONSTANT( psa_dh_family_t, PSA_DH_FAMILY_RFC7919 )

Definition at line 239 of file crypto_compat.h.

## PSA_DH_GROUP_FFDHE4096

#define PSA_DH_GROUP_FFDHE4096 MBEDTLS_DEPRECATED_CONSTANT( psa_dh_family_t, PSA_DH_FAMILY_RFC7919 )

Definition at line 241 of file crypto_compat.h.

## PSA_DH_GROUP_FFDHE6144

#define PSA_DH_GROUP_FFDHE6144 MBEDTLS_DEPRECATED_CONSTANT( psa_dh_family_t, PSA_DH_FAMILY_RFC7919 )

Definition at line 243 of file crypto_compat.h.

## PSA_DH_GROUP_FFDHE8192

#define PSA_DH_GROUP_FFDHE8192 MBEDTLS_DEPRECATED_CONSTANT( psa_dh_family_t, PSA_DH_FAMILY_RFC7919 )

Definition at line 245 of file crypto_compat.h.

## PSA_DH_GROUP_RFC7919

#define PSA_DH_GROUP_RFC7919 MBEDTLS_DEPRECATED_CONSTANT( psa_dh_family_t, PSA_DH_FAMILY_RFC7919 )

Definition at line 251 of file crypto_compat.h.

## PSA_ECC_CURVE_BRAINPOOL_P256R1

#define PSA_ECC_CURVE_BRAINPOOL_P256R1 MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_BRAINPOOL_P_R1 )

Definition at line 203 of file crypto_compat.h.

## PSA_ECC_CURVE_BRAINPOOL_P384R1

#define PSA_ECC_CURVE_BRAINPOOL_P384R1 MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_BRAINPOOL_P_R1 )

Definition at line 205 of file crypto_compat.h.

## PSA_ECC_CURVE_BRAINPOOL_P512R1

#define PSA_ECC_CURVE_BRAINPOOL_P512R1 MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_BRAINPOOL_P_R1 )

Definition at line 207 of file crypto_compat.h.

## PSA_ECC_CURVE_BRAINPOOL_P_R1

#define PSA_ECC_CURVE_BRAINPOOL_P_R1 MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_BRAINPOOL_P_R1 )

Definition at line 229 of file crypto_compat.h.

## PSA_ECC_CURVE_CURVE25519

#define PSA_ECC_CURVE_CURVE25519 MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_MONTGOMERY )

Definition at line 209 of file crypto_compat.h.

## PSA_ECC_CURVE_CURVE448

#define PSA_ECC_CURVE_CURVE448 MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_MONTGOMERY )

Definition at line 211 of file crypto_compat.h.

## PSA_ECC_CURVE_MONTGOMERY

#define PSA_ECC_CURVE_MONTGOMERY MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_MONTGOMERY )

Definition at line 231 of file crypto_compat.h.

## PSA_ECC_CURVE_SECP160K1

#define PSA_ECC_CURVE_SECP160K1 MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_SECP_K1 )

Definition at line 153 of file crypto_compat.h.

## PSA_ECC_CURVE_SECP160R1

#define PSA_ECC_CURVE_SECP160R1 MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_SECP_R1 )

Definition at line 161 of file crypto_compat.h.

## PSA_ECC_CURVE_SECP160R2

#define PSA_ECC_CURVE_SECP160R2 MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_SECP_R2 )

Definition at line 173 of file crypto_compat.h.

## PSA_ECC_CURVE_SECP192K1

#define PSA_ECC_CURVE_SECP192K1 MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_SECP_K1 )

Definition at line 155 of file crypto_compat.h.

## PSA_ECC_CURVE_SECP192R1

#define PSA_ECC_CURVE_SECP192R1 MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_SECP_R1 )

Definition at line 163 of file crypto_compat.h.

## PSA_ECC_CURVE_SECP224K1

#define PSA_ECC_CURVE_SECP224K1 MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_SECP_K1 )

Definition at line 157 of file crypto_compat.h.

## PSA_ECC_CURVE_SECP224R1

#define PSA_ECC_CURVE_SECP224R1 MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_SECP_R1 )

Definition at line 165 of file crypto_compat.h.

## PSA_ECC_CURVE_SECP256K1

#define PSA_ECC_CURVE_SECP256K1 MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_SECP_K1 )

Definition at line 159 of file crypto_compat.h.

## PSA_ECC_CURVE_SECP256R1

#define PSA_ECC_CURVE_SECP256R1 MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_SECP_R1 )

Definition at line 167 of file crypto_compat.h.

## PSA_ECC_CURVE_SECP384R1

#define PSA_ECC_CURVE_SECP384R1 MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_SECP_R1 )

Definition at line 169 of file crypto_compat.h.

## PSA_ECC_CURVE_SECP521R1

#define PSA_ECC_CURVE_SECP521R1 MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_SECP_R1 )

Definition at line 171 of file crypto_compat.h.

## PSA_ECC_CURVE_SECP_K1

#define PSA_ECC_CURVE_SECP_K1 MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_SECP_K1 )

Definition at line 217 of file crypto_compat.h.

## PSA_ECC_CURVE_SECP_R1

#define PSA_ECC_CURVE_SECP_R1 MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_SECP_R1 )

Definition at line 219 of file crypto_compat.h.

## PSA_ECC_CURVE_SECP_R2

#define PSA_ECC_CURVE_SECP_R2 MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_SECP_R2 )

Definition at line 221 of file crypto_compat.h.

## PSA_ECC_CURVE_SECT163K1

#define PSA_ECC_CURVE_SECT163K1 MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_SECT_K1 )

Definition at line 175 of file crypto_compat.h.

## PSA_ECC_CURVE_SECT163R1

#define PSA_ECC_CURVE_SECT163R1 MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_SECT_R1 )

Definition at line 187 of file crypto_compat.h.

## PSA_ECC_CURVE_SECT163R2

#define PSA_ECC_CURVE_SECT163R2 MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_SECT_R2 )

Definition at line 199 of file crypto_compat.h.

## PSA_ECC_CURVE_SECT193R1

#define PSA_ECC_CURVE_SECT193R1 MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_SECT_R1 )

Definition at line 189 of file crypto_compat.h.

## PSA_ECC_CURVE_SECT193R2

#define PSA_ECC_CURVE_SECT193R2 MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_SECT_R2 )

Definition at line 201 of file crypto_compat.h.

## PSA_ECC_CURVE_SECT233K1

#define PSA_ECC_CURVE_SECT233K1 MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_SECT_K1 )

Definition at line 177 of file crypto_compat.h.

## PSA_ECC_CURVE_SECT233R1

#define PSA_ECC_CURVE_SECT233R1 MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_SECT_R1 )

Definition at line 191 of file crypto_compat.h.

## PSA_ECC_CURVE_SECT239K1

#define PSA_ECC_CURVE_SECT239K1 MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_SECT_K1 )

Definition at line 179 of file crypto_compat.h.

## PSA_ECC_CURVE_SECT283K1

#define PSA_ECC_CURVE_SECT283K1 MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_SECT_K1 )

Definition at line 181 of file crypto_compat.h.

## PSA_ECC_CURVE_SECT283R1

#define PSA_ECC_CURVE_SECT283R1 MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_SECT_R1 )

Definition at line 193 of file crypto_compat.h.

## PSA_ECC_CURVE_SECT409K1

#define PSA_ECC_CURVE_SECT409K1 MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_SECT_K1 )

Definition at line 183 of file crypto_compat.h.

## PSA_ECC_CURVE_SECT409R1

#define PSA_ECC_CURVE_SECT409R1 MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_SECT_R1 )

Definition at line 195 of file crypto_compat.h.

## PSA_ECC_CURVE_SECT571K1

#define PSA_ECC_CURVE_SECT571K1 MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_SECT_K1 )

Definition at line 185 of file crypto_compat.h.

## PSA_ECC_CURVE_SECT571R1

#define PSA_ECC_CURVE_SECT571R1 MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_SECT_R1 )

Definition at line 197 of file crypto_compat.h.

## PSA_ECC_CURVE_SECT_K1

#define PSA_ECC_CURVE_SECT_K1 MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_SECT_K1 )

Definition at line 223 of file crypto_compat.h.

## PSA_ECC_CURVE_SECT_R1

#define PSA_ECC_CURVE_SECT_R1 MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_SECT_R1 )

Definition at line 225 of file crypto_compat.h.

## PSA_ECC_CURVE_SECT_R2

#define PSA_ECC_CURVE_SECT_R2 MBEDTLS_DEPRECATED_CONSTANT( psa_ecc_family_t, PSA_ECC_FAMILY_SECT_R2 )

Definition at line 227 of file crypto_compat.h.

## PSA_ERROR_EMPTY_SLOT

#define PSA_ERROR_EMPTY_SLOT MBEDTLS_DEPRECATED_CONSTANT( psa_status_t, PSA_ERROR_DOES_NOT_EXIST )

Definition at line 91 of file crypto_compat.h.

## PSA_ERROR_INSUFFICIENT_CAPACITY

#define PSA_ERROR_INSUFFICIENT_CAPACITY MBEDTLS_DEPRECATED_CONSTANT( psa_status_t, PSA_ERROR_INSUFFICIENT_DATA )

Definition at line 93 of file crypto_compat.h.

## PSA_ERROR_OCCUPIED_SLOT

#define PSA_ERROR_OCCUPIED_SLOT MBEDTLS_DEPRECATED_CONSTANT( psa_status_t, PSA_ERROR_ALREADY_EXISTS )

Definition at line 89 of file crypto_compat.h.

## PSA_ERROR_TAMPERING_DETECTED

#define PSA_ERROR_TAMPERING_DETECTED MBEDTLS_DEPRECATED_CONSTANT( psa_status_t, PSA_ERROR_CORRUPTION_DETECTED )

Definition at line 95 of file crypto_compat.h.

## PSA_ERROR_UNKNOWN_ERROR

#define PSA_ERROR_UNKNOWN_ERROR MBEDTLS_DEPRECATED_CONSTANT( psa_status_t, PSA_ERROR_GENERIC_ERROR )

Definition at line 87 of file crypto_compat.h.

## PSA_HASH_SIZE

#define PSA_HASH_SIZE | ( |  | alg | ) | MBEDTLS_DEPRECATED_CONSTANT( size_t, PSA_HASH_LENGTH( alg ) )

Definition at line 119 of file crypto_compat.h.

## PSA_KEY_EXPORT_MAX_SIZE

#define PSA_KEY_EXPORT_MAX_SIZE | ( |  | key_type,
|  |  | key_bits
| ) |  | MBEDTLS_DEPRECATED_CONSTANT( size_t, PSA_EXPORT_KEY_OUTPUT_SIZE( key_type, key_bits ) )

Definition at line 113 of file crypto_compat.h.

## PSA_KEY_HANDLE_INIT

#define PSA_KEY_HANDLE_INIT MBEDTLS_SVC_KEY_ID_INIT

Definition at line 45 of file crypto_compat.h.

## PSA_KEY_TYPE_GET_CURVE

#define PSA_KEY_TYPE_GET_CURVE PSA_KEY_TYPE_ECC_GET_FAMILY

Definition at line 78 of file crypto_compat.h.

## PSA_KEY_TYPE_GET_GROUP

#define PSA_KEY_TYPE_GET_GROUP PSA_KEY_TYPE_DH_GET_FAMILY

Definition at line 79 of file crypto_compat.h.

## PSA_KEY_USAGE_SIGN

#define PSA_KEY_USAGE_SIGN MBEDTLS_DEPRECATED_CONSTANT( psa_key_usage_t, PSA_KEY_USAGE_SIGN_HASH )

Definition at line 101 of file crypto_compat.h.

## PSA_KEY_USAGE_VERIFY

#define PSA_KEY_USAGE_VERIFY MBEDTLS_DEPRECATED_CONSTANT( psa_key_usage_t, PSA_KEY_USAGE_VERIFY_HASH )

Definition at line 103 of file crypto_compat.h.

## PSA_MAC_FINAL_SIZE

#define PSA_MAC_FINAL_SIZE | ( |  | key_type,
|  |  | key_bits,
|  |  | alg
| ) |  | MBEDTLS_DEPRECATED_CONSTANT( size_t, PSA_MAC_LENGTH( key_type, key_bits, alg ) )

Definition at line 121 of file crypto_compat.h.

## PSA_MAX_BLOCK_CIPHER_BLOCK_SIZE

#define PSA_MAX_BLOCK_CIPHER_BLOCK_SIZE MBEDTLS_DEPRECATED_CONSTANT( size_t, PSA_BLOCK_CIPHER_BLOCK_MAX_SIZE )

Definition at line 117 of file crypto_compat.h.

## Typedef Documentation

## mbedtls_deprecated_psa_algorithm_t

typedef MBEDTLS_PSA_DEPRECATED psa_algorithm_t mbedtls_deprecated_psa_algorithm_t

Definition at line 76 of file crypto_compat.h.

## mbedtls_deprecated_psa_dh_family_t

typedef MBEDTLS_PSA_DEPRECATED psa_dh_family_t mbedtls_deprecated_psa_dh_family_t

Definition at line 73 of file crypto_compat.h.

## mbedtls_deprecated_psa_ecc_family_t

typedef MBEDTLS_PSA_DEPRECATED psa_ecc_family_t mbedtls_deprecated_psa_ecc_family_t

Definition at line 72 of file crypto_compat.h.

## mbedtls_deprecated_psa_key_usage_t

typedef MBEDTLS_PSA_DEPRECATED psa_key_usage_t mbedtls_deprecated_psa_key_usage_t

Definition at line 71 of file crypto_compat.h.

## mbedtls_deprecated_psa_status_t

typedef MBEDTLS_PSA_DEPRECATED psa_status_t mbedtls_deprecated_psa_status_t

Definition at line 70 of file crypto_compat.h.

## mbedtls_deprecated_size_t

typedef MBEDTLS_PSA_DEPRECATED size_t mbedtls_deprecated_size_t

Definition at line 69 of file crypto_compat.h.

## psa_dh_group_t

typedef MBEDTLS_PSA_DEPRECATED psa_dh_family_t psa_dh_group_t

Definition at line 75 of file crypto_compat.h.

## psa_ecc_curve_t

typedef MBEDTLS_PSA_DEPRECATED psa_ecc_family_t psa_ecc_curve_t

Definition at line 74 of file crypto_compat.h.

## psa_key_handle_t

typedef mbedtls_svc_key_id_t psa_key_handle_t

Definition at line 43 of file crypto_compat.h.

## Function Documentation

## psa_asymmetric_sign()

static MBEDTLS_PSA_DEPRECATED psa_status_t psa_asymmetric_sign | ( | psa_key_handle_t | key,
|  | psa_algorithm_t | alg,
|  | const uint8_t * | hash,
|  | size_t | hash_length,
|  | uint8_t * | signature,
|  | size_t | signature_size,
|  | size_t * | signature_length
| ) |  |

inline static

Definition at line 129 of file crypto_compat.h.

References psa_sign_hash().

## psa_asymmetric_verify()

static MBEDTLS_PSA_DEPRECATED psa_status_t psa_asymmetric_verify | ( | psa_key_handle_t | key,
|  | psa_algorithm_t | alg,
|  | const uint8_t * | hash,
|  | size_t | hash_length,
|  | const uint8_t * | signature,
|  | size_t | signature_length
| ) |  |

inline static

Definition at line 140 of file crypto_compat.h.

References psa_verify_hash().

## psa_close_key()

psa_status_t psa_close_key | ( | psa_key_handle_t | handle | ) |

Close a key handle.

If the handle designates a volatile key, this will destroy the key material and free all associated resources, just like psa_destroy_key().

If this is the last open handle to a persistent key, then closing the handle will free all resources associated with the key in volatile memory. The key data in persistent storage is not affected and can be opened again later with a call to psa_open_key().

Closing the key handle makes the handle invalid, and the key handle must not be used again by the application.

Note
  This API is not part of the PSA Cryptography API Release 1.0.0 specification. It was defined in the 1.0 Beta 3 version of the specification but was removed in the 1.0.0 released version. This API is kept for the time being to not break applications relying on it. It is not deprecated yet but will be in the near future.
  If the key handle was used to set up an active :ref:`multipart operation <multipart-operations>`, then closing the key handle can cause the multipart operation to fail. Applications should maintain the key handle until after the multipart operation has finished.

Parameters

  handle | The key handle to close. If this is `0`, do nothing and return `PSA_SUCCESS`.

Return values

  PSA_SUCCESS | `handle` was a valid handle or `0`. It is now closed.
  PSA_ERROR_INVALID_HANDLE | `handle` is not a valid handle nor `0`.
  PSA_ERROR_COMMUNICATION_FAILURE |
  PSA_ERROR_CORRUPTION_DETECTED |
  PSA_ERROR_BAD_STATE | The library has not been previously initialized by psa_crypto_init(). It is implementation-dependent whether a failure to initialize results in this error code.

## psa_key_handle_is_null()

static int psa_key_handle_is_null | ( | psa_key_handle_t | handle | ) |

inline static

Check whether an handle is null.

Parameters

  handle | Handle

Returns
  Non-zero if the handle is null, zero otherwise.

Definition at line 53 of file crypto_compat.h.

References mbedtls_svc_key_id_is_null().

## psa_open_key()

psa_status_t psa_open_key | ( | mbedtls_svc_key_id_t | key,
|  | psa_key_handle_t * | handle
| ) |  |

Open a handle to an existing persistent key.

Open a handle to a persistent key. A key is persistent if it was created with a lifetime other than PSA_KEY_LIFETIME_VOLATILE. A persistent key always has a nonzero key identifier, set with psa_set_key_id() when creating the key. Implementations may provide additional pre-provisioned keys that can be opened with psa_open_key(). Such keys have an application key identifier in the vendor range, as documented in the description of psa_key_id_t.

The application must eventually close the handle with psa_close_key() or psa_destroy_key() to release associated resources. If the application dies without calling one of these functions, the implementation should perform the equivalent of a call to psa_close_key().

Some implementations permit an application to open the same key multiple times. If this is successful, each call to psa_open_key() will return a different key handle.

Note
  This API is not part of the PSA Cryptography API Release 1.0.0 specification. It was defined in the 1.0 Beta 3 version of the specification but was removed in the 1.0.0 released version. This API is kept for the time being to not break applications relying on it. It is not deprecated yet but will be in the near future.
  Applications that rely on opening a key multiple times will not be portable to implementations that only permit a single key handle to be opened. See also :ref:`key-handles`.

Parameters

  | key | The persistent identifier of the key.
  [out] | handle | On success, a handle to the key.

Return values

  PSA_SUCCESS | Success. The application can now use the value of `*handle` to access the key.
  PSA_ERROR_INSUFFICIENT_MEMORY | The implementation does not have sufficient resources to open the key. This can be due to reaching an implementation limit on the number of open keys, the number of open key handles, or available memory.
  PSA_ERROR_DOES_NOT_EXIST | There is no persistent key with key identifier `key`.
  PSA_ERROR_INVALID_ARGUMENT | `key` is not a valid persistent key identifier.
  PSA_ERROR_NOT_PERMITTED | The specified key exists, but the application does not have the permission to access it. Note that this specification does not define any way to create such a key, but it may be possible through implementation-specific means.
  PSA_ERROR_COMMUNICATION_FAILURE |
  PSA_ERROR_CORRUPTION_DETECTED |
  PSA_ERROR_STORAGE_FAILURE |
  PSA_ERROR_DATA_INVALID |
  PSA_ERROR_DATA_CORRUPT |
  PSA_ERROR_BAD_STATE | The library has not been previously initialized by psa_crypto_init(). It is implementation-dependent whether a failure to initialize results in this error code.