Merge pull request #9213 from eleuzi01/replace-mbedtls-md-can-sha3-384

Replace MBEDTLS_MD_CAN_SHA3_384 with PSA_WANT_ALG_SHA3_384
This commit is contained in:
Bence Szépkúti 2024-07-12 16:32:48 +00:00 committed by GitHub
commit 3f40127db1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 30 additions and 30 deletions

View File

@ -27,7 +27,7 @@ depends_on:PSA_WANT_ALG_SHA3_256
hmac_drbg_entropy_usage:MBEDTLS_MD_SHA3_256
HMAC_DRBG entropy usage SHA3-384
depends_on:MBEDTLS_MD_CAN_SHA3_384
depends_on:PSA_WANT_ALG_SHA3_384
hmac_drbg_entropy_usage:MBEDTLS_MD_SHA3_384
HMAC_DRBG entropy usage SHA3-512
@ -91,11 +91,11 @@ depends_on:PSA_WANT_ALG_SHA3_256
hmac_drbg_seed_file:MBEDTLS_MD_SHA3_256:"no_such_dir/file":MBEDTLS_ERR_HMAC_DRBG_FILE_IO_ERROR
HMAC_DRBG write/update seed file SHA3-384 [#1]
depends_on:MBEDTLS_MD_CAN_SHA3_384
depends_on:PSA_WANT_ALG_SHA3_384
hmac_drbg_seed_file:MBEDTLS_MD_SHA3_384:"../framework/data_files/hmac_drbg_seed":0
HMAC_DRBG write/update seed file SHA3-384 [#2]
depends_on:MBEDTLS_MD_CAN_SHA3_384
depends_on:PSA_WANT_ALG_SHA3_384
hmac_drbg_seed_file:MBEDTLS_MD_SHA3_384:"no_such_dir/file":MBEDTLS_ERR_HMAC_DRBG_FILE_IO_ERROR
HMAC_DRBG write/update seed file SHA3-512 [#1]
@ -135,7 +135,7 @@ depends_on:PSA_WANT_ALG_SHA3_256
hmac_drbg_buf:MBEDTLS_MD_SHA3_256
HMAC_DRBG from buffer SHA3-384
depends_on:MBEDTLS_MD_CAN_SHA3_384
depends_on:PSA_WANT_ALG_SHA3_384
hmac_drbg_buf:MBEDTLS_MD_SHA3_384
HMAC_DRBG from buffer SHA3-512

View File

@ -45,7 +45,7 @@ depends_on:PSA_WANT_ALG_SHA3_256
md_info:MBEDTLS_MD_SHA3_256:"SHA3-256":32
Information on SHA3-384
depends_on:MBEDTLS_MD_CAN_SHA3_384
depends_on:PSA_WANT_ALG_SHA3_384
md_info:MBEDTLS_MD_SHA3_384:"SHA3-384":48
Information on SHA3-512
@ -121,7 +121,7 @@ depends_on:PSA_WANT_ALG_SHA3_256
md_hex:MBEDTLS_MD_SHA3_256:"e9":"f0d04dd1e6cfc29a4460d521796852f25d9ef8d28b44ee91ff5b759d72c1e6d6"
generic mbedtls_sha3 SHA3-384 Test vector from CAVS 19.0 with Len = 8
depends_on:MBEDTLS_MD_CAN_SHA3_384
depends_on:PSA_WANT_ALG_SHA3_384
md_hex:MBEDTLS_MD_SHA3_384:"80":"7541384852e10ff10d5fb6a7213a4a6c15ccc86d8bc1068ac04f69277142944f4ee50d91fdc56553db06b2f5039c8ab7"
generic mbedtls_sha3 SHA3-512 Test vector from CAVS 19.0 with Len = 8
@ -269,7 +269,7 @@ depends_on:PSA_WANT_ALG_SHA3_256
md_hex_multi:MBEDTLS_MD_SHA3_256:"e6fd42037f80":"2294f8d3834f24aa9037c431f8c233a66a57b23fa3de10530bbb6911f6e1850f"
generic multi step mbedtls_sha3 SHA3-384 Test vector from CAVS 19.0 with Len = 48
depends_on:MBEDTLS_MD_CAN_SHA3_384
depends_on:PSA_WANT_ALG_SHA3_384
md_hex_multi:MBEDTLS_MD_SHA3_384:"5a6659e9f0e7":"21b1f3f63b907f968821185a7fe30b16d47e1d6ee5b9c80be68947854de7a8ef4a03a6b2e4ec96abdd4fa29ab9796f28"
generic multi step mbedtls_sha3 SHA3-512 Test vector from CAVS 19.0 with Len = 48
@ -557,19 +557,19 @@ depends_on:PSA_WANT_ALG_SHA3_256
mbedtls_md_hmac:MBEDTLS_MD_SHA3_256:16:"000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f":"53616d706c65206d65737361676520666f72206b65796c656e3c626c6f636b6c656e2c2077697468207472756e636174656420746167":"c8dc7148d8c1423aa549105dafdf9cad"
HMAC-SHA3-384: NIST example #1: keylen<blocklen
depends_on:MBEDTLS_MD_CAN_SHA3_384
depends_on:PSA_WANT_ALG_SHA3_384
mbedtls_md_hmac:MBEDTLS_MD_SHA3_384:48:"000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f":"53616d706c65206d65737361676520666f72206b65796c656e3c626c6f636b6c656e":"d588a3c51f3f2d906e8298c1199aa8ff6296218127f6b38a90b6afe2c5617725bc99987f79b22a557b6520db710b7f42"
HMAC-SHA3-384: NIST example #2: keylen=blocklen
depends_on:MBEDTLS_MD_CAN_SHA3_384
depends_on:PSA_WANT_ALG_SHA3_384
mbedtls_md_hmac:MBEDTLS_MD_SHA3_384:48:"000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f6061626364656667":"53616d706c65206d65737361676520666f72206b65796c656e3d626c6f636b6c656e":"a27d24b592e8c8cbf6d4ce6fc5bf62d8fc98bf2d486640d9eb8099e24047837f5f3bffbe92dcce90b4ed5b1e7e44fa90"
HMAC-SHA3-384: NIST example #3: keylen>blocklen
depends_on:MBEDTLS_MD_CAN_SHA3_384
depends_on:PSA_WANT_ALG_SHA3_384
mbedtls_md_hmac:MBEDTLS_MD_SHA3_384:48:"000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f9091929394959697":"53616d706c65206d65737361676520666f72206b65796c656e3e626c6f636b6c656e":"e5ae4c739f455279368ebf36d4f5354c95aa184c899d3870e460ebc288ef1f9470053f73f7c6da2a71bcaec38ce7d6ac"
HMAC-SHA3-384: NIST example #4: keylen<blocklen, with truncated tag
depends_on:MBEDTLS_MD_CAN_SHA3_384
depends_on:PSA_WANT_ALG_SHA3_384
mbedtls_md_hmac:MBEDTLS_MD_SHA3_384:24:"000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f":"53616d706c65206d65737361676520666f72206b65796c656e3c626c6f636b6c656e2c2077697468207472756e636174656420746167":"25f4bf53606e91af79d24a4bb1fd6aecd44414a30c8ebb0a"
HMAC-SHA3-512: NIST example #1: keylen<blocklen
@ -765,19 +765,19 @@ depends_on:PSA_WANT_ALG_SHA3_256
md_hmac_multi:MBEDTLS_MD_SHA3_256:16:"000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f":"53616d706c65206d65737361676520666f72206b65796c656e3c626c6f636b6c656e2c2077697468207472756e636174656420746167":"c8dc7148d8c1423aa549105dafdf9cad"
HMAC-SHA3-384 multi-step: NIST example #1: keylen<blocklen
depends_on:MBEDTLS_MD_CAN_SHA3_384
depends_on:PSA_WANT_ALG_SHA3_384
md_hmac_multi:MBEDTLS_MD_SHA3_384:48:"000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f":"53616d706c65206d65737361676520666f72206b65796c656e3c626c6f636b6c656e":"d588a3c51f3f2d906e8298c1199aa8ff6296218127f6b38a90b6afe2c5617725bc99987f79b22a557b6520db710b7f42"
HMAC-SHA3-384 multi-step: NIST example #2: keylen=blocklen
depends_on:MBEDTLS_MD_CAN_SHA3_384
depends_on:PSA_WANT_ALG_SHA3_384
md_hmac_multi:MBEDTLS_MD_SHA3_384:48:"000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f6061626364656667":"53616d706c65206d65737361676520666f72206b65796c656e3d626c6f636b6c656e":"a27d24b592e8c8cbf6d4ce6fc5bf62d8fc98bf2d486640d9eb8099e24047837f5f3bffbe92dcce90b4ed5b1e7e44fa90"
HMAC-SHA3-384 multi-step: NIST example #3: keylen>blocklen
depends_on:MBEDTLS_MD_CAN_SHA3_384
depends_on:PSA_WANT_ALG_SHA3_384
md_hmac_multi:MBEDTLS_MD_SHA3_384:48:"000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f9091929394959697":"53616d706c65206d65737361676520666f72206b65796c656e3e626c6f636b6c656e":"e5ae4c739f455279368ebf36d4f5354c95aa184c899d3870e460ebc288ef1f9470053f73f7c6da2a71bcaec38ce7d6ac"
HMAC-SHA3-384 multi-step: NIST example #4: keylen<blocklen, with truncated tag
depends_on:MBEDTLS_MD_CAN_SHA3_384
depends_on:PSA_WANT_ALG_SHA3_384
md_hmac_multi:MBEDTLS_MD_SHA3_384:24:"000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f":"53616d706c65206d65737361676520666f72206b65796c656e3c626c6f636b6c656e2c2077697468207472756e636174656420746167":"25f4bf53606e91af79d24a4bb1fd6aecd44414a30c8ebb0a"
HMAC-SHA3-512 multi-step: NIST example #1: keylen<blocklen
@ -961,19 +961,19 @@ depends_on:PSA_WANT_ALG_SHA3_256
mbedtls_md_file:MBEDTLS_MD_SHA3_256:"../framework/data_files/hash_file_4":"a7ffc6f8bf1ed76651c14756a061d662f580ff4de43b49fa82d80a4b80f8434a"
generic SHA3-384 Hash file #1
depends_on:MBEDTLS_MD_CAN_SHA3_384
depends_on:PSA_WANT_ALG_SHA3_384
mbedtls_md_file:MBEDTLS_MD_SHA3_384:"../framework/data_files/hash_file_1":"06ab3677496658d3faad937f3f7887b3e925b480190544c612e76b88c5d21b4ca12691f27b8ef569d601925915cdf2a6"
generic SHA3-384 Hash file #2
depends_on:MBEDTLS_MD_CAN_SHA3_384
depends_on:PSA_WANT_ALG_SHA3_384
mbedtls_md_file:MBEDTLS_MD_SHA3_384:"../framework/data_files/hash_file_2":"b5efc40db7af544bf3fb8c782f2db478dbb81aa83d2ef0e8bbdcf06371de7cc984aac5539c4c9244c1e6ebbb85e23983"
generic SHA3-384 Hash file #3
depends_on:MBEDTLS_MD_CAN_SHA3_384
depends_on:PSA_WANT_ALG_SHA3_384
mbedtls_md_file:MBEDTLS_MD_SHA3_384:"../framework/data_files/hash_file_3":"0f08dc09cb39240e09b01e7f3ee3ce6b893bf393f52d2ac87083cef7d3a469fa99763e58b25306b0a2381d9bbdaa802f"
generic SHA3-384 Hash file #4
depends_on:MBEDTLS_MD_CAN_SHA3_384
depends_on:PSA_WANT_ALG_SHA3_384
mbedtls_md_file:MBEDTLS_MD_SHA3_384:"../framework/data_files/hash_file_4":"0c63a75b845e4f7d01107d852e4c2485c51a50aaaa94fc61995e71bbee983a2ac3713831264adb47fb6bd1e058d5f004"
generic SHA3-512 Hash file #1

View File

@ -91,7 +91,7 @@ depends_on:PSA_WANT_ALG_SHA3_256
oid_get_md_alg_id:"608648016503040208":MBEDTLS_MD_SHA3_256
OID hash id - id-sha3-384
depends_on:MBEDTLS_MD_CAN_SHA3_384
depends_on:PSA_WANT_ALG_SHA3_384
oid_get_md_alg_id:"608648016503040209":MBEDTLS_MD_SHA3_384
OID hash id - id-sha3-512
@ -235,7 +235,7 @@ depends_on:PSA_WANT_ALG_SHA3_256
mbedtls_oid_get_md_hmac:"60864801650304020E":MBEDTLS_MD_SHA3_256
mbedtls_oid_get_md_hmac - SHA3_384
depends_on:MBEDTLS_MD_CAN_SHA3_384
depends_on:PSA_WANT_ALG_SHA3_384
mbedtls_oid_get_md_hmac:"60864801650304020F":MBEDTLS_MD_SHA3_384
mbedtls_oid_get_md_hmac - SHA3_512

View File

@ -69,7 +69,7 @@ typedef enum {
*/
#if defined(MBEDTLS_MD_CAN_SHA512) || defined(PSA_WANT_ALG_SHA3_512)
#define MBEDTLS_MD_MAX_SIZE 64 /* longest known is SHA512 */
#elif defined(PSA_WANT_ALG_SHA_384) || defined(MBEDTLS_MD_CAN_SHA3_384)
#elif defined(PSA_WANT_ALG_SHA_384) || defined(PSA_WANT_ALG_SHA3_384)
#define MBEDTLS_MD_MAX_SIZE 48 /* longest known is SHA384 */
#elif defined(PSA_WANT_ALG_SHA_256) || defined(PSA_WANT_ALG_SHA3_256)
#define MBEDTLS_MD_MAX_SIZE 32 /* longest known is SHA256 */
@ -86,7 +86,7 @@ typedef enum {
#define MBEDTLS_MD_MAX_BLOCK_SIZE 136
#elif defined(MBEDTLS_MD_CAN_SHA512) || defined(PSA_WANT_ALG_SHA_384)
#define MBEDTLS_MD_MAX_BLOCK_SIZE 128
#elif defined(MBEDTLS_MD_CAN_SHA3_384)
#elif defined(PSA_WANT_ALG_SHA3_384)
#define MBEDTLS_MD_MAX_BLOCK_SIZE 104
#elif defined(PSA_WANT_ALG_SHA3_512)
#define MBEDTLS_MD_MAX_BLOCK_SIZE 72

View File

@ -124,7 +124,7 @@ static const mbedtls_md_info_t mbedtls_sha3_256_info = {
};
#endif
#if defined(MBEDTLS_MD_CAN_SHA3_384)
#if defined(PSA_WANT_ALG_SHA3_384)
static const mbedtls_md_info_t mbedtls_sha3_384_info = {
MD_INFO(MBEDTLS_MD_SHA3_384, 48, 104)
};
@ -175,7 +175,7 @@ const mbedtls_md_info_t *mbedtls_md_info_from_type(mbedtls_md_type_t md_type)
case MBEDTLS_MD_SHA3_256:
return &mbedtls_sha3_256_info;
#endif
#if defined(MBEDTLS_MD_CAN_SHA3_384)
#if defined(PSA_WANT_ALG_SHA3_384)
case MBEDTLS_MD_SHA3_384:
return &mbedtls_sha3_384_info;
#endif
@ -816,7 +816,7 @@ static const int supported_digests[] = {
MBEDTLS_MD_SHA3_256,
#endif
#if defined(MBEDTLS_MD_CAN_SHA3_384)
#if defined(PSA_WANT_ALG_SHA3_384)
MBEDTLS_MD_SHA3_384,
#endif
@ -866,7 +866,7 @@ static const md_name_entry md_names[] = {
#if defined(PSA_WANT_ALG_SHA3_256)
{ "SHA3-256", MBEDTLS_MD_SHA3_256 },
#endif
#if defined(MBEDTLS_MD_CAN_SHA3_384)
#if defined(PSA_WANT_ALG_SHA3_384)
{ "SHA3-384", MBEDTLS_MD_SHA3_384 },
#endif
#if defined(PSA_WANT_ALG_SHA3_512)

View File

@ -773,7 +773,7 @@ static const oid_md_alg_t oid_md_alg[] =
MBEDTLS_MD_SHA3_256,
},
#endif
#if defined(MBEDTLS_MD_CAN_SHA3_384)
#if defined(PSA_WANT_ALG_SHA3_384)
{
OID_DESCRIPTOR(MBEDTLS_OID_DIGEST_ALG_SHA3_384, "id-sha3-384", "SHA-3-384"),
MBEDTLS_MD_SHA3_384,
@ -851,12 +851,12 @@ static const oid_md_hmac_t oid_md_hmac[] =
MBEDTLS_MD_SHA3_256,
},
#endif /* PSA_WANT_ALG_SHA3_256 */
#if defined(MBEDTLS_MD_CAN_SHA3_384)
#if defined(PSA_WANT_ALG_SHA3_384)
{
OID_DESCRIPTOR(MBEDTLS_OID_HMAC_SHA3_384, "hmacSHA3-384", "HMAC-SHA3-384"),
MBEDTLS_MD_SHA3_384,
},
#endif /* MBEDTLS_MD_CAN_SHA3_384 */
#endif /* PSA_WANT_ALG_SHA3_384 */
#if defined(PSA_WANT_ALG_SHA3_512)
{
OID_DESCRIPTOR(MBEDTLS_OID_HMAC_SHA3_512, "hmacSHA3-512", "HMAC-SHA3-512"),