From 611ddbe080e9436de83a47624156dba70b46d940 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Thu, 10 Sep 2009 18:24:33 -0700 Subject: Remove NativeBN_bn2twosComp. NativeBN_bn2twosComp doesn't do what it claims to: it's an exact copy of NativeBN_BN_bn2bin (observe which OpenSSL BN_ function it calls!), and -- from the OpenSSL documentation -- that function "converts the absolute value of [its argument] into big-endian form". OpenSSL doesn't actually sport any appropriate function to call here, but luckily this code isn't called anywhere, and so can be removed. (BigInteger.toByteArray -- the most likely caller of this code -- seems to do the right thing, using Java code to make a big-endian two's-complement byte[]. Likewise, the conversion from a big-endian two's-complement byte[] for the corresponding BigInteger constructor looks right too, using native code to twiddle the bits itself.) --- openssl/src/main/java/org/openssl/NativeBN.java | 3 --- 1 file changed, 3 deletions(-) (limited to 'openssl/src/main/java') diff --git a/openssl/src/main/java/org/openssl/NativeBN.java b/openssl/src/main/java/org/openssl/NativeBN.java index 44464e0..3597e3c 100644 --- a/openssl/src/main/java/org/openssl/NativeBN.java +++ b/openssl/src/main/java/org/openssl/NativeBN.java @@ -79,9 +79,6 @@ public class NativeBN { public static native int[] bn2litEndInts(int a, int[] to); - public static native byte[] bn2twosComp(int a, byte[] to); - - public static native int sign(int a); // Returns -1, 0, 1 AND NOT boolean. // #define BN_is_negative(a) ((a)->neg != 0) -- cgit v1.1