Constant-time behaviour test using valgrind memtest.

Valgrind does bit-level tracking of the "uninitialized" status of memory,
 property tracks memory which is tainted by any uninitialized memory, and
 warns if any branch or array access depends on an uninitialized bit.

That is exactly the verification we need on secret data to test for
 constant-time behaviour. All we need to do is tell valgrind our
 secret key is actually uninitialized memory.

This adds a valgrind_ctime_test which is compiled if valgrind is installed:

Run it with libtool --mode=execute:
$ libtool --mode=execute valgrind ./valgrind_ctime_test
This commit is contained in:
Gregory Maxwell
2020-01-08 11:56:15 +00:00
parent 96d8ccbd16
commit 3d2302257f
4 changed files with 108 additions and 0 deletions

1
.gitignore vendored
View File

@@ -9,6 +9,7 @@ bench_internal
tests
exhaustive_tests
gen_context
valgrind_ctime_test
*.exe
*.so
*.a