diff options
Diffstat (limited to 'java/src/test')
-rw-r--r-- | java/src/test/java/org/whispersystems/libaxolotl/CurveTest.java | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/java/src/test/java/org/whispersystems/libaxolotl/CurveTest.java b/java/src/test/java/org/whispersystems/libaxolotl/CurveTest.java new file mode 100644 index 00000000..734f6c86 --- /dev/null +++ b/java/src/test/java/org/whispersystems/libaxolotl/CurveTest.java @@ -0,0 +1,26 @@ +package org.whispersystems.libaxolotl; + +import junit.framework.TestCase; + +import org.whispersystems.libaxolotl.ecc.Curve; +import org.whispersystems.libaxolotl.ecc.ECKeyPair; + +public class CurveTest extends TestCase { + + public void testPureJava() { + assertFalse(Curve.isNative()); + } + + public void testSignatureOverflow() throws InvalidKeyException { + ECKeyPair keys = Curve.generateKeyPair(); + byte[] message = new byte[4096]; + + try { + byte[] signature = Curve.calculateSignature(keys.getPrivateKey(), message); + throw new InvalidKeyException("Should have asserted!"); + } catch (IllegalArgumentException e) { + // Success! + } + } + +} |