Loading...
Searching...
No Matches
sizes.h File Reference

MAC size definitions for the PSA Crypto API. More...

Detailed Description

#include "kernel_defines.h"
#include "psa/algorithm.h"
#include "psa/cipher/sizes.h"
#include "psa/hash/algorithm.h"
#include "psa/hash/sizes.h"
#include "psa/mac/algorithm.h"
+ Include dependency graph for sizes.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

#define PSA_MAC_LENGTH(key_type, key_bits, alg)
 The size of the output of psa_mac_compute() and psa_mac_sign_finish(), in bytes.
 
#define PSA_MAC_MAX_SIZE   0
 A sufficient buffer size for storing the MAC output by psa_mac_verify() and psa_mac_verify_finish(), for any of the supported key types and MAC algorithms.
 

Macro Definition Documentation

◆ PSA_MAC_LENGTH

#define PSA_MAC_LENGTH ( key_type,
key_bits,
alg )
Value:
((void)(key_type), (void)(key_bits), 0))
#define PSA_BLOCK_CIPHER_BLOCK_LENGTH(type)
The block size of a block cipher.
Definition sizes.h:44
#define PSA_ALG_HMAC_GET_HASH(hmac_alg)
Get the hash operation of a hmac algorithm.
Definition algorithm.h:79
#define PSA_HASH_LENGTH(alg)
The size of the output of psa_hash_compute() and psa_hash_finish(), in bytes.
Definition sizes.h:45
#define PSA_ALG_IS_HMAC(alg)
Whether the specified algorithm is an HMAC algorithm.
Definition algorithm.h:61
#define PSA_ALG_IS_BLOCK_CIPHER_MAC(alg)
Whether the specified algorithm is a MAC algorithm based on a block cipher.
Definition algorithm.h:71

The size of the output of psa_mac_compute() and psa_mac_sign_finish(), in bytes.

If the size of the MAC buffer is at least this large, it is guaranteed that psa_mac_compute() and psa_mac_sign_finish() will not fail due to an insufficient buffer size.

This is also the MAC length that psa_mac_verify() and psa_mac_verify_finish() expect.

See also PSA_MAC_MAX_SIZE.

Parameters
key_typeThe type of the MAC key.
key_bitsThe size of the MAC key in bits.
algA MAC algorithm: a value of type psa_algorithm_t such that PSA_ALG_IS_MAC(alg) is true.
Returns
The MAC length for the specified algorithm with the specified key parameters. 0 if the MAC algorithm is not recognized or not supported. Unspecified if the key parameters are not consistent with the algorithm.

Definition at line 57 of file sizes.h.

◆ PSA_MAC_MAX_SIZE

#define PSA_MAC_MAX_SIZE   0

A sufficient buffer size for storing the MAC output by psa_mac_verify() and psa_mac_verify_finish(), for any of the supported key types and MAC algorithms.

If the size of the MAC buffer is at least this large, it is guaranteed that psa_mac_verify() and psa_mac_verify_finish() will not fail due to an insufficient buffer size.

See also PSA_MAC_LENGTH().

Definition at line 94 of file sizes.h.