mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-29 11:41:15 +03:00
Style and language updates after review
Signed-off-by: Steven Cooreman <steven.cooreman@silabs.com>
This commit is contained in:
@ -933,32 +933,36 @@
|
||||
(((mac_alg) & PSA_ALG_MAC_TRUNCATION_MASK) >> PSA_MAC_TRUNCATION_OFFSET)
|
||||
|
||||
/* In the encoding of a MAC algorithm, the bit corresponding to
|
||||
* PSA_ALG_MAC_MINIMUM_LENGTH_FLAG encodes the fact that the algorithm is
|
||||
* a usage algorithm, which allows any algorithm corresponding to the same
|
||||
* base class and a tag length greater or equal than the one encoded in
|
||||
* PSA_ALG_MAC_TRUNCATION_MASK. */
|
||||
* #PSA_ALG_MAC_MINIMUM_LENGTH_FLAG encodes the fact that the algorithm is
|
||||
* a wildcard algorithm, which allows any algorithm corresponding to the same
|
||||
* base class and having a (potentially truncated) MAC length greater or equal
|
||||
* than the one encoded in #PSA_ALG_MAC_TRUNCATION_MASK. */
|
||||
#define PSA_ALG_MAC_MINIMUM_LENGTH_FLAG ((psa_algorithm_t)0x00008000)
|
||||
|
||||
/** Macro to build a MAC minimum-tag-length usage algorithm.
|
||||
/** Macro to build a MAC minimum-MAC-length wildcard algorithm.
|
||||
*
|
||||
* A mininimum-tag-length MAC usage algorithm contains all MAC algorithms
|
||||
* sharing the same base algorithm, and where the tag length of the specific
|
||||
* algorithm is equal to or larger then the usage's minimum tag length.
|
||||
* A mininimum-MAC-length MAC wildcard algorithm contains all MAC algorithms
|
||||
* sharing the same base algorithm, and where the (potentially truncated) MAC
|
||||
* length of the specific algorithm is equal to or larger then the wildcard
|
||||
* algorithm's minimum MAC length.
|
||||
*
|
||||
* \param mac_alg A MAC algorithm identifier (value of type
|
||||
* #psa_algorithm_t such that #PSA_ALG_IS_MAC(\p alg)
|
||||
* #psa_algorithm_t such that #PSA_ALG_IS_MAC(\p mac_alg)
|
||||
* is true).
|
||||
* \param tag_length Desired minimum length of the authentication tag in
|
||||
* bytes.
|
||||
* \param mac_length Desired minimum length of the message authentication
|
||||
* code in bytes. This must be at most the full length of
|
||||
* the MAC and must be at least an implementation-specified
|
||||
* minimum. The implementation-specified minimum
|
||||
* shall not be zero.
|
||||
*
|
||||
* \return The corresponding MAC usage algorithm with the
|
||||
* \return The corresponding MAC wildcard algorithm with the
|
||||
* specified minimum length.
|
||||
* \return Unspecified if \p alg is not a supported
|
||||
* MAC algorithm or if \p tag_length is not valid
|
||||
* \return Unspecified if \p mac_alg is not a supported MAC
|
||||
* algorithm or if \p mac_length is too small or too large
|
||||
* for the specified MAC algorithm.
|
||||
*/
|
||||
#define PSA_ALG_MAC_WITH_MINIMUM_LENGTH_TAG(mac_alg, tag_length) \
|
||||
( PSA_ALG_TRUNCATED_MAC(mac_alg, tag_length) | PSA_ALG_MAC_MINIMUM_LENGTH_FLAG )
|
||||
#define PSA_ALG_MAC_WITH_MINIMUM_LENGTH_TAG(mac_alg, mac_length) \
|
||||
( PSA_ALG_TRUNCATED_MAC(mac_alg, mac_length) | PSA_ALG_MAC_MINIMUM_LENGTH_FLAG )
|
||||
|
||||
#define PSA_ALG_CIPHER_MAC_BASE ((psa_algorithm_t)0x03c00000)
|
||||
/** The CBC-MAC construction over a block cipher
|
||||
@ -1178,27 +1182,28 @@
|
||||
ref :
|
||||
|
||||
/* In the encoding of an AEAD algorithm, the bit corresponding to
|
||||
* PSA_ALG_AEAD_MINIMUM_LENGTH_FLAG encodes the fact that the algorithm is
|
||||
* a usage algorithm, which allows any algorithm corresponding to the same
|
||||
* base class and a tag length greater or equal than the one encoded in
|
||||
* PSA_ALG_AEAD_TAG_LENGTH_MASK. */
|
||||
* #PSA_ALG_AEAD_MINIMUM_LENGTH_FLAG encodes the fact that the algorithm is
|
||||
* a wildcard algorithm, which allows any algorithm corresponding to the same
|
||||
* base class and having a tag length greater than or equal to the one encoded
|
||||
* in #PSA_ALG_AEAD_TAG_LENGTH_MASK. */
|
||||
#define PSA_ALG_AEAD_MINIMUM_LENGTH_FLAG ((psa_algorithm_t)0x00008000)
|
||||
|
||||
/** Macro to build an AEAD minimum-tag-length usage algorithm.
|
||||
/** Macro to build an AEAD minimum-tag-length wildcard algorithm.
|
||||
*
|
||||
* A mininimum-tag-length AEAD usage algorithm contains all AEAD algorithms
|
||||
* A mininimum-tag-length AEAD wildcard algorithm contains all AEAD algorithms
|
||||
* sharing the same base algorithm, and where the tag length of the specific
|
||||
* algorithm is equal to or larger then the usage's minimum tag length.
|
||||
* algorithm is equal to or larger then the minimum tag length specified by the
|
||||
* wildcard algorithm.
|
||||
*
|
||||
* \param aead_alg An AEAD algorithm identifier (value of type
|
||||
* #psa_algorithm_t such that #PSA_ALG_IS_AEAD(\p alg)
|
||||
* #psa_algorithm_t such that #PSA_ALG_IS_AEAD(\p aead_alg)
|
||||
* is true).
|
||||
* \param tag_length Desired minimum length of the authentication tag in
|
||||
* bytes.
|
||||
*
|
||||
* \return The corresponding AEAD usage algorithm with the
|
||||
* \return The corresponding AEAD wildcard algorithm with the
|
||||
* specified minimum length.
|
||||
* \return Unspecified if \p alg is not a supported
|
||||
* \return Unspecified if \p aead_alg is not a supported
|
||||
* AEAD algorithm or if \p tag_length is not valid
|
||||
* for the specified AEAD algorithm.
|
||||
*/
|
||||
@ -1651,14 +1656,14 @@
|
||||
* \return This macro may return either 0 or 1 if \c alg is not a supported
|
||||
* algorithm identifier.
|
||||
*/
|
||||
#define PSA_ALG_IS_WILDCARD(alg) \
|
||||
(PSA_ALG_IS_HASH_AND_SIGN(alg) ? \
|
||||
PSA_ALG_SIGN_GET_HASH(alg) == PSA_ALG_ANY_HASH : \
|
||||
(PSA_ALG_IS_MAC(alg) ? \
|
||||
(alg & PSA_ALG_MAC_MINIMUM_LENGTH_FLAG) != 0 : \
|
||||
(PSA_ALG_IS_AEAD(alg) ? \
|
||||
(alg & PSA_ALG_AEAD_MINIMUM_LENGTH_FLAG) != 0 : \
|
||||
(alg) == PSA_ALG_ANY_HASH)))
|
||||
#define PSA_ALG_IS_WILDCARD(alg) \
|
||||
(PSA_ALG_IS_HASH_AND_SIGN(alg) ? \
|
||||
PSA_ALG_SIGN_GET_HASH(alg) == PSA_ALG_ANY_HASH : \
|
||||
PSA_ALG_IS_MAC(alg) ? \
|
||||
(alg & PSA_ALG_MAC_MINIMUM_LENGTH_FLAG) != 0 : \
|
||||
PSA_ALG_IS_AEAD(alg) ? \
|
||||
(alg & PSA_ALG_AEAD_MINIMUM_LENGTH_FLAG) != 0 : \
|
||||
(alg) == PSA_ALG_ANY_HASH)
|
||||
|
||||
/**@}*/
|
||||
|
||||
|
Reference in New Issue
Block a user