acvp: add SHA-512/256 support.

Change-Id: Ib5d69d82c4cfc8cc172bdb5d9a739af53f9d2899
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/44165
Reviewed-by: David Benjamin <davidben@google.com>
Commit-Queue: Adam Langley <agl@google.com>
chromium-5359
Adam Langley 4 years ago committed by CQ bot account: commit-bot@chromium.org
parent 8846533744
commit 806c505b7e
  1. 1
      util/fipstools/acvp/acvptool/subprocess/subprocess.go
  2. 8
      util/fipstools/acvp/modulewrapper/modulewrapper.cc

@ -76,6 +76,7 @@ func NewWithIO(cmd *exec.Cmd, in io.WriteCloser, out io.ReadCloser) *Subprocess
"SHA2-256": &hashPrimitive{"SHA2-256", 32},
"SHA2-384": &hashPrimitive{"SHA2-384", 48},
"SHA2-512": &hashPrimitive{"SHA2-512", 64},
"SHA2-512/256": &hashPrimitive{"SHA2-512/256", 32},
"ACVP-AES-ECB": &blockCipher{"AES", 16, 2, true, false, iterateAES},
"ACVP-AES-CBC": &blockCipher{"AES-CBC", 16, 2, true, true, iterateAESCBC},
"ACVP-AES-CTR": &blockCipher{"AES-CTR", 16, 1, false, true, nil},

@ -163,6 +163,13 @@ static bool GetConfig(const Span<const uint8_t> args[]) {
"min": 0, "max": 65528, "increment": 8
}]
},
{
"algorithm": "SHA2-512/256",
"revision": "1.0",
"messageLength": [{
"min": 0, "max": 65528, "increment": 8
}]
},
{
"algorithm": "SHA-1",
"revision": "1.0",
@ -1557,6 +1564,7 @@ static constexpr struct {
{"SHA2-256", 1, Hash<SHA256, SHA256_DIGEST_LENGTH>},
{"SHA2-384", 1, Hash<SHA384, SHA256_DIGEST_LENGTH>},
{"SHA2-512", 1, Hash<SHA512, SHA512_DIGEST_LENGTH>},
{"SHA2-512/256", 1, Hash<SHA512_256, SHA512_256_DIGEST_LENGTH>},
{"AES/encrypt", 3, AES<AES_set_encrypt_key, AES_encrypt>},
{"AES/decrypt", 3, AES<AES_set_decrypt_key, AES_decrypt>},
{"AES-CBC/encrypt", 4, AES_CBC<AES_set_encrypt_key, AES_ENCRYPT>},

Loading…
Cancel
Save