diff options
author | Moxie Marlinspike <moxie@thoughtcrime.org> | 2015-05-01 10:29:13 -0700 |
---|---|---|
committer | Moxie Marlinspike <moxie@thoughtcrime.org> | 2015-05-01 10:29:13 -0700 |
commit | a7b04fce1942060d833b769f13ac21ae2a590393 (patch) | |
tree | a2bd0fc9c129d516db52764e19cf5d36134300e1 /java | |
parent | 8ec896129ddb5adefa5d94d73e4f99206bdac2d9 (diff) |
Upgrade to Curve25519 0.2.4
Diffstat (limited to 'java')
-rw-r--r-- | java/src/test/java/org/whispersystems/libaxolotl/CurveTest.java | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/java/src/test/java/org/whispersystems/libaxolotl/CurveTest.java b/java/src/test/java/org/whispersystems/libaxolotl/CurveTest.java index 734f6c86..24c62132 100644 --- a/java/src/test/java/org/whispersystems/libaxolotl/CurveTest.java +++ b/java/src/test/java/org/whispersystems/libaxolotl/CurveTest.java @@ -11,16 +11,16 @@ public class CurveTest extends TestCase { 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! - } + 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)); } } |