Cipher size definitions for the PSA Crypto API. More...
Cipher size definitions for the PSA Crypto API.
Definition in file sizes.h.
Go to the source code of this file.
#define | PSA_BLOCK_CIPHER_BLOCK_LENGTH(type) |
The block size of a block cipher. | |
#define | PSA_BLOCK_CIPHER_BLOCK_MAX_SIZE /* implementation-defined value */ |
The maximum block size of a block cipher supported by the implementation. | |
#define | PSA_CIPHER_IV_LENGTH(key_type, alg) |
The default IV size for a cipher algorithm, in bytes. | |
#define | PSA_CIPHER_IV_MAX_SIZE /* implementation-defined value */ |
A sufficient buffer size for storing the IV generated by psa_cipher_generate_iv(), for any of the supported key types and cipher algorithms. | |
#define | PSA_CIPHER_ENCRYPT_OUTPUT_SIZE(key_type, alg, input_length) |
The maximum size of the output of psa_cipher_encrypt(), in bytes. | |
#define | PSA_CIPHER_ENCRYPT_OUTPUT_MAX_SIZE(input_length) |
A sufficient output buffer size for psa_cipher_encrypt(), for any of the supported key types and cipher algorithms. | |
#define | PSA_CIPHER_DECRYPT_OUTPUT_SIZE(key_type, alg, input_length) |
The maximum size of the output of psa_cipher_decrypt(), in bytes. | |
#define | PSA_CIPHER_DECRYPT_OUTPUT_MAX_SIZE(input_length) |
A sufficient output buffer size for psa_cipher_decrypt(), for any of the supported key types and cipher algorithms. | |
#define | PSA_CIPHER_UPDATE_OUTPUT_SIZE(key_type, alg, input_length) |
A sufficient output buffer size for psa_cipher_update(). | |
#define | PSA_CIPHER_UPDATE_OUTPUT_MAX_SIZE(input_length) |
A sufficient output buffer size for psa_cipher_update(), for any of the supported key types and cipher algorithms. | |
#define | PSA_CIPHER_FINISH_OUTPUT_SIZE(key_type, alg) |
A sufficient output buffer size for psa_cipher_finish(). | |
#define | PSA_CIPHER_FINISH_OUTPUT_MAX_SIZE /* implementation-defined value */ |
A sufficient output buffer size for psa_cipher_finish(), for any of the supported key types and cipher algorithms. | |
#define PSA_BLOCK_CIPHER_BLOCK_LENGTH | ( | type | ) |
The block size of a block cipher.
type | A cipher key type (value of type psa_key_type_t). |
#define PSA_BLOCK_CIPHER_BLOCK_MAX_SIZE /* implementation-defined value */ |
The maximum block size of a block cipher supported by the implementation.
See also PSA_BLOCK_CIPHER_BLOCK_LENGTH().
#define PSA_CIPHER_DECRYPT_OUTPUT_MAX_SIZE | ( | input_length | ) |
A sufficient output buffer size for psa_cipher_decrypt(), for any of the supported key types and cipher algorithms.
If the size of the output buffer is at least this large, it is guaranteed that psa_cipher_decrypt() will not fail due to an insufficient buffer size.
See also PSA_CIPHER_DECRYPT_OUTPUT_SIZE().
input_length | Size of the input in bytes. |
#define PSA_CIPHER_DECRYPT_OUTPUT_SIZE | ( | key_type, | |
alg, | |||
input_length ) |
The maximum size of the output of psa_cipher_decrypt(), in bytes.
If the size of the output buffer is at least this large, it is guaranteed that psa_cipher_decrypt() will not fail due to an insufficient buffer size. Depending on the algorithm, the actual size of the output might be smaller.
See also PSA_CIPHER_DECRYPT_OUTPUT_MAX_SIZE.
key_type | A symmetric key type that is compatible with algorithm alg. |
alg | A cipher algorithm (PSA_ALG_XXX value such that PSA_ALG_IS_CIPHER(alg ) is true). |
input_length | Size of the input in bytes. |
#define PSA_CIPHER_ENCRYPT_OUTPUT_MAX_SIZE | ( | input_length | ) |
A sufficient output buffer size for psa_cipher_encrypt(), for any of the supported key types and cipher algorithms.
If the size of the output buffer is at least this large, it is guaranteed that psa_cipher_encrypt() will not fail due to an insufficient buffer size.
See also PSA_CIPHER_ENCRYPT_OUTPUT_SIZE().
input_length | Size of the input in bytes. |
#define PSA_CIPHER_ENCRYPT_OUTPUT_SIZE | ( | key_type, | |
alg, | |||
input_length ) |
The maximum size of the output of psa_cipher_encrypt(), in bytes.
If the size of the output buffer is at least this large, it is guaranteed that psa_cipher_encrypt() will not fail due to an insufficient buffer size. Depending on the algorithm, the actual size of the output might be smaller.
See also PSA_CIPHER_ENCRYPT_OUTPUT_MAX_SIZE.
key_type | A symmetric key type that is compatible with algorithm alg. |
alg | A cipher algorithm (PSA_ALG_XXX value such that PSA_ALG_IS_CIPHER(alg ) is true). |
input_length | Size of the input in bytes. |
#define PSA_CIPHER_FINISH_OUTPUT_MAX_SIZE /* implementation-defined value */ |
A sufficient output buffer size for psa_cipher_finish(), for any of the supported key types and cipher algorithms.
If the size of the output buffer is at least this large, it is guaranteed that psa_cipher_finish() will not fail due to an insufficient buffer size.
See also PSA_CIPHER_FINISH_OUTPUT_SIZE().
#define PSA_CIPHER_FINISH_OUTPUT_SIZE | ( | key_type, | |
alg ) |
A sufficient output buffer size for psa_cipher_finish().
If the size of the output buffer is at least this large, it is guaranteed that psa_cipher_finish() will not fail due to an insufficient buffer size. The actual size of the output might be smaller in any given call.
See also PSA_CIPHER_FINISH_OUTPUT_MAX_SIZE.
key_type | A symmetric key type that is compatible with algorithm alg. |
alg | A cipher algorithm: a value of type psa_algorithm_t such that PSA_ALG_IS_CIPHER(alg ) is true. |
#define PSA_CIPHER_IV_LENGTH | ( | key_type, | |
alg ) |
The default IV size for a cipher algorithm, in bytes.
The IV that is generated as part of a call to psa_cipher_encrypt() is always the default IV length for the algorithm.
This macro can be used to allocate a buffer of sufficient size to store the IV output from psa_cipher_generate_iv() when using a multi-part cipher operation.
See also PSA_CIPHER_IV_MAX_SIZE.
key_type | A symmetric key type that is compatible with algorithm alg. |
alg | A cipher algorithm (PSA_ALG_XXX value such that PSA_ALG_IS_CIPHER(alg ) is true) |
#define PSA_CIPHER_IV_MAX_SIZE /* implementation-defined value */ |
A sufficient buffer size for storing the IV generated by psa_cipher_generate_iv(), for any of the supported key types and cipher algorithms.
If the size of the IV buffer is at least this large, it is guaranteed that psa_cipher_generate_iv() will not fail due to an insufficient buffer size.
See also PSA_CIPHER_IV_LENGTH().
#define PSA_CIPHER_UPDATE_OUTPUT_MAX_SIZE | ( | input_length | ) |
A sufficient output buffer size for psa_cipher_update(), for any of the supported key types and cipher algorithms.
If the size of the output buffer is at least this large, it is guaranteed that psa_cipher_update() will not fail due to an insufficient buffer size.
See also PSA_CIPHER_UPDATE_OUTPUT_SIZE().
input_length | Size of the input in bytes. |
#define PSA_CIPHER_UPDATE_OUTPUT_SIZE | ( | key_type, | |
alg, | |||
input_length ) |
A sufficient output buffer size for psa_cipher_update().
If the size of the output buffer is at least this large, it is guaranteed that psa_cipher_update() will not fail due to an insufficient buffer size. The actual size of the output might be smaller in any given call.
See also PSA_CIPHER_UPDATE_OUTPUT_MAX_SIZE.
key_type | A symmetric key type that is compatible with algorithm alg. |
alg | A cipher algorithm (PSA_ALG_XXX value such that PSA_ALG_IS_CIPHER(alg) is true). |
input_length | Size of the input in bytes. |