Skip to content

Commit

Permalink
Add ACVP testing for SHA2-512/224 and SHA2-512/256 for PBKDF and HKDF
Browse files Browse the repository at this point in the history
  • Loading branch information
skmcgrail committed Oct 24, 2024
1 parent 90d2a34 commit 0ac9a50
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 7 deletions.
12 changes: 7 additions & 5 deletions util/fipstools/acvp/acvptool/subprocess/pbkdf.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,13 @@ type pbkdfTestResponse struct {

// List of supported HMAC Algorithms by NIST
var HmacAlgList map[string]bool = map[string]bool{
"SHA-1": true,
"SHA2-224": true,
"SHA2-256": true,
"SHA2-384": true,
"SHA2-512": true,
"SHA-1": true,
"SHA2-224": true,
"SHA2-256": true,
"SHA2-384": true,
"SHA2-512": true,
"SHA2-512/224": true,
"SHA2-512/256": true,
}

// Key and salt length mins and maxes as defined by NIST
Expand Down
Binary file modified util/fipstools/acvp/acvptool/test/expected/KDA-HKDF.bz2
Binary file not shown.
Binary file modified util/fipstools/acvp/acvptool/test/expected/PBKDF.bz2
Binary file not shown.
Binary file modified util/fipstools/acvp/acvptool/test/vectors/KDA-HKDF.bz2
Binary file not shown.
Binary file modified util/fipstools/acvp/acvptool/test/vectors/PBKDF.bz2
Binary file not shown.
10 changes: 8 additions & 2 deletions util/fipstools/acvp/modulewrapper/modulewrapper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,9 @@ static bool GetConfig(const Span<const uint8_t> args[],
"SHA2-224",
"SHA2-256",
"SHA2-384",
"SHA2-512"
"SHA2-512",
"SHA2-512/224",
"SHA2-512/256"
]
}
]
Expand Down Expand Up @@ -1249,7 +1251,9 @@ static bool GetConfig(const Span<const uint8_t> args[],
"SHA2-224",
"SHA2-256",
"SHA2-384",
"SHA2-512"
"SHA2-512",
"SHA2-512/224",
"SHA2-512/256"
],
"macSaltMethods": [
"default",
Expand Down Expand Up @@ -3210,6 +3214,8 @@ static struct {
{"KDA/HKDF/SHA2-256", 4, HKDF<EVP_sha256>},
{"KDA/HKDF/SHA2-384", 4, HKDF<EVP_sha384>},
{"KDA/HKDF/SHA2-512", 4, HKDF<EVP_sha512>},
{"KDA/HKDF/SHA2-512/224", 4, HKDF<EVP_sha512_224>},
{"KDA/HKDF/SHA2-512/256", 4, HKDF<EVP_sha512_256>},
{"KDA/OneStep/SHA-1", 3, SSKDF_DIGEST<EVP_sha1>},
{"KDA/OneStep/SHA2-224", 3, SSKDF_DIGEST<EVP_sha224>},
{"KDA/OneStep/SHA2-256", 3, SSKDF_DIGEST<EVP_sha256>},
Expand Down

0 comments on commit 0ac9a50

Please sign in to comment.