Skip to content

Commit 763fb9a

Browse files
Improve the description of PSA_ALG_ANY_HASH
Make it clearer what PSA_ALG_ANY_HASH can and cannot be used for.
1 parent eb2d4b9 commit 763fb9a

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

include/psa/crypto_values.h

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -668,15 +668,18 @@
668668
/** SHA3-512 */
669669
#define PSA_ALG_SHA3_512 ((psa_algorithm_t)0x01000013)
670670

671-
/** Allow any hash algorithm.
671+
/** In a hash-and-sign algorithm policy, allow any hash algorithm.
672672
*
673-
* This value may only be used to form the algorithm usage field of a policy
674-
* for a signature algorithm that is parametrized by a hash. That is,
675-
* suppose that `PSA_xxx_SIGNATURE` is one of the following macros:
673+
* This value may be used to form the algorithm usage field of a policy
674+
* for a signature algorithm that is parametrized by a hash. The key
675+
* may then be used to perform operations using the same signature
676+
* algorithm parametrized with any supported hash.
677+
*
678+
* That is, suppose that `PSA_xxx_SIGNATURE` is one of the following macros:
676679
* - #PSA_ALG_RSA_PKCS1V15_SIGN, #PSA_ALG_RSA_PSS,
677680
* - #PSA_ALG_DSA, #PSA_ALG_DETERMINISTIC_DSA,
678681
* - #PSA_ALG_ECDSA, #PSA_ALG_DETERMINISTIC_ECDSA.
679-
* Then you may create a key as follows:
682+
* Then you may create and use a key as follows:
680683
* - Set the key usage field using #PSA_ALG_ANY_HASH, for example:
681684
* ```
682685
* psa_key_policy_set_usage(&policy,

0 commit comments

Comments
 (0)