diff --git a/sw/device/lib/crypto/impl/rsa/BUILD b/sw/device/lib/crypto/impl/rsa/BUILD index f2d1e2a430e55..5b53778a51152 100644 --- a/sw/device/lib/crypto/impl/rsa/BUILD +++ b/sw/device/lib/crypto/impl/rsa/BUILD @@ -67,8 +67,6 @@ cc_library( "//sw/device/lib/crypto/drivers:kmac", "//sw/device/lib/crypto/impl:hash", "//sw/device/lib/crypto/impl:status", - "//sw/device/lib/crypto/impl/sha2:sha256", - "//sw/device/lib/crypto/impl/sha2:sha512", ], ) @@ -87,8 +85,6 @@ cc_library( "//sw/device/lib/base:memory", "//sw/device/lib/crypto/drivers:entropy", "//sw/device/lib/crypto/impl:hash", - "//sw/device/lib/crypto/impl/sha2:sha256", - "//sw/device/lib/crypto/impl/sha2:sha512", ], ) diff --git a/sw/device/lib/crypto/impl/rsa/rsa_encryption.c b/sw/device/lib/crypto/impl/rsa/rsa_encryption.c index 25cc7e32d72cc..049a0041923ee 100644 --- a/sw/device/lib/crypto/impl/rsa/rsa_encryption.c +++ b/sw/device/lib/crypto/impl/rsa/rsa_encryption.c @@ -10,8 +10,6 @@ #include "sw/device/lib/crypto/drivers/entropy.h" #include "sw/device/lib/crypto/impl/rsa/rsa_modexp.h" #include "sw/device/lib/crypto/impl/rsa/rsa_padding.h" -#include "sw/device/lib/crypto/impl/sha2/sha256.h" -#include "sw/device/lib/crypto/impl/sha2/sha512.h" #include "sw/device/lib/crypto/include/hash.h" // Module ID for status codes. diff --git a/sw/device/lib/crypto/impl/rsa/rsa_padding.c b/sw/device/lib/crypto/impl/rsa/rsa_padding.c index b69b8b0e82b17..40127dec25cb4 100644 --- a/sw/device/lib/crypto/impl/rsa/rsa_padding.c +++ b/sw/device/lib/crypto/impl/rsa/rsa_padding.c @@ -9,8 +9,6 @@ #include "sw/device/lib/base/math.h" #include "sw/device/lib/crypto/drivers/entropy.h" #include "sw/device/lib/crypto/drivers/kmac.h" -#include "sw/device/lib/crypto/impl/sha2/sha256.h" -#include "sw/device/lib/crypto/impl/sha2/sha512.h" #include "sw/device/lib/crypto/include/hash.h" // Module ID for status codes. diff --git a/sw/device/lib/crypto/impl/rsa/rsa_signature.c b/sw/device/lib/crypto/impl/rsa/rsa_signature.c index 70852fb8779c2..872add70f34fe 100644 --- a/sw/device/lib/crypto/impl/rsa/rsa_signature.c +++ b/sw/device/lib/crypto/impl/rsa/rsa_signature.c @@ -10,8 +10,6 @@ #include "sw/device/lib/crypto/drivers/entropy.h" #include "sw/device/lib/crypto/impl/rsa/rsa_modexp.h" #include "sw/device/lib/crypto/impl/rsa/rsa_padding.h" -#include "sw/device/lib/crypto/impl/sha2/sha256.h" -#include "sw/device/lib/crypto/impl/sha2/sha512.h" #include "sw/device/lib/crypto/include/hash.h" // Module ID for status codes. diff --git a/sw/device/silicon_creator/manuf/lib/BUILD b/sw/device/silicon_creator/manuf/lib/BUILD index 43b174fed6f0e..5562e226620d6 100644 --- a/sw/device/silicon_creator/manuf/lib/BUILD +++ b/sw/device/silicon_creator/manuf/lib/BUILD @@ -179,6 +179,7 @@ cc_library( "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/base:macros", "//sw/device/lib/base:status", + "//sw/device/lib/crypto/impl:hash", "//sw/device/lib/dif:flash_ctrl", "//sw/device/lib/dif:otp_ctrl", "//sw/device/lib/testing:flash_ctrl_testutils", diff --git a/sw/device/silicon_creator/manuf/lib/individualize_sw_cfg.c b/sw/device/silicon_creator/manuf/lib/individualize_sw_cfg.c index aaed955dd5349..a3896706534f7 100644 --- a/sw/device/silicon_creator/manuf/lib/individualize_sw_cfg.c +++ b/sw/device/silicon_creator/manuf/lib/individualize_sw_cfg.c @@ -5,8 +5,8 @@ #include "sw/device/silicon_creator/manuf/lib/individualize_sw_cfg.h" #include "sw/device/lib/base/macros.h" -#include "sw/device/lib/crypto/impl/sha2/sha256.h" #include "sw/device/lib/crypto/include/datatypes.h" +#include "sw/device/lib/crypto/include/hash.h" #include "sw/device/lib/dif/dif_flash_ctrl.h" #include "sw/device/lib/dif/dif_otp_ctrl.h" #include "sw/device/lib/testing/flash_ctrl_testutils.h" diff --git a/sw/device/silicon_creator/manuf/lib/util.c b/sw/device/silicon_creator/manuf/lib/util.c index 34da60fd1aba2..2dcaea539162f 100644 --- a/sw/device/silicon_creator/manuf/lib/util.c +++ b/sw/device/silicon_creator/manuf/lib/util.c @@ -7,7 +7,6 @@ #include #include "sw/device/lib/base/status.h" -#include "sw/device/lib/crypto/impl/sha2/sha256.h" #include "sw/device/lib/crypto/include/datatypes.h" #include "sw/device/lib/crypto/include/hash.h" #include "sw/device/lib/dif/dif_otp_ctrl.h" diff --git a/sw/device/tests/crypto/cryptotest/firmware/BUILD b/sw/device/tests/crypto/cryptotest/firmware/BUILD index 01e4728fc93b9..cab5bd67ec7cf 100644 --- a/sw/device/tests/crypto/cryptotest/firmware/BUILD +++ b/sw/device/tests/crypto/cryptotest/firmware/BUILD @@ -97,8 +97,6 @@ cc_library( "//sw/device/lib/crypto/impl:hash", "//sw/device/lib/crypto/impl:integrity", "//sw/device/lib/crypto/impl:keyblob", - "//sw/device/lib/crypto/impl/sha2:sha256", - "//sw/device/lib/crypto/impl/sha2:sha512", "//sw/device/lib/crypto/include:datatypes", "//sw/device/lib/runtime:log", "//sw/device/lib/testing/test_framework:ujson_ottf", diff --git a/sw/device/tests/crypto/cryptotest/firmware/hash.c b/sw/device/tests/crypto/cryptotest/firmware/hash.c index 734e60688b913..26bf2f2a004ca 100644 --- a/sw/device/tests/crypto/cryptotest/firmware/hash.c +++ b/sw/device/tests/crypto/cryptotest/firmware/hash.c @@ -10,8 +10,6 @@ #include "sw/device/lib/crypto/drivers/kmac.h" #include "sw/device/lib/crypto/impl/integrity.h" #include "sw/device/lib/crypto/impl/keyblob.h" -#include "sw/device/lib/crypto/impl/sha2/sha256.h" -#include "sw/device/lib/crypto/impl/sha2/sha512.h" #include "sw/device/lib/crypto/include/datatypes.h" #include "sw/device/lib/runtime/log.h" #include "sw/device/lib/testing/test_framework/ujson_ottf.h" diff --git a/sw/device/tests/crypto/ecdsa_p256_functest.c b/sw/device/tests/crypto/ecdsa_p256_functest.c index b07afe7fcd748..8f9a2a7368123 100644 --- a/sw/device/tests/crypto/ecdsa_p256_functest.c +++ b/sw/device/tests/crypto/ecdsa_p256_functest.c @@ -14,8 +14,6 @@ #include "sw/device/lib/testing/test_framework/ottf_main.h" enum { - /* Number of 32-bit words in a SHA256 digest. */ - kSha256DigestWords = 256 / 32, /* Number of 32-bit words in a P-256 public key. */ kP256PublicKeyWords = 512 / 32, /* Number of 32-bit words in a P-256 signature. */ diff --git a/sw/device/tests/crypto/ecdsa_p256_sideload_functest.c b/sw/device/tests/crypto/ecdsa_p256_sideload_functest.c index 84963afb91c8b..a893db4d08ec4 100644 --- a/sw/device/tests/crypto/ecdsa_p256_sideload_functest.c +++ b/sw/device/tests/crypto/ecdsa_p256_sideload_functest.c @@ -17,8 +17,6 @@ #define MODULE_ID MAKE_MODULE_ID('t', 's', 't') enum { - /* Number of 32-bit words in a SHA256 digest. */ - kSha256DigestWords = 256 / 32, /* Number of 32-bit words in a P-256 public key. */ kP256PublicKeyWords = 512 / 32, /* Number of 32-bit words in a P-256 signature. */ diff --git a/sw/device/tests/crypto/ecdsa_p384_functest.c b/sw/device/tests/crypto/ecdsa_p384_functest.c index 465536b4ab217..2a97edb06f409 100644 --- a/sw/device/tests/crypto/ecdsa_p384_functest.c +++ b/sw/device/tests/crypto/ecdsa_p384_functest.c @@ -14,8 +14,6 @@ #include "sw/device/lib/testing/test_framework/ottf_main.h" enum { - /* Number of 32-bit words in a SHA384 digest. */ - kSha384DigestWords = 384 / 32, /* Number of 32-bit words in a P-384 public key. */ kP384PublicKeyWords = 768 / 32, /* Number of 32-bit words in a P-384 signature. */ diff --git a/sw/device/tests/crypto/ecdsa_p384_sideload_functest.c b/sw/device/tests/crypto/ecdsa_p384_sideload_functest.c index 789504685bcdb..2a508dd49504f 100644 --- a/sw/device/tests/crypto/ecdsa_p384_sideload_functest.c +++ b/sw/device/tests/crypto/ecdsa_p384_sideload_functest.c @@ -17,8 +17,6 @@ #define MODULE_ID MAKE_MODULE_ID('t', 's', 't') enum { - /* Number of 32-bit words in a SHA384 digest. */ - kSha384DigestWords = 384 / 32, /* Number of 32-bit words in a P-384 public key. */ kP384PublicKeyWords = 768 / 32, /* Number of 32-bit words in a P-384 signature. */ diff --git a/sw/device/tests/crypto/rsa_2048_encryption_functest.c b/sw/device/tests/crypto/rsa_2048_encryption_functest.c index 40408c5db3995..2f4289b941443 100644 --- a/sw/device/tests/crypto/rsa_2048_encryption_functest.c +++ b/sw/device/tests/crypto/rsa_2048_encryption_functest.c @@ -16,7 +16,6 @@ #define MODULE_ID MAKE_MODULE_ID('t', 's', 't') enum { - kSha256DigestWords = 256 / 32, kRsa2048NumBytes = 2048 / 8, kRsa2048NumWords = kRsa2048NumBytes / sizeof(uint32_t), }; diff --git a/sw/device/tests/crypto/rsa_2048_keygen_functest.c b/sw/device/tests/crypto/rsa_2048_keygen_functest.c index df760793a7a7a..9dc7d527b90e3 100644 --- a/sw/device/tests/crypto/rsa_2048_keygen_functest.c +++ b/sw/device/tests/crypto/rsa_2048_keygen_functest.c @@ -16,11 +16,6 @@ // Module for status messages. #define MODULE_ID MAKE_MODULE_ID('t', 's', 't') -enum { - /* Number of words for a SHA-256 digest. */ - kSha256DigestWords = 256 / 32, -}; - // Message data for testing. static const unsigned char kTestMessage[] = "Test message."; static const size_t kTestMessageLen = sizeof(kTestMessage) - 1; diff --git a/sw/device/tests/crypto/rsa_2048_signature_functest.c b/sw/device/tests/crypto/rsa_2048_signature_functest.c index 1d5f1bbc7b5ed..e275efcca8bff 100644 --- a/sw/device/tests/crypto/rsa_2048_signature_functest.c +++ b/sw/device/tests/crypto/rsa_2048_signature_functest.c @@ -16,7 +16,6 @@ #define MODULE_ID MAKE_MODULE_ID('t', 's', 't') enum { - kSha256DigestWords = 256 / 32, kRsa2048NumBytes = 2048 / 8, kRsa2048NumWords = kRsa2048NumBytes / sizeof(uint32_t), }; diff --git a/sw/device/tests/crypto/rsa_3072_keygen_functest.c b/sw/device/tests/crypto/rsa_3072_keygen_functest.c index ea6377dd68533..2fcbe68d39bbf 100644 --- a/sw/device/tests/crypto/rsa_3072_keygen_functest.c +++ b/sw/device/tests/crypto/rsa_3072_keygen_functest.c @@ -16,11 +16,6 @@ // Module for status messages. #define MODULE_ID MAKE_MODULE_ID('t', 's', 't') -enum { - /* Number of words for a SHA-512 digest. */ - kSha512DigestWords = 512 / 32, -}; - // Message data for testing. static const unsigned char kTestMessage[] = "Test message."; static const size_t kTestMessageLen = sizeof(kTestMessage) - 1; diff --git a/sw/device/tests/crypto/rsa_3072_signature_functest.c b/sw/device/tests/crypto/rsa_3072_signature_functest.c index 489f9f5ac4fe4..2005a7695ef04 100644 --- a/sw/device/tests/crypto/rsa_3072_signature_functest.c +++ b/sw/device/tests/crypto/rsa_3072_signature_functest.c @@ -16,7 +16,6 @@ #define MODULE_ID MAKE_MODULE_ID('t', 's', 't') enum { - kSha512DigestWords = 512 / 32, kRsa3072NumBytes = 3072 / 8, kRsa3072NumWords = kRsa3072NumBytes / sizeof(uint32_t), }; diff --git a/sw/device/tests/crypto/rsa_4096_keygen_functest.c b/sw/device/tests/crypto/rsa_4096_keygen_functest.c index 2d8775880ba13..762ac0cde583e 100644 --- a/sw/device/tests/crypto/rsa_4096_keygen_functest.c +++ b/sw/device/tests/crypto/rsa_4096_keygen_functest.c @@ -16,11 +16,6 @@ // Module for status messages. #define MODULE_ID MAKE_MODULE_ID('t', 's', 't') -enum { - /* Number of words for a SHA-512 digest. */ - kSha512DigestWords = 512 / 32, -}; - // Message data for testing. static const unsigned char kTestMessage[] = "Test message."; static const size_t kTestMessageLen = sizeof(kTestMessage) - 1; diff --git a/sw/device/tests/crypto/rsa_4096_signature_functest.c b/sw/device/tests/crypto/rsa_4096_signature_functest.c index d0d4ea0b16703..ebc41f94c8657 100644 --- a/sw/device/tests/crypto/rsa_4096_signature_functest.c +++ b/sw/device/tests/crypto/rsa_4096_signature_functest.c @@ -16,7 +16,6 @@ #define MODULE_ID MAKE_MODULE_ID('t', 's', 't') enum { - kSha512DigestWords = 512 / 32, kRsa4096NumBytes = 4096 / 8, kRsa4096NumWords = kRsa4096NumBytes / sizeof(uint32_t), };