Bouncy Castle Cryptography Library 1.87

org.bouncycastle.pqc.crypto.test
Class RawPublicKeyEncodingTest

java.lang.Object
  extended byjunit.framework.Assert
      extended byjunit.framework.TestCase
          extended byorg.bouncycastle.pqc.crypto.test.RawPublicKeyEncodingTest
All Implemented Interfaces:
junit.framework.Test

public class RawPublicKeyEncodingTest
extends junit.framework.TestCase

NTRU, Dilithium and BIKE public keys are written raw into the SubjectPublicKeyInfo BIT STRING, and the draft form that wrapped them in an OCTET STRING is still read. A raw key is random bytes, so it can begin with bytes that read as an OCTET STRING header whose length covers exactly the rest - about once in 2^32 keys - and must still be read as the raw key: such an NTRU key used to be rejected, and such a Dilithium or BIKE key loaded as a different, shorter key. The prefix is forced onto real keys here; none of the three binds its public key bytes to anything a decoder checks.


Constructor Summary
RawPublicKeyEncodingTest()
           
 
Method Summary
 void testBIKE()
           
 void testDilithium()
           
 void testNTRU()
           
 
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

RawPublicKeyEncodingTest

public RawPublicKeyEncodingTest()
Method Detail

testNTRU

public void testNTRU()
              throws java.lang.Exception
Throws:
java.lang.Exception

testDilithium

public void testDilithium()
                   throws java.lang.Exception
Throws:
java.lang.Exception

testBIKE

public void testBIKE()
              throws java.lang.Exception
Throws:
java.lang.Exception

Bouncy Castle Cryptography Library 1.87