Skip to content

Commit 32f035d

Browse files
committed
common: crypto: support SHA3-224 hash algorithm
This patch adds support for the SHA3-224 hash algorithm in the crypto provider. Signed-off-by: Mykhailo Lohvynenko <[email protected]> Reviewed-by: Mykola Kobets <[email protected]> Reviewed-by: Mykola Solianko <[email protected]> Reviewed-by: Oleksandr Grytsov <[email protected]>
1 parent e020fb1 commit 32f035d

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

include/aos/common/crypto/crypto.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ class HashType {
203203
eSHA256,
204204
eSHA384,
205205
eSHA512,
206+
eSHA3_224,
206207
eSHA3_256,
207208
eNone,
208209
};
@@ -215,6 +216,7 @@ class HashType {
215216
"SHA256",
216217
"SHA384",
217218
"SHA512",
219+
"SHA3-224",
218220
"SHA3-256",
219221
"NONE",
220222
};

src/common/crypto/mbedtls/cryptoprovider.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -578,6 +578,8 @@ RetWithError<UniquePtr<HashItf>> MbedTLSCryptoProvider::CreateHash(Hash algorith
578578

579579
if (algorithm.GetValue() == HashEnum::eSHA256) {
580580
alg = PSA_ALG_SHA_256;
581+
} else if (algorithm.GetValue() == HashEnum::eSHA3_224) {
582+
alg = PSA_ALG_SHA3_224;
581583
} else if (algorithm.GetValue() == HashEnum::eSHA3_256) {
582584
alg = PSA_ALG_SHA3_256;
583585
} else {

0 commit comments

Comments
 (0)