The type of the state data structure for multipart cipher operations.
Before calling any function on a cipher operation object, the application must initialize it by any of the following means:
operation
Bit operations.
#define PSA_CIPHER_OPERATION_INIT
This macro returns a suitable initializer for a cipher operation object of type psa_cipher_operation_...
static psa_cipher_operation_t psa_cipher_operation_init(void)
Return an initial value for a cipher operation object.
This is an implementation-defined struct
. Applications should not make any assumptions about the content of this structure. Implementation details can change in future versions without notice.
Definition at line 1682 of file crypto.h.
◆ psa_cipher_abort() ◆ psa_cipher_decrypt()Decrypt a message using a symmetric cipher.
This function decrypts a message encrypted with a symmetric cipher.
PSA_ALG_XXX
value such that PSA_ALG_IS_CIPHER(alg
) is true). [in] input Buffer containing the message to decrypt. This consists of the IV followed by the ciphertext proper. input_length Size of the input
buffer in bytes. [out] output Buffer where the plaintext is to be written. output_size Size of the output
buffer in bytes. [out] output_length On success, the number of bytes that make up the output.
Set the key for a multipart symmetric decryption operation.
The sequence of operations to decrypt a message with a symmetric cipher is as follows:
If an error occurs at any step after a call to psa_cipher_decrypt_setup(), the operation will need to be reset by a call to psa_cipher_abort(). The application may call psa_cipher_abort() at any time after the operation has been initialized.
After a successful call to psa_cipher_decrypt_setup(), the application must eventually terminate the operation. The following events terminate an operation:
PSA_ALG_XXX
value such that PSA_ALG_IS_CIPHER(alg
) is true).
Encrypt a message using a symmetric cipher.
This function encrypts a message with a random IV (initialization vector). Use the multipart operation interface with a psa_cipher_operation_t object to provide other forms of IV.
PSA_ALG_XXX
value such that PSA_ALG_IS_CIPHER(alg
) is true). [in] input Buffer containing the message to encrypt. input_length Size of the input
buffer in bytes. [out] output Buffer where the output is to be written. The output contains the IV followed by the ciphertext proper. output_size Size of the output
buffer in bytes. [out] output_length On success, the number of bytes that make up the output.
Finish encrypting or decrypting a message in a cipher operation.
The application must call psa_cipher_encrypt_setup() or psa_cipher_decrypt_setup() before calling this function. The choice of setup function determines whether this function encrypts or decrypts its input.
This function finishes the encryption or decryption of the message formed by concatenating the inputs passed to preceding calls to psa_cipher_update().
When this function returns successfully, the operation becomes inactive. If this function returns an error status, the operation enters an error state and must be aborted by calling psa_cipher_abort().
output
buffer in bytes. [out] output_length On success, the number of bytes that make up the returned output.
Generate an IV for a symmetric encryption operation.
This function generates a random IV (initialization vector), nonce or initial counter value for the encryption operation as appropriate for the chosen algorithm, key type and key size.
The application must call psa_cipher_encrypt_setup() before calling this function.
If this function returns an error status, the operation enters an error state and must be aborted by calling psa_cipher_abort().
iv
buffer in bytes. [out] iv_length On success, the number of bytes of the generated IV.
Return an initial value for a cipher operation object.
◆ psa_cipher_set_iv()Set the IV for a symmetric encryption or decryption operation.
This function sets the IV (initialization vector), nonce or initial counter value for the encryption or decryption operation.
The application must call psa_cipher_encrypt_setup() before calling this function.
If this function returns an error status, the operation enters an error state and must be aborted by calling psa_cipher_abort().
Encrypt or decrypt a message fragment in an active cipher operation.
Before calling this function, you must: 1. Call either psa_cipher_encrypt_setup() or psa_cipher_decrypt_setup(). The choice of setup function determines whether this function encrypts or decrypts its input. 2. If the algorithm requires an IV, call psa_cipher_generate_iv() (recommended when encrypting) or psa_cipher_set_iv().
If this function returns an error status, the operation enters an error state and must be aborted by calling psa_cipher_abort().
input
buffer in bytes. [out] output Buffer where the output is to be written. output_size Size of the output
buffer in bytes. [out] output_length On success, the number of bytes that make up the returned output.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4