Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test: fix timing flake for crypto.timingSafeEqual
  • Loading branch information
not-an-aardvark committed Aug 27, 2016
commit 7e9869aa74587211355b73efd34663069fa04af1
5 changes: 0 additions & 5 deletions test/sequential/sequential.status
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ prefix sequential

[true] # This section applies to all platforms

# crypto.timingSafeEqual contains a statistical timing test to verify that the
# function is timing-safe. As a result, the test sometimes fails due to random
# timing fluctuations.
test-crypto-timing-safe-equal : PASS,FLAKY

[$system==win32]

[$system==linux]
Expand Down
6 changes: 0 additions & 6 deletions test/sequential/test-crypto-timing-safe-equal.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Flags: --allow_natives_syntax
'use strict';
const common = require('../common');
const assert = require('assert');
Expand Down Expand Up @@ -111,11 +110,6 @@ function filterOutliers(array) {
return array.filter((value) => value / arrMean < 50);
}

// Force optimization before starting the benchmark
runBenchmark(crypto.timingSafeEqual, Buffer.from('A'), Buffer.from('A'), true);
eval('%OptimizeFunctionOnNextCall(runBenchmark)');
runBenchmark(crypto.timingSafeEqual, Buffer.from('A'), Buffer.from('A'), true);

// t_(0.9995, ∞)
// i.e. If a given comparison function is indeed timing-safe, the t-test result
// has a 99.9% chance to be below this threshold. Unfortunately, this means that
Expand Down