Loading...
Searching...
No Matches
Functions defined by a client provider

## Functions

int | psa_can_do_hash (psa_algorithm_t hash_alg)
int | psa_can_do_cipher (psa_key_type_t key_type, psa_algorithm_t cipher_alg)

## Detailed Description

The functions in this group are meant to be implemented by providers of the PSA Crypto client interface. They are provided by the library when MBEDTLS_PSA_CRYPTO_C is enabled.

Note
  All functions in this group are experimental, as using alternative client interface providers is experimental.

## Function Documentation

## psa_can_do_cipher()

int psa_can_do_cipher | ( | psa_key_type_t | key_type,
|  | psa_algorithm_t | cipher_alg )

Tell if PSA is ready for this cipher.

Note
  When using the built-in version of the PSA core (i.e. MBEDTLS_PSA_CRYPTO_C is set), for now, this function only checks the state of the driver subsystem, not the key type and algorithm. This might be improved in the future.

Parameters

  key_type | The key type.
  cipher_alg | The cipher algorithm.

Returns
  1 if the PSA can handle `cipher_alg`, 0 otherwise.

## psa_can_do_hash()

int psa_can_do_hash | ( | psa_algorithm_t | hash_alg | ) |

Check if PSA is capable of handling the specified hash algorithm.

This means that PSA core was built with the corresponding PSA_WANT_ALG_xxx set and that psa_crypto_init has already been called.

Note
  When using the built-in version of the PSA core (i.e. MBEDTLS_PSA_CRYPTO_C is set), for now, this function only checks the state of the driver subsystem, not the algorithm. This might be improved in the future.

Parameters

  hash_alg | The hash algorithm.

Returns
  1 if the PSA can handle `hash_alg`, 0 otherwise.