Bouncy Castle Cryptography Library 1.86

org.bouncycastle.pqc.crypto.test
Class AIMerTest

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

public class AIMerTest
extends junit.framework.TestCase


Constructor Summary
AIMerTest()
           
 
Method Summary
static void main(java.lang.String[] args)
           
 void testTestVectors()
           
 void testWrongLengthSignatureRejected()
          verifySignature() takes the bare signature, so it has to require exactly getSignatureBytes(): a shorter buffer used to be indexed past its end, and a longer one had its trailing bytes ignored, so a valid signature with data appended still verified.
 
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

AIMerTest

public AIMerTest()
Method Detail

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Throws:
java.lang.Exception

testTestVectors

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

testWrongLengthSignatureRejected

public void testWrongLengthSignatureRejected()
                                      throws java.lang.Exception
verifySignature() takes the bare signature, so it has to require exactly getSignatureBytes(): a shorter buffer used to be indexed past its end, and a longer one had its trailing bytes ignored, so a valid signature with data appended still verified. The first KAT vector of each parameter set supplies a public key and the message || signature envelope the reference harness records, which keeps this off the key generation and signing paths - a valid signature is what makes the appended-data cases bite. It also pins the envelope itself: handing verify the whole thing must now fail.

Throws:
java.lang.Exception

Bouncy Castle Cryptography Library 1.86