From e4aa5d9a810192726b66d725b9b725256aadb726 Mon Sep 17 00:00:00 2001 From: Nevine Ebeid Date: Tue, 6 Aug 2024 22:16:43 -0400 Subject: [PATCH] Limit the use of the DIT functions in benchmarking to AWS-LC builds. --- tool/speed.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tool/speed.cc b/tool/speed.cc index 5b1efcdaf7..27a45b2091 100644 --- a/tool/speed.cc +++ b/tool/speed.cc @@ -93,8 +93,10 @@ static inline void *BM_memset(void *dst, int c, size_t n) { // g_print_json is true if printed output is JSON formatted. static bool g_print_json = false; +#if defined(OPENSSL_IS_AWSLC) // g_dit is true if the DIT macro is to be enabled before benchmarking static bool g_dit = false; +#endif static std::string ChunkLenSuffix(size_t chunk_len) { char buf[32]; @@ -2615,9 +2617,11 @@ bool Speed(const std::vector &args) { } } +#if defined(OPENSSL_IS_AWSLC) if (args_map.count("-dit") != 0) { g_dit = true; } +#endif if (args_map.count("-json") != 0) { g_print_json = true; @@ -2670,12 +2674,13 @@ bool Speed(const std::vector &args) { return false; } } - +#if defined(OPENSSL_IS_AWSLC) uint64_t original_dit = 0; if (g_dit) { original_dit = armv8_enable_dit(); } +#endif // kTLSADLen is the number of bytes of additional data that TLS passes to // AEADs. @@ -2825,9 +2830,11 @@ bool Speed(const std::vector &args) { puts("\n]"); } +#if defined(OPENSSL_IS_AWSLC) if (g_dit) { armv8_restore_dit(&original_dit); } +#endif return true; }