Files | |
| file | psa_ciphers.h |
| Function declarations for low level wrapper functions for cipher operations. | |
Functions | |
| psa_status_t | psa_cipher_cbc_aes_128_encrypt (const psa_key_attributes_t *attributes, const uint8_t *key_buffer, size_t key_buffer_size, psa_algorithm_t alg, const uint8_t *input, size_t input_length, uint8_t *output, size_t output_size, size_t *output_length) |
| Low level wrapper function to call a driver for an AES 128 CBC encryption. More... | |
| psa_status_t | psa_cipher_cbc_aes_128_decrypt (const psa_key_attributes_t *attributes, const uint8_t *key_buffer, size_t key_buffer_size, psa_algorithm_t alg, const uint8_t *input, size_t input_length, uint8_t *output, size_t output_size, size_t *output_length) |
| Low level wrapper function to call a driver for an AES 128 CBC decryption. More... | |
| psa_status_t | psa_cipher_cbc_aes_192_encrypt (const psa_key_attributes_t *attributes, const uint8_t *key_buffer, size_t key_buffer_size, psa_algorithm_t alg, const uint8_t *input, size_t input_length, uint8_t *output, size_t output_size, size_t *output_length) |
| Low level wrapper function to call a driver for an AES 192 CBC encryption. More... | |
| psa_status_t | psa_cipher_cbc_aes_256_encrypt (const psa_key_attributes_t *attributes, const uint8_t *key_buffer, size_t key_buffer_size, psa_algorithm_t alg, const uint8_t *input, size_t input_length, uint8_t *output, size_t output_size, size_t *output_length) |
| Low level wrapper function to call a driver for an AES 256 CBC encryption. More... | |
| psa_status_t | psa_cipher_chacha20_encrypt_setup (psa_cipher_chacha20_ctx_t *ctx, uint8_t *key_data, size_t key_length) |
| ChaCha20 setup function. More... | |
| psa_status_t | psa_cipher_chacha20_decrypt_setup (psa_cipher_chacha20_ctx_t *ctx, uint8_t *key_data, size_t key_length) |
| ChaCha20 setup function. More... | |
| psa_status_t | psa_cipher_chacha20_set_iv (psa_cipher_chacha20_ctx_t *ctx, const uint8_t *iv, size_t iv_length) |
| ChaCha20 set nonce and initial counter function. More... | |
| psa_status_t | psa_cipher_chacha20_update (psa_cipher_chacha20_ctx_t *ctx, const uint8_t *input, size_t input_length, uint8_t *output, size_t output_size, size_t *output_length) |
| ChaCha20 update function, encrypting/decrypting aligned blocks. More... | |
| psa_status_t | psa_cipher_chacha20_finish (psa_cipher_chacha20_ctx_t *ctx, uint8_t *output, size_t output_size, size_t *output_length) |
| ChaCha20 finish function. More... | |
| psa_status_t | psa_cipher_chacha20_encrypt (uint8_t *key_buffer, size_t key_buffer_size, const uint8_t *input, size_t input_length, uint8_t *output, size_t output_size, size_t *output_length) |
| Low level wrapper function to call a driver for ChaCha20 encryption/decryption. More... | |
| psa_status_t | psa_cipher_chacha20_decrypt (uint8_t *key_buffer, size_t key_buffer_size, const uint8_t *input, size_t input_length, uint8_t *output, size_t output_size, size_t *output_length) |
| Low level wrapper function to call a driver for ChaCha20 decryption. More... | |
| psa_status_t psa_cipher_cbc_aes_128_decrypt | ( | const psa_key_attributes_t * | attributes, |
| const uint8_t * | key_buffer, | ||
| size_t | key_buffer_size, | ||
| psa_algorithm_t | alg, | ||
| const uint8_t * | input, | ||
| size_t | input_length, | ||
| uint8_t * | output, | ||
| size_t | output_size, | ||
| size_t * | output_length | ||
| ) |
Low level wrapper function to call a driver for an AES 128 CBC decryption.
| psa_status_t psa_cipher_cbc_aes_128_encrypt | ( | const psa_key_attributes_t * | attributes, |
| const uint8_t * | key_buffer, | ||
| size_t | key_buffer_size, | ||
| psa_algorithm_t | alg, | ||
| const uint8_t * | input, | ||
| size_t | input_length, | ||
| uint8_t * | output, | ||
| size_t | output_size, | ||
| size_t * | output_length | ||
| ) |
Low level wrapper function to call a driver for an AES 128 CBC encryption.
| psa_status_t psa_cipher_cbc_aes_192_encrypt | ( | const psa_key_attributes_t * | attributes, |
| const uint8_t * | key_buffer, | ||
| size_t | key_buffer_size, | ||
| psa_algorithm_t | alg, | ||
| const uint8_t * | input, | ||
| size_t | input_length, | ||
| uint8_t * | output, | ||
| size_t | output_size, | ||
| size_t * | output_length | ||
| ) |
Low level wrapper function to call a driver for an AES 192 CBC encryption.
| psa_status_t psa_cipher_cbc_aes_256_encrypt | ( | const psa_key_attributes_t * | attributes, |
| const uint8_t * | key_buffer, | ||
| size_t | key_buffer_size, | ||
| psa_algorithm_t | alg, | ||
| const uint8_t * | input, | ||
| size_t | input_length, | ||
| uint8_t * | output, | ||
| size_t | output_size, | ||
| size_t * | output_length | ||
| ) |
Low level wrapper function to call a driver for an AES 256 CBC encryption.
| psa_status_t psa_cipher_chacha20_decrypt | ( | uint8_t * | key_buffer, |
| size_t | key_buffer_size, | ||
| const uint8_t * | input, | ||
| size_t | input_length, | ||
| uint8_t * | output, | ||
| size_t | output_size, | ||
| size_t * | output_length | ||
| ) |
Low level wrapper function to call a driver for ChaCha20 decryption.
See psa_cipher_decrypt().
| key_buffer | Buffer containing the Key. |
| key_buffer_size | Size of the key in bytes. Must be 32 bytes long. |
| input | Input buffer containing the 12 byte nonce used in the encryption followed by the cipher to be decrypted. |
| input_length | Size of input buffer (including 12 byte nonce). |
| output | Output buffer. |
| output_size | Size of output buffer. Must be at least (input_length - 12) bytes long. |
| output_length | Actual size of the output. |
| psa_status_t psa_cipher_chacha20_decrypt_setup | ( | psa_cipher_chacha20_ctx_t * | ctx, |
| uint8_t * | key_data, | ||
| size_t | key_length | ||
| ) |
ChaCha20 setup function.
| ctx | Driver specific ChaCha20 context of type psa_cipher_chacha20_ctx_t |
| key_data | Key Buffer. |
| key_length | Length of the key buffer. Must be 32 bytes. |
| psa_status_t psa_cipher_chacha20_encrypt | ( | uint8_t * | key_buffer, |
| size_t | key_buffer_size, | ||
| const uint8_t * | input, | ||
| size_t | input_length, | ||
| uint8_t * | output, | ||
| size_t | output_size, | ||
| size_t * | output_length | ||
| ) |
Low level wrapper function to call a driver for ChaCha20 encryption/decryption.
See psa_cipher_encrypt().
| key_buffer | Buffer containing the Key. |
| key_buffer_size | Size of the key in bytes. Must be 32 bytes. |
| input | Input Buffer containing the message to be encrypted. |
| input_length | Size of input buffer. |
| output | Output buffer containing the generated 12 byte nonce followed by the cipher of the input. |
| output_size | Size of output buffer. Must be at least (input_length + 12) bytes long. |
| output_length | Actual size of the output (including nonce). |
| psa_status_t psa_cipher_chacha20_encrypt_setup | ( | psa_cipher_chacha20_ctx_t * | ctx, |
| uint8_t * | key_data, | ||
| size_t | key_length | ||
| ) |
ChaCha20 setup function.
| ctx | Driver specific ChaCha20 context of type psa_cipher_chacha20_ctx_t |
| key_data | Key Buffer. |
| key_length | Length of the key buffer. Must be 32 bytes. |
| psa_status_t psa_cipher_chacha20_finish | ( | psa_cipher_chacha20_ctx_t * | ctx, |
| uint8_t * | output, | ||
| size_t | output_size, | ||
| size_t * | output_length | ||
| ) |
ChaCha20 finish function.
Outputs the xcrytion of the remaining buffer.
| ctx | Driver specific ChaCha context of type psa_cipher_chacha20_ctx_t |
| output | Output Buffer for the encrypted/decrypted data |
| output_size | Length of output buffer. Must be large enough to fit the buffer (64B). |
| output_length | Actual length of the output data. Will be less than Block size (64B). |
| psa_status_t psa_cipher_chacha20_set_iv | ( | psa_cipher_chacha20_ctx_t * | ctx, |
| const uint8_t * | iv, | ||
| size_t | iv_length | ||
| ) |
ChaCha20 set nonce and initial counter function.
| ctx | Driver specific ChaCha20 context of type psa_cipher_chacha20_ctx_t |
| iv | Buffer of IV to be set |
| iv_length | Length of the IV Buffer.
|
| psa_status_t psa_cipher_chacha20_update | ( | psa_cipher_chacha20_ctx_t * | ctx, |
| const uint8_t * | input, | ||
| size_t | input_length, | ||
| uint8_t * | output, | ||
| size_t | output_size, | ||
| size_t * | output_length | ||
| ) |
ChaCha20 update function, encrypting/decrypting aligned blocks.
| ctx | Driver specific ChaCha20 context of type psa_cipher_chacha20_ctx_t |
| input | Input that is going to be encrypted/decrypted |
| input_length | Length of input buffer |
| output | Output Buffer for the encrypted/decrypted input |
| output_size | Length of output buffer. Must be large enough to fit the output blocks from buffer and input |
| output_length | Actual length of the output data. Will be multiple of Block size (64B). |