public class ConstantTimeUsageTest extends SimpleTest
The substitutions guarded here - BigInteger.modInverse to BigIntegers.modOddInverse, add(...).mod(...) to BigIntegers.modAdd, and the default point multiplier to the secure one - all preserve the result, so no functional test can tell whether they are in place: the KAT vectors and the round-trips pass either way, which is exactly why the substitutions can be undone by an unrelated edit without anything going red. What is left to look at is the compiled form, so this test reads each class file back and checks the symbols its constant pool must and must not contain.
Note what this does and does not establish. It says a named call is still being made; it says nothing about whether the surrounding code is constant time, and it cannot see a secret that reaches a variable-time operation by some other route. It is a regression gate for four specific call sites, not a proof.
A scan that quietly reads nothing would pass every "must not contain" check, so the controls in
checkControls() are load bearing: they run the same scan over a class in this file that
deliberately calls BigInteger.modInverse, and fail if it is not flagged.
SimpleTest.TestExceptionOperation| Constructor and Description |
|---|
ConstantTimeUsageTest() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getName() |
static void |
main(java.lang.String[] args) |
void |
performTest() |
public java.lang.String getName()
getName in interface TestgetName in class SimpleTestpublic void performTest()
throws java.lang.Exception
performTest in class SimpleTestjava.lang.Exceptionpublic static void main(java.lang.String[] args)