aboutsummaryrefslogtreecommitdiffstats
path: root/android
diff options
context:
space:
mode:
authorMoxie Marlinspike <moxie@thoughtcrime.org>2015-05-01 10:29:13 -0700
committerMoxie Marlinspike <moxie@thoughtcrime.org>2015-05-01 10:29:13 -0700
commita7b04fce1942060d833b769f13ac21ae2a590393 (patch)
treea2bd0fc9c129d516db52764e19cf5d36134300e1 /android
parent8ec896129ddb5adefa5d94d73e4f99206bdac2d9 (diff)
Upgrade to Curve25519 0.2.4
Diffstat (limited to 'android')
-rw-r--r--android/src/androidTest/java/org/whispersystems/libaxolotl/CurveTest.java20
1 files changed, 10 insertions, 10 deletions
diff --git a/android/src/androidTest/java/org/whispersystems/libaxolotl/CurveTest.java b/android/src/androidTest/java/org/whispersystems/libaxolotl/CurveTest.java
index bb539d49..baaea356 100644
--- a/android/src/androidTest/java/org/whispersystems/libaxolotl/CurveTest.java
+++ b/android/src/androidTest/java/org/whispersystems/libaxolotl/CurveTest.java
@@ -11,16 +11,16 @@ public class CurveTest extends TestCase {
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!
- }
+ public void testLargeSignatures() throws InvalidKeyException {
+ ECKeyPair keys = Curve.generateKeyPair();
+ byte[] message = new byte[1024 * 1024];
+ byte[] signature = Curve.calculateSignature(keys.getPrivateKey(), message);
+
+ assertTrue(Curve.verifySignature(keys.getPublicKey(), message, signature));
+
+ message[0] ^= 0x01;
+
+ assertFalse(Curve.verifySignature(keys.getPublicKey(), message, signature));
}
}