aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/test
diff options
context:
space:
mode:
authorMoxie Marlinspike <moxie@thoughtcrime.org>2015-01-08 13:48:49 -0800
committerMoxie Marlinspike <moxie@thoughtcrime.org>2015-01-08 14:09:01 -0800
commit6445ea5f13850f42c3952bd06a2369317683ed88 (patch)
treef2bb37c8cf4710ff6a6a37a3e7e702c5a21ca504 /java/src/test
parenta4d8f7f6a4c4e9e89db35f299e558dceee2362a1 (diff)
Break project up into Java and Android build/test.
Diffstat (limited to 'java/src/test')
-rw-r--r--java/src/test/java/org/whispersystems/libaxolotl/CurveTest.java26
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!
+ }
+ }
+
+}