public class HPKETestVectors
extends junit.framework.TestCase
| Constructor and Description |
|---|
HPKETestVectors() |
| Modifier and Type | Method and Description |
|---|---|
void |
testAuthOneShotPairwise() |
void |
testAuthPairwise() |
void |
testBaseOneShotPairwise() |
void |
testBasePairwise() |
void |
testOpenFailureDoesNotAdvanceSequence()
RFC 9180 sec. 5.2 advances the sequence number only after a successful Seal/Open.
|
void |
testPQKemAuthModesUnsupported() |
void |
testPQKemBaseOneShotPairwise() |
void |
testPQKemDeriveKeyPair() |
void |
testPQKemPSKPairwise() |
void |
testPQKemSerialization() |
void |
testSealOnExportOnlyLeavesContextUsable()
The sender side has the same contract: a failed seal must not consume a sequence number.
|
void |
testSendReceiveExportOnlySuite()
Export is the whole point of the export-only suite, which has no cipher to seal with, so the
one-shot export pair has to work there.
|
void |
testSendReceiveExportPairwise()
The one-shot secret export pair (RFC 9180 sec. 5.3), which had no caller anywhere in the
tree and so no coverage at all:
HPKE.sendExport(org.bouncycastle.crypto.params.AsymmetricKeyParameter, byte[], byte[], int, byte[], byte[], org.bouncycastle.crypto.AsymmetricCipherKeyPair) sets up a sender context and returns
the encapsulation alongside the exported secret, and HPKE.receiveExport(byte[], org.bouncycastle.crypto.AsymmetricCipherKeyPair, byte[], byte[], int, byte[], byte[], org.bouncycastle.crypto.params.AsymmetricKeyParameter) rebuilds the
matching context from that encapsulation and must produce the same bytes. |
void |
testVectors() |
void |
testXWingHPKEVector() |
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, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runBare, runTest, setName, setUp, tearDown, toStringpublic void testBaseOneShotPairwise()
throws java.lang.Exception
java.lang.Exceptionpublic void testAuthOneShotPairwise()
throws java.lang.Exception
java.lang.Exceptionpublic void testSendReceiveExportPairwise()
throws java.lang.Exception
HPKE.sendExport(org.bouncycastle.crypto.params.AsymmetricKeyParameter, byte[], byte[], int, byte[], byte[], org.bouncycastle.crypto.AsymmetricCipherKeyPair) sets up a sender context and returns
the encapsulation alongside the exported secret, and HPKE.receiveExport(byte[], org.bouncycastle.crypto.AsymmetricCipherKeyPair, byte[], byte[], int, byte[], byte[], org.bouncycastle.crypto.params.AsymmetricKeyParameter) rebuilds the
matching context from that encapsulation and must produce the same bytes. Both dispatch on
the mode the HPKE instance was built with, so all four are exercised here - the psk and
auth arguments are only consulted by the modes that need them.java.lang.Exceptionpublic void testSendReceiveExportOnlySuite()
throws java.lang.Exception
java.lang.Exceptionpublic void testOpenFailureDoesNotAdvanceSequence()
throws java.lang.Exception
java.lang.Exceptionpublic void testSealOnExportOnlyLeavesContextUsable()
throws java.lang.Exception
java.lang.Exceptionpublic void testBasePairwise()
throws java.lang.Exception
java.lang.Exceptionpublic void testAuthPairwise()
throws java.lang.Exception
java.lang.Exceptionpublic void testPQKemBaseOneShotPairwise()
throws java.lang.Exception
java.lang.Exceptionpublic void testPQKemPSKPairwise()
throws java.lang.Exception
java.lang.Exceptionpublic void testPQKemSerialization()
throws java.lang.Exception
java.lang.Exceptionpublic void testPQKemDeriveKeyPair()
throws java.lang.Exception
java.lang.Exceptionpublic void testPQKemAuthModesUnsupported()
throws java.lang.Exception
java.lang.Exceptionpublic void testXWingHPKEVector()
throws java.lang.Exception
java.lang.Exceptionpublic void testVectors()
throws java.lang.Exception
java.lang.Exception