Bouncy Castle Cryptography Library 1.87

org.bouncycastle.pqc.crypto.test
Class SNTRUPrimeTest

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

public class SNTRUPrimeTest
extends junit.framework.TestCase


Constructor Summary
SNTRUPrimeTest()
           
 
Method Summary
 void testImplicitRejection()
          A ciphertext changed anywhere decapsulates, by implicit rejection, to the secret the reference derives from rho and the received ciphertext, SHA-512(0 | SHA-512(3 | rho)[0:32] | ciphertext)[0:32], rather than the encapsulated one.
 void testKEM()
           
 
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

SNTRUPrimeTest

public SNTRUPrimeTest()
Method Detail

testKEM

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

testImplicitRejection

public void testImplicitRejection()
A ciphertext changed anywhere decapsulates, by implicit rejection, to the secret the reference derives from rho and the received ciphertext, SHA-512(0 | SHA-512(3 | rho)[0:32] | ciphertext)[0:32], rather than the encapsulated one.

The secret used to be derived from the re-encrypted ciphertext instead, which depends only on the decrypted r, so ciphertexts that decrypt to the same r - such as two that differ only in the confirmation hash - shared a rejection secret, telling an attacker so.


Bouncy Castle Cryptography Library 1.87