summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJ08nY2017-12-01 00:24:25 +0100
committerJ08nY2017-12-01 00:24:25 +0100
commit018771cbd0b104918012c473a2590e0ef8e89a25 (patch)
tree267bbf8fde0340204f8a056b72d128d4622d39d7
parentc33faeed138b3cbb0324878fa24481916791ec50 (diff)
downloadECTester-018771cbd0b104918012c473a2590e0ef8e89a25.tar.gz
ECTester-018771cbd0b104918012c473a2590e0ef8e89a25.tar.zst
ECTester-018771cbd0b104918012c473a2590e0ef8e89a25.zip
-rw-r--r--src/cz/crcs/ectester/common/util/ECUtil.java6
-rw-r--r--src/cz/crcs/ectester/standalone/libs/jni/NativeECPrivateKey.java2
2 files changed, 4 insertions, 4 deletions
diff --git a/src/cz/crcs/ectester/common/util/ECUtil.java b/src/cz/crcs/ectester/common/util/ECUtil.java
index 662720a..973b813 100644
--- a/src/cz/crcs/ectester/common/util/ECUtil.java
+++ b/src/cz/crcs/ectester/common/util/ECUtil.java
@@ -13,7 +13,7 @@ public class ECUtil {
int bytes = (bits + 7) / 8;
if (raw.length < bytes) {
byte[] result = new byte[bytes];
- System.arraycopy(raw,0, result, bytes - raw.length, raw.length);
+ System.arraycopy(raw, 0, result, bytes - raw.length, raw.length);
return result;
}
if (bytes < raw.length) {
@@ -128,14 +128,14 @@ public class ECUtil {
System.arraycopy(data, 1, xbytes, 0, len);
byte[] ybytes = new byte[len];
System.arraycopy(data, 1 + len, ybytes, 0, len);
- return new ECPoint(new BigInteger(xbytes), new BigInteger(ybytes));
+ return new ECPoint(new BigInteger(1, xbytes), new BigInteger(1, ybytes));
} else if (data[0] == 0x02 || data[0] == 0x03) {
if (curve == null) {
throw new IllegalArgumentException();
}
byte[] xbytes = new byte[data.length - 1];
System.arraycopy(data, 1, xbytes, 0, data.length - 1);
- BigInteger x = new BigInteger(xbytes);
+ BigInteger x = new BigInteger(1, xbytes);
BigInteger a = curve.getA();
BigInteger b = curve.getB();
diff --git a/src/cz/crcs/ectester/standalone/libs/jni/NativeECPrivateKey.java b/src/cz/crcs/ectester/standalone/libs/jni/NativeECPrivateKey.java
index 359b6b0..6f6cde3 100644
--- a/src/cz/crcs/ectester/standalone/libs/jni/NativeECPrivateKey.java
+++ b/src/cz/crcs/ectester/standalone/libs/jni/NativeECPrivateKey.java
@@ -40,7 +40,7 @@ public abstract class NativeECPrivateKey implements ECPrivateKey {
@Override
public BigInteger getS() {
- return new BigInteger(keyData);
+ return new BigInteger(1, keyData);
}
@Override