aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2018-04-14 09:01:27 -0400
committerJack Lloyd <[email protected]>2018-04-14 09:01:27 -0400
commitd208cc3ab74afce04b18c21d87e4927034ab726a (patch)
tree4b4bf7d4e3c6ae033b78b5db0e66d2af9095d86f
parent325d772cf89763a3ca9e5ac144d10af6c408421f (diff)
parent134e2d21b6118542a0000ba6b556db9357000339 (diff)
Merge GH #1531 Improve XMSS test coverage
-rwxr-xr-xconfigure.py2
-rw-r--r--src/build-data/buildh.in4
-rw-r--r--src/lib/pubkey/xmss/xmss_hash.cpp5
-rw-r--r--src/lib/pubkey/xmss/xmss_hash.h7
-rw-r--r--src/lib/pubkey/xmss/xmss_tools.cpp8
5 files changed, 14 insertions, 12 deletions
diff --git a/configure.py b/configure.py
index 26a5ba8a2..bf4cf1365 100755
--- a/configure.py
+++ b/configure.py
@@ -1857,6 +1857,8 @@ def create_template_vars(source_paths, build_paths, options, modules, cc, arch,
'build_fuzzers': options.build_fuzzers,
+ 'build_coverage' : options.with_coverage_info or options.with_coverage,
+
'symlink_shared_lib': options.build_shared_lib and shared_lib_uses_symlinks(),
'libobj_dir': build_paths.libobj_dir,
diff --git a/src/build-data/buildh.in b/src/build-data/buildh.in
index 807b6f479..594eab9c8 100644
--- a/src/build-data/buildh.in
+++ b/src/build-data/buildh.in
@@ -56,6 +56,10 @@
#define BOTAN_HAS_SANITIZER_%{i|upper}
%{endfor}
+%{if build_coverage}
+#define BOTAN_HAS_COVERAGE
+%{endif}
+
#define BOTAN_TARGET_ARCH_IS_%{arch|upper}
%{if endian}
#define BOTAN_TARGET_CPU_IS_%{endian|upper}_ENDIAN
diff --git a/src/lib/pubkey/xmss/xmss_hash.cpp b/src/lib/pubkey/xmss/xmss_hash.cpp
index a691453dc..cd714873c 100644
--- a/src/lib/pubkey/xmss/xmss_hash.cpp
+++ b/src/lib/pubkey/xmss/xmss_hash.cpp
@@ -56,11 +56,6 @@ void XMSS_Hash::h_msg_init(const secure_vector<uint8_t>& randomness,
m_msg_hash->update(index_bytes);
}
-void XMSS_Hash::h_msg_update(const secure_vector<uint8_t>& data)
- {
- m_msg_hash->update(data);
- }
-
void XMSS_Hash::h_msg_update(const uint8_t data[], size_t size)
{
m_msg_hash->update(data, size);
diff --git a/src/lib/pubkey/xmss/xmss_hash.h b/src/lib/pubkey/xmss/xmss_hash.h
index 85cebdc91..f45432d59 100644
--- a/src/lib/pubkey/xmss/xmss_hash.h
+++ b/src/lib/pubkey/xmss/xmss_hash.h
@@ -120,13 +120,6 @@ class XMSS_Hash final
* Adds a message block to buffered h_msg computation.
*
* @param data A message block
- **/
- void h_msg_update(const secure_vector<uint8_t>& data);
-
- /**
- * Adds a message block to buffered h_msg computation.
- *
- * @param data A message block
* @param size Length of the message block in bytes.
**/
void h_msg_update(const uint8_t data[], size_t size);
diff --git a/src/lib/pubkey/xmss/xmss_tools.cpp b/src/lib/pubkey/xmss/xmss_tools.cpp
index f9bd4892e..b55a977d8 100644
--- a/src/lib/pubkey/xmss/xmss_tools.cpp
+++ b/src/lib/pubkey/xmss/xmss_tools.cpp
@@ -68,11 +68,19 @@ size_t XMSS_Tools::bench_threads()
if(durations[0].count() < durations[1].count())
{
+#if defined(BOTAN_HAS_COVERAGE)
+ return 4;
+#else
return concurrency[0];
+#endif
}
else
{
+#if defined(BOTAN_HAS_COVERAGE)
+ return 4;
+#else
return concurrency[1];
+#endif
}
}