Skip to content

Commit ebb3982

Browse files
committed
Add SHA3-HMAC support to PKCS#8
This also enables testing of PKCS#8 keys using modern hash algos with LTC_EASY. Signed-off-by: Steffen Jaeckel <[email protected]>
1 parent 7b22b9c commit ebb3982

18 files changed

+13
-2
lines changed

src/headers/tomcrypt_custom.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@
9191
#define LTC_SHA1
9292
#define LTC_SHA3
9393
#define LTC_SHA512
94+
#define LTC_SHA512_256
95+
#define LTC_SHA512_224
9496
#define LTC_SHA384
9597
#define LTC_SHA256
9698
#define LTC_SHA224

src/misc/pbes/pbes2.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ static const oid_id_st s_hmac_oid_names[] = {
2020
{ "1.2.840.113549.2.11", "sha512" },
2121
{ "1.2.840.113549.2.12", "sha512-224" },
2222
{ "1.2.840.113549.2.13", "sha512-256" },
23+
{ "2.16.840.1.101.3.4.2.13", "sha3-224" },
24+
{ "2.16.840.1.101.3.4.2.14", "sha3-256" },
25+
{ "2.16.840.1.101.3.4.2.15", "sha3-384" },
26+
{ "2.16.840.1.101.3.4.2.16", "sha3-512" },
2327
};
2428

2529
static int s_pkcs_5_alg2_wrap(const struct password *pwd,

tests/rsa-pkcs8/README.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,7 @@ openssl pkcs8 -topk8 -inform PEM -outform DER -passout pass:secret -in ../test.k
2727
openssl pkcs8 -topk8 -inform PEM -outform DER -passout pass:secret -in ../test.key -v2 rc2-40 -v2prf hmacWithSHA512-256 -out key_pkcs8_pbkdf2_sha512_256_rc2_40_cbc.der
2828
openssl pkcs8 -topk8 -inform PEM -outform DER -passout pass:secret -in ../test.key -v2 rc2-64 -v2prf hmacWithSHA512 -out key_pkcs8_pbkdf2_sha512_rc2_64_cbc.der
2929
openssl pkcs8 -topk8 -inform PEM -outform DER -passout pass:secret -in ../test.key -v2 rc2-64 -v2prf hmacWithSHA512-256 -out key_pkcs8_pbkdf2_sha512_256_rc2_64_cbc.der
30+
openssl pkcs8 -topk8 -inform PEM -outform DER -passout pass:secret -in ../test.key -v2 aes256 -v2prf id-hmacWithSHA3-224 -out key_pkcs8_pbkdf2_sha3_224_aes256_cbc.der
31+
openssl pkcs8 -topk8 -inform PEM -outform DER -passout pass:secret -in ../test.key -v2 aes256 -v2prf id-hmacWithSHA3-256 -out key_pkcs8_pbkdf2_sha3_256_aes256_cbc.der
32+
openssl pkcs8 -topk8 -inform PEM -outform DER -passout pass:secret -in ../test.key -v2 aes256 -v2prf id-hmacWithSHA3-384 -out key_pkcs8_pbkdf2_sha3_384_aes256_cbc.der
33+
openssl pkcs8 -topk8 -inform PEM -outform DER -passout pass:secret -in ../test.key -v2 aes256 -v2prf id-hmacWithSHA3-512 -out key_pkcs8_pbkdf2_sha3_512_aes256_cbc.der
746 Bytes
Binary file not shown.
746 Bytes
Binary file not shown.
746 Bytes
Binary file not shown.
746 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)