mbedtls/include/psa
Gilles Peskine f7b4137e69 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 15:48:15 +01:00
..
crypto.h Add missing PSA_ALG_IS_SIGN_HASH macro. 2021-11-03 15:47:03 +01:00
crypto_builtin_composites.h Add MBEDTLS_PRIVATE to new structs 2021-09-24 11:20:04 +01:00
crypto_builtin_primitives.h Give a better name for struct member 2021-06-30 10:45:58 +02:00
crypto_compat.h Fix typos in C header files 2021-05-10 19:54:11 +02:00
crypto_config.h Implement PSA_WANT_KEY_TYPE_ARIA 2021-10-08 15:48:16 +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 Move AEAD contexts from primitives to composites 2021-05-20 18:39:58 +01:00
crypto_driver_contexts_primitives.h Move AEAD contexts from primitives to composites 2021-05-20 18:39:58 +01:00
crypto_extra.h Rename config.h to mbedtls_config.h 2021-06-28 09:28:33 +01:00
crypto_platform.h Replace all inclusions of config.h 2021-06-28 09:24:07 +01:00
crypto_se_driver.h Run MBEDTLS_PRIVATE wrapping script on the library. 2021-05-21 18:10:44 +02:00
crypto_sizes.h Add missing PSA_HASH_BLOCK_LENGTH macro. 2021-11-03 15:47:03 +01:00
crypto_struct.h Add missing MBEDTLS_PRIVATE 2021-09-27 09:23:40 +01:00
crypto_types.h PSA PAKE: move the API to crypto_extra.h 2021-06-08 14:48:34 +01:00
crypto_values.h Untangle PSA_ALG_IS_HASH_AND_SIGN and PSA_ALG_IS_SIGN_HASH 2021-11-03 15:48:15 +01:00