Bouncy Castle Cryptography Library 1.86

org.bouncycastle.crypto.agreement.test
Class JPAKEUtilTest

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

public class JPAKEUtilTest
extends junit.framework.TestCase


Constructor Summary
JPAKEUtilTest()
           
 
Method Summary
 void testPrivateExponentsAreBlinded()
          Every exponent carrying private material is randomised with a multiple of q before it is raised, so each of those calls draws exactly one blinding factor.
 void testValidateGa()
           
 void testValidateGx4()
           
 void testValidateMacTag()
           
 void testValidateMacTagEncoding()
          The MacTag comparison encodes both sides to the MAC's fixed width so its running time does not depend on the expected - secret-derived - value. calculateMacTag reads the MAC output with the signed BigInteger(byte[]) constructor, so a tag is negative about half the time, and about one tag in 240 has a two's-complement encoding shorter than the MAC.
 void testValidateNotNull()
           
 void testValidateParticipantIdsDiffer()
           
 void testValidateParticipantIdsEqual()
           
 void testValidateZeroKnowledgeProof()
           
 
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

JPAKEUtilTest

public JPAKEUtilTest()
Method Detail

testValidateGx4

public void testValidateGx4()
                     throws CryptoException
Throws:
CryptoException

testValidateGa

public void testValidateGa()
                    throws CryptoException
Throws:
CryptoException

testValidateParticipantIdsDiffer

public void testValidateParticipantIdsDiffer()
                                      throws CryptoException
Throws:
CryptoException

testValidateParticipantIdsEqual

public void testValidateParticipantIdsEqual()
                                     throws CryptoException
Throws:
CryptoException

testValidateMacTag

public void testValidateMacTag()
                        throws CryptoException
Throws:
CryptoException

testValidateMacTagEncoding

public void testValidateMacTagEncoding()
                                throws CryptoException
The MacTag comparison encodes both sides to the MAC's fixed width so its running time does not depend on the expected - secret-derived - value. calculateMacTag reads the MAC output with the signed BigInteger(byte[]) constructor, so a tag is negative about half the time, and about one tag in 240 has a two's-complement encoding shorter than the MAC. Those are the tags a zero-padding fixed-width encoding (BigIntegers.asUnsignedByteArray) fails to round-trip, so enough tags are exercised here to include some, and every one of them has to validate. A tag too wide to be one is rejected.

Throws:
CryptoException

testValidateNotNull

public void testValidateNotNull()

testPrivateExponentsAreBlinded

public void testPrivateExponentsAreBlinded()
                                    throws CryptoException
Every exponent carrying private material is randomised with a multiple of q before it is raised, so each of those calls draws exactly one blinding factor. The values themselves must not move, which is what the plain BigInteger arithmetic here checks - a multiple of the wrong order would change them, and nothing else in the suite would notice.

Throws:
CryptoException

testValidateZeroKnowledgeProof

public void testValidateZeroKnowledgeProof()
                                    throws CryptoException
Throws:
CryptoException

Bouncy Castle Cryptography Library 1.86