Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions sw/device/tests/crypto/cryptotest/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,35 @@ filegroup(
srcs = glob(["**/*.md"]),
)

# Special Cryptotest firmware and harness used to run ACVP test vectors. The
# test_args are left empty by default. This allows the user to manually specify
# paths to the input and output ACVP JSON files that should be used.
#
# Example usage:
# ./bazelisk.sh run \
# //sw/device/tests/crypto/cryptotest:acvp_fpga_cw340_sival_rom_ext -- \
# --input=${ACVP_DIR}/hmac_sha2_256_vectors.json \
# --output=${ACVP_DIR}/hmac_sha2_256_results.json
cryptotest(
name = "acvp",
test_args = "",
test_harness = "//sw/host/tests/crypto/acvp:harness",
test_vectors = [],
)

cryptotest(
name = "acvp_hmac_sha256",
test_args = " ".join([
"--input=\"$(rootpath //sw/host/cryptotest/testvectors/acvp:hmac_sha256_vectors.json)\"",
"--expected=\"$(rootpath //sw/host/cryptotest/testvectors/acvp:hmac_sha256_expected.json)\"",
]),
test_harness = "//sw/host/tests/crypto/acvp:harness",
test_vectors = [
"//sw/host/cryptotest/testvectors/acvp:hmac_sha256_vectors.json",
"//sw/host/cryptotest/testvectors/acvp:hmac_sha256_expected.json",
],
)

AES_TESTVECTOR_TARGETS = [
"//sw/host/cryptotest/testvectors/data:nist_cavp_aes_kat_{}_{}_{}_json".format(alg, kat_type, key_len)
for alg in ("cbc", "cfb128", "ecb", "ofb")
Expand Down
10 changes: 10 additions & 0 deletions sw/host/cryptotest/testvectors/acvp/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright lowRISC contributors (OpenTitan project).
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0

package(default_visibility = ["//visibility:public"])

exports_files([
"hmac_sha256_expected.json",
"hmac_sha256_vectors.json",
])
Loading
Loading