mbedtls/include/psa
Gilles Peskine 8cb22c8d87 Untangle PSA_ALG_IS_HASH_AND_SIGN and PSA_ALG_IS_SIGN_HASH
The current definition of PSA_ALG_IS_HASH_AND_SIGN includes
PSA_ALG_RSA_PKCS1V15_SIGN_RAW and PSA_ALG_ECDSA_ANY, which don't strictly
follow the hash-and-sign paradigm: the algorithm does not encode a hash
algorithm that is applied prior to the signature step. The definition in
fact encompasses what can be used with psa_sign_hash/psa_verify_hash, so
it's the correct definition for PSA_ALG_IS_SIGN_HASH. Therefore this commit
moves definition of PSA_ALG_IS_HASH_AND_SIGN to PSA_ALG_IS_SIGN_HASH, and
replace the definition of PSA_ALG_IS_HASH_AND_SIGN by a correct one (based
on PSA_ALG_IS_SIGN_HASH, excluding the algorithms where the pre-signature
step isn't to apply the hash encoded in the algorithm).

In the definition of PSA_ALG_SIGN_GET_HASH, keep the condition for a nonzero
output to be PSA_ALG_IS_HASH_AND_SIGN.

Everywhere else in the code base (definition of PSA_ALG_IS_SIGN_MESSAGE, and
every use of PSA_ALG_IS_HASH_AND_SIGN outside of crypto_values.h), we meant
PSA_ALG_IS_SIGN_HASH where we wrote PSA_ALG_IS_HASH_AND_SIGN, so do a
global replacement.
```
git grep -l IS_HASH_AND_SIGN ':!include/psa/crypto_values.h' | xargs perl -i -pe 's/ALG_IS_HASH_AND_SIGN/ALG_IS_SIGN_HASH/g'
```

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2021-11-03 12:44:08 +01:00
..
crypto.h Add missing PSA_ALG_IS_SIGN_HASH macro. 2021-11-03 12:38:57 +01:00
crypto_builtin_composites.h Move is_sign and mac_size checking back to PSA core scope 2021-05-11 18:56:01 +02:00
crypto_builtin_primitives.h Give a better name for struct member 2021-06-30 10:31:18 +02:00
crypto_compat.h Fix typos in C header files 2021-05-12 10:39:58 +02:00
crypto_config.h Implement PSA_WANT_KEY_TYPE_ARIA 2021-10-08 18:28:15 +02:00
crypto_driver_common.h Remove old-style accelerator and entropy driver interfaces 2020-11-30 17:37:14 +01:00
crypto_driver_contexts_composites.h Add boilerplate for dispatching MAC operations 2021-05-11 18:56:01 +02:00
crypto_driver_contexts_primitives.h Remove inclusion of top-level crypto.h from the driver context header 2021-05-11 18:56:01 +02:00
crypto_extra.h Reword the builtin key language on persistency declaration 2021-04-16 11:25:18 +02:00
crypto_platform.h Move the inclusion of crypto_spe.h to psa/crypto_platform.h 2021-06-23 14:45:17 +02:00
crypto_se_driver.h Fix typos in C header files 2021-05-12 10:39:58 +02:00
crypto_sizes.h Add missing PSA_HASH_BLOCK_LENGTH macro. 2021-11-03 12:38:57 +01:00
crypto_struct.h Do key usage policy extension when loading keys 2021-06-24 11:58:19 +02:00
crypto_types.h psa: Make sure MBEDTLS_PSA_CRYPTO_CLIENT is defined 2021-02-09 15:36:08 +01:00
crypto_values.h Untangle PSA_ALG_IS_HASH_AND_SIGN and PSA_ALG_IS_SIGN_HASH 2021-11-03 12:44:08 +01:00