New header crypto_sizes.h

This header will contain macros that calculate buffer sizes, whose
semantics are standardized but whose definitions are
implementation-specific because they depend on the available algorithms
and on some permitted buffer size tolerances.

Move size macros from crypto_struct.h to crypto_sizes.h, because these
definitions need to be available both in the frontend and in the
backend, whereas structures have different contents.
This commit is contained in:
Gilles Peskine 2018-06-27 19:49:02 +02:00 committed by itayzafrir
parent 0e60fd536e
commit 0cad07c2fb
3 changed files with 54 additions and 8 deletions

View file

@ -45,14 +45,6 @@
#include "mbedtls/sha256.h"
#include "mbedtls/sha512.h"
#if defined(MBEDTLS_SHA512_C)
#define PSA_HASH_MAX_SIZE 64
#define PSA_HMAC_MAX_HASH_BLOCK_SIZE 128
#else
#define PSA_HASH_MAX_SIZE 32
#define PSA_HMAC_MAX_HASH_BLOCK_SIZE 64
#endif
struct psa_hash_operation_s
{
psa_algorithm_t alg;