HomePhabricator

Constant-time behaviour test using valgrind memtest.

Description

Constant-time behaviour test using valgrind memtest.

Summary:

  • 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

  • Run valgrind_ctime_test in travis

This is a backport of secp256k1 PR708

Test Plan:

make check

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

Differential Revision: https://reviews.bitcoinabc.org/D5580

Details

Provenance
Gregory Maxwell <greg@xiph.org>Authored on Jan 8 2020, 11:56
deadalnixCommitted on Mar 29 2020, 18:40
deadalnixPushed on Mar 29 2020, 18:40
Reviewer
Restricted Project
Differential Revision
D5580: Constant-time behaviour test using valgrind memtest.
Parents
rABC3b7267b39b6b: Bump version to 0.21.4
Branches
Unknown
Tags
Unknown