Hash size definitions for the PSA Crypto API. More...
Hash size definitions for the PSA Crypto API.
Definition in file sizes.h.
Go to the source code of this file.
#define | PSA_HASH_LENGTH(alg) |
The size of the output of psa_hash_compute() and psa_hash_finish(), in bytes. More... | |
#define | PSA_HASH_MAX_SIZE (64) |
Maximum size of a hash supported by this implementation, in bytes. More... | |
#define | PSA_HASH_MAX_BLOCK_SIZE 0 |
Maximum size of a hash block supported by this implementation, in bytes. More... | |
#define | PSA_HASH_SUSPEND_OUTPUT_SIZE(alg) /* specification-defined value */ |
A sufficient hash suspend state buffer size for psa_hash_suspend(), in bytes. More... | |
#define | PSA_HASH_SUSPEND_OUTPUT_MAX_SIZE /* implementation-defined value */ |
A sufficient hash suspend state buffer size for psa_hash_suspend(), for any supported hash algorithms. More... | |
#define | PSA_HASH_SUSPEND_ALGORITHM_FIELD_LENGTH ((size_t)4) |
The size of the algorithm field that is part of the output of psa_hash_suspend(), in bytes. More... | |
#define | PSA_HASH_SUSPEND_INPUT_LENGTH_FIELD_LENGTH(alg) /* specification-defined value */ |
The size of the input-length field that is part of the output of psa_hash_suspend(), in bytes. More... | |
#define | PSA_HASH_SUSPEND_HASH_STATE_FIELD_LENGTH(alg) /* specification-defined value */ |
The size of the hash-state field that is part of the output of psa_hash_suspend(), in bytes. More... | |
#define | PSA_HASH_BLOCK_LENGTH(alg) |
The input block size of a hash algorithm, in bytes. More... | |
#define PSA_HASH_BLOCK_LENGTH | ( | alg | ) |
The input block size of a hash algorithm, in bytes.
Hash algorithms process their input data in blocks. Hash operations will retain any partial blocks until they have enough input to fill the block or until the operation is finished.
This affects the output from psa_hash_suspend().
alg | A hash algorithm: a value of type psa_algorithm_t such that PSA_ALG_IS_HASH(alg ) is true. |
#define PSA_HASH_LENGTH | ( | alg | ) |
The size of the output of psa_hash_compute() and psa_hash_finish(), in bytes.
This is also the hash length that psa_hash_compare() and psa_hash_verify() expect.
See also PSA_HASH_MAX_SIZE.
alg | A hash algorithm or an HMAC algorithm: a value of type psa_algorithm_t such that (PSA_ALG_IS_HASH(alg ) || PSA_ALG_IS_HMAC(alg )) is true. |
#define PSA_HASH_MAX_BLOCK_SIZE 0 |
#define PSA_HASH_MAX_SIZE (64) |
#define PSA_HASH_SUSPEND_ALGORITHM_FIELD_LENGTH ((size_t)4) |
The size of the algorithm field that is part of the output of psa_hash_suspend(), in bytes.
Applications can use this value to unpack the hash suspend state that is output by psa_hash_suspend().
#define PSA_HASH_SUSPEND_HASH_STATE_FIELD_LENGTH | ( | alg | ) | /* specification-defined value */ |
The size of the hash-state field that is part of the output of psa_hash_suspend(), in bytes.
Applications can use this value to unpack the hash suspend state that is output by psa_hash_suspend().
alg | A hash algorithm: a value of type psa_algorithm_t such that PSA_ALG_IS_HASH(alg ) is true. |
#define PSA_HASH_SUSPEND_INPUT_LENGTH_FIELD_LENGTH | ( | alg | ) | /* specification-defined value */ |
The size of the input-length field that is part of the output of psa_hash_suspend(), in bytes.
Applications can use this value to unpack the hash suspend state that is output by psa_hash_suspend().
alg | A hash algorithm: a value of type psa_algorithm_t such that PSA_ALG_IS_HASH(alg ) is true. |
#define PSA_HASH_SUSPEND_OUTPUT_MAX_SIZE /* implementation-defined value */ |
A sufficient hash suspend state buffer size for psa_hash_suspend(), for any supported hash algorithms.
If the size of the hash state buffer is at least this large, it is guaranteed that psa_hash_suspend() will not fail due to an insufficient buffer size.
See also PSA_HASH_SUSPEND_OUTPUT_SIZE().
#define PSA_HASH_SUSPEND_OUTPUT_SIZE | ( | alg | ) | /* specification-defined value */ |
A sufficient hash suspend state buffer size for psa_hash_suspend(), in bytes.
If the size of the hash state buffer is at least this large, it is guaranteed that psa_hash_suspend() 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_HASH_SUSPEND_OUTPUT_MAX_SIZE.
alg | A hash algorithm: a value of type psa_algorithm_t such that PSA_ALG_IS_HASH(alg) is true. |
For a supported hash algorithm alg, the following expression is true: