|
Bouncy Castle Cryptography Library 1.85 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
org.bouncycastle.pqc.crypto.mayo.MayoRetryTest
Regression test for the retry path in MayoSigner.generateSignature(byte[]).
The retry loop accumulates three buffers (, , ) with mulAdd-style (accumulate-into) calls. All three are allocated once before the loop, so on a retry they must be re-zeroed. The reference C implementation (MAYO-C ) declares inside the function as }, i.e. fresh per attempt, while memsets and the target on failure.
The Java port hoisted 's allocation out of the loop. Without clearing on retry, the second attempt computes (stale data carried over), corrupting the signature. The KAT vectors never trigger a retry, so this is invisible to the KAT battery.
This test forces exactly one retry by overriding to fail the first attempt, then asserts the produced signature still verifies.
| Constructor Summary | |
MayoRetryTest()
|
|
| Method Summary | |
void |
testRetryProducesValidSignature()
|
| Methods inherited from class junit.framework.TestCase |
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, tearDown, toString |
| Methods inherited from class junit.framework.Assert |
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public MayoRetryTest()
| Method Detail |
public void testRetryProducesValidSignature()
throws java.lang.Exception
java.lang.Exception
|
Bouncy Castle Cryptography Library 1.85 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||