diff options
Diffstat (limited to 'android/src/androidTest/java/org')
-rw-r--r-- | android/src/androidTest/java/org/whispersystems/libaxolotl/CurveTest.java | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/android/src/androidTest/java/org/whispersystems/libaxolotl/CurveTest.java b/android/src/androidTest/java/org/whispersystems/libaxolotl/CurveTest.java new file mode 100644 index 00000000..bb539d49 --- /dev/null +++ b/android/src/androidTest/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() { + assertTrue(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 (AssertionError e) { + // Success! + } + } + +} |