mbed TLS v2.23.0: crypto.h File Reference

mbed TLS v2.23.0

Macros | Typedefs | Functions
crypto.h File Reference

Platform Security Architecture cryptography module. More...

`#include "crypto_platform.h"`
`#include <stddef.h>`
`#include "crypto_types.h"`
`#include "crypto_values.h"`
`#include "crypto_sizes.h"`
`#include "crypto_struct.h"`
`#include "crypto_extra.h"`
Include dependency graph for crypto.h:

Go to the source code of this file.

## Macros
#define | PSA_CRYPTO_API_VERSION_MAJOR 1
#define | PSA_CRYPTO_API_VERSION_MINOR 0
#define | PSA_KEY_DERIVATION_UNLIMITED_CAPACITY ((size_t)(-1))

## Typedefs
typedef struct psa_hash_operation_s | psa_hash_operation_t
typedef struct psa_mac_operation_s | psa_mac_operation_t
typedef struct psa_cipher_operation_s | psa_cipher_operation_t
typedef struct psa_aead_operation_s | psa_aead_operation_t
typedef struct psa_key_derivation_s | psa_key_derivation_operation_t

## Functions
psa_status_t | psa_crypto_init (void)
| Library initialization. More...
static psa_key_attributes_t | psa_key_attributes_init (void)
static void | psa_set_key_id (psa_key_attributes_t *attributes, psa_key_id_t id)
static void | psa_set_key_lifetime (psa_key_attributes_t *attributes, psa_key_lifetime_t lifetime)
static psa_key_id_t | psa_get_key_id (const psa_key_attributes_t *attributes)
static psa_key_lifetime_t | psa_get_key_lifetime (const psa_key_attributes_t *attributes)
static void | psa_set_key_usage_flags (psa_key_attributes_t *attributes, psa_key_usage_t usage_flags)
static psa_key_usage_t | psa_get_key_usage_flags (const psa_key_attributes_t *attributes)
static void | psa_set_key_algorithm (psa_key_attributes_t *attributes, psa_algorithm_t alg)
static psa_algorithm_t | psa_get_key_algorithm (const psa_key_attributes_t *attributes)
static void | psa_set_key_type (psa_key_attributes_t *attributes, psa_key_type_t type)
static void | psa_set_key_bits (psa_key_attributes_t *attributes, size_t bits)
static psa_key_type_t | psa_get_key_type (const psa_key_attributes_t *attributes)
static size_t | psa_get_key_bits (const psa_key_attributes_t *attributes)
psa_status_t | psa_get_key_attributes (psa_key_handle_t handle, psa_key_attributes_t *attributes)
void | psa_reset_key_attributes (psa_key_attributes_t *attributes)
psa_status_t | psa_open_key (psa_key_id_t id, psa_key_handle_t *handle)
psa_status_t | psa_close_key (psa_key_handle_t handle)
psa_status_t | psa_copy_key (psa_key_handle_t source_handle, const psa_key_attributes_t *attributes, psa_key_handle_t *target_handle)
psa_status_t | psa_destroy_key (psa_key_handle_t handle)
| Destroy a key. More...
psa_status_t | psa_import_key (const psa_key_attributes_t *attributes, const uint8_t *data, size_t data_length, psa_key_handle_t *handle)
| Import a key in binary format. More...
psa_status_t | psa_export_key (psa_key_handle_t handle, uint8_t *data, size_t data_size, size_t *data_length)
| Export a key in binary format. More...
psa_status_t | psa_export_public_key (psa_key_handle_t handle, uint8_t *data, size_t data_size, size_t *data_length)
| Export a public key or the public part of a key pair in binary format. More...
psa_status_t | psa_hash_compute (psa_algorithm_t alg, const uint8_t *input, size_t input_length, uint8_t *hash, size_t hash_size, size_t *hash_length)
psa_status_t | psa_hash_compare (psa_algorithm_t alg, const uint8_t *input, size_t input_length, const uint8_t *hash, size_t hash_length)
static psa_hash_operation_t | psa_hash_operation_init (void)
psa_status_t | psa_hash_setup (psa_hash_operation_t *operation, psa_algorithm_t alg)
psa_status_t | psa_hash_update (psa_hash_operation_t *operation, const uint8_t *input, size_t input_length)
psa_status_t | psa_hash_finish (psa_hash_operation_t *operation, uint8_t *hash, size_t hash_size, size_t *hash_length)
psa_status_t | psa_hash_verify (psa_hash_operation_t *operation, const uint8_t *hash, size_t hash_length)
psa_status_t | psa_hash_abort (psa_hash_operation_t *operation)
psa_status_t | psa_hash_clone (const psa_hash_operation_t *source_operation, psa_hash_operation_t *target_operation)
psa_status_t | psa_mac_compute (psa_key_handle_t handle, psa_algorithm_t alg, const uint8_t *input, size_t input_length, uint8_t *mac, size_t mac_size, size_t *mac_length)
psa_status_t | psa_mac_verify (psa_key_handle_t handle, psa_algorithm_t alg, const uint8_t *input, size_t input_length, const uint8_t *mac, size_t mac_length)
static psa_mac_operation_t | psa_mac_operation_init (void)
psa_status_t | psa_mac_sign_setup (psa_mac_operation_t *operation, psa_key_handle_t handle, psa_algorithm_t alg)
psa_status_t | psa_mac_verify_setup (psa_mac_operation_t *operation, psa_key_handle_t handle, psa_algorithm_t alg)
psa_status_t | psa_mac_update (psa_mac_operation_t *operation, const uint8_t *input, size_t input_length)
psa_status_t | psa_mac_sign_finish (psa_mac_operation_t *operation, uint8_t *mac, size_t mac_size, size_t *mac_length)
psa_status_t | psa_mac_verify_finish (psa_mac_operation_t *operation, const uint8_t *mac, size_t mac_length)
psa_status_t | psa_mac_abort (psa_mac_operation_t *operation)
psa_status_t | psa_cipher_encrypt (psa_key_handle_t handle, psa_algorithm_t alg, const uint8_t *input, size_t input_length, uint8_t *output, size_t output_size, size_t *output_length)
psa_status_t | psa_cipher_decrypt (psa_key_handle_t handle, psa_algorithm_t alg, const uint8_t *input, size_t input_length, uint8_t *output, size_t output_size, size_t *output_length)
static psa_cipher_operation_t | psa_cipher_operation_init (void)
psa_status_t | psa_cipher_encrypt_setup (psa_cipher_operation_t *operation, psa_key_handle_t handle, psa_algorithm_t alg)
psa_status_t | psa_cipher_decrypt_setup (psa_cipher_operation_t *operation, psa_key_handle_t handle, psa_algorithm_t alg)
psa_status_t | psa_cipher_generate_iv (psa_cipher_operation_t *operation, uint8_t *iv, size_t iv_size, size_t *iv_length)
psa_status_t | psa_cipher_set_iv (psa_cipher_operation_t *operation, const uint8_t *iv, size_t iv_length)
psa_status_t | psa_cipher_update (psa_cipher_operation_t *operation, const uint8_t *input, size_t input_length, uint8_t *output, size_t output_size, size_t *output_length)
psa_status_t | psa_cipher_finish (psa_cipher_operation_t *operation, uint8_t *output, size_t output_size, size_t *output_length)
psa_status_t | psa_cipher_abort (psa_cipher_operation_t *operation)
psa_status_t | psa_aead_encrypt (psa_key_handle_t handle, psa_algorithm_t alg, const uint8_t *nonce, size_t nonce_length, const uint8_t *additional_data, size_t additional_data_length, const uint8_t *plaintext, size_t plaintext_length, uint8_t *ciphertext, size_t ciphertext_size, size_t *ciphertext_length)
psa_status_t | psa_aead_decrypt (psa_key_handle_t handle, psa_algorithm_t alg, const uint8_t *nonce, size_t nonce_length, const uint8_t *additional_data, size_t additional_data_length, const uint8_t *ciphertext, size_t ciphertext_length, uint8_t *plaintext, size_t plaintext_size, size_t *plaintext_length)
static psa_aead_operation_t | psa_aead_operation_init (void)
psa_status_t | psa_aead_encrypt_setup (psa_aead_operation_t *operation, psa_key_handle_t handle, psa_algorithm_t alg)
psa_status_t | psa_aead_decrypt_setup (psa_aead_operation_t *operation, psa_key_handle_t handle, psa_algorithm_t alg)
psa_status_t | psa_aead_generate_nonce (psa_aead_operation_t *operation, uint8_t *nonce, size_t nonce_size, size_t *nonce_length)
psa_status_t | psa_aead_set_nonce (psa_aead_operation_t *operation, const uint8_t *nonce, size_t nonce_length)
psa_status_t | psa_aead_set_lengths (psa_aead_operation_t *operation, size_t ad_length, size_t plaintext_length)
psa_status_t | psa_aead_update_ad (psa_aead_operation_t *operation, const uint8_t *input, size_t input_length)
psa_status_t | psa_aead_update (psa_aead_operation_t *operation, const uint8_t *input, size_t input_length, uint8_t *output, size_t output_size, size_t *output_length)
psa_status_t | psa_aead_finish (psa_aead_operation_t *operation, uint8_t *ciphertext, size_t ciphertext_size, size_t *ciphertext_length, uint8_t *tag, size_t tag_size, size_t *tag_length)
psa_status_t | psa_aead_verify (psa_aead_operation_t *operation, uint8_t *plaintext, size_t plaintext_size, size_t *plaintext_length, const uint8_t *tag, size_t tag_length)
psa_status_t | psa_aead_abort (psa_aead_operation_t *operation)
psa_status_t | psa_sign_hash (psa_key_handle_t handle, psa_algorithm_t alg, const uint8_t *hash, size_t hash_length, uint8_t *signature, size_t signature_size, size_t *signature_length)
| Sign a hash or short message with a private key. More...
psa_status_t | psa_verify_hash (psa_key_handle_t handle, psa_algorithm_t alg, const uint8_t *hash, size_t hash_length, const uint8_t *signature, size_t signature_length)
| Verify the signature a hash or short message using a public key. More...
psa_status_t | psa_asymmetric_encrypt (psa_key_handle_t handle, psa_algorithm_t alg, const uint8_t *input, size_t input_length, const uint8_t *salt, size_t salt_length, uint8_t *output, size_t output_size, size_t *output_length)
| Encrypt a short message with a public key. More...
psa_status_t | psa_asymmetric_decrypt (psa_key_handle_t handle, psa_algorithm_t alg, const uint8_t *input, size_t input_length, const uint8_t *salt, size_t salt_length, uint8_t *output, size_t output_size, size_t *output_length)
| Decrypt a short message with a private key. More...
static psa_key_derivation_operation_t | psa_key_derivation_operation_init (void)
psa_status_t | psa_key_derivation_setup (psa_key_derivation_operation_t *operation, psa_algorithm_t alg)
psa_status_t | psa_key_derivation_get_capacity (const psa_key_derivation_operation_t *operation, size_t *capacity)
psa_status_t | psa_key_derivation_set_capacity (psa_key_derivation_operation_t *operation, size_t capacity)
psa_status_t | psa_key_derivation_input_bytes (psa_key_derivation_operation_t *operation, psa_key_derivation_step_t step, const uint8_t *data, size_t data_length)
psa_status_t | psa_key_derivation_input_key (psa_key_derivation_operation_t *operation, psa_key_derivation_step_t step, psa_key_handle_t handle)
psa_status_t | psa_key_derivation_key_agreement (psa_key_derivation_operation_t *operation, psa_key_derivation_step_t step, psa_key_handle_t private_key, const uint8_t *peer_key, size_t peer_key_length)
psa_status_t | psa_key_derivation_output_bytes (psa_key_derivation_operation_t *operation, uint8_t *output, size_t output_length)
psa_status_t | psa_key_derivation_output_key (const psa_key_attributes_t *attributes, psa_key_derivation_operation_t *operation, psa_key_handle_t *handle)
psa_status_t | psa_key_derivation_abort (psa_key_derivation_operation_t *operation)
psa_status_t | psa_raw_key_agreement (psa_algorithm_t alg, psa_key_handle_t private_key, const uint8_t *peer_key, size_t peer_key_length, uint8_t *output, size_t output_size, size_t *output_length)
psa_status_t | psa_generate_random (uint8_t *output, size_t output_size)
| Generate random bytes. More...
psa_status_t | psa_generate_key (const psa_key_attributes_t *attributes, psa_key_handle_t *handle)
| Generate a key or key pair. More...

## Detailed Description

Platform Security Architecture cryptography module.

Definition in file crypto.h.