Bouncy Castle Cryptography Library 1.85

org.bouncycastle.pqc.crypto.test
Class CMCEKEMVectorTest

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

public class CMCEKEMVectorTest
extends junit.framework.TestCase

Known-answer tests for the standardised Classic McEliece KEM (ISO/IEC 18033-2:2006/Amd 2:2026, Clause 13) under org.bouncycastle.crypto. Drives the public lightweight API (CMCEKeyPairGenerator / CMCEKEMGenerator / CMCEKEMExtractor) with a deterministic NISTSecureRandom through the shared TestUtils.testTestVector harness. (The harness's optional factory round-trip uses the pqc-side org.bouncycastle.pqc.crypto.util factories, which do not handle these crypto-side keys, so it is left off here; the id-kem-cm OID round-trip through org.bouncycastle.crypto.util is covered by the prov CMCEKEMTest. The legacy pqc engine is covered separately by CMCEVectorTest.)

The non-pc and "f" sets reuse the official KAT vectors already staged under pqc/crypto/cmce (the standardised engine is byte-identical to the legacy one for these sets). The pc/pcf vectors were generated from the official Classic McEliece reference (libmceliece, lib.mceliece.org) driven by the NIST CTR-DRBG so they reproduce here - validated by regenerating the non-pc/f sets byte-identically against the existing KATs - and staged alongside as *-pc-cmce.rsp / *-pcf-cmce.rsp.


Constructor Summary
CMCEKEMVectorTest()
           
 
Method Summary
 void testKeyInfoFactoryRoundTrip()
           
 void testParameters()
           
 void testVectors()
           
 
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

CMCEKEMVectorTest

public CMCEKEMVectorTest()
Method Detail

testParameters

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

testKeyInfoFactoryRoundTrip

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

testVectors

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

Bouncy Castle Cryptography Library 1.85