mirror of
https://github.com/sparrowwallet/drongo.git
synced 2024-11-02 18:26:43 +00:00
Modify group value test
This commit is contained in:
parent
22e70fd8e5
commit
46c4b33206
1 changed files with 2 additions and 2 deletions
|
@ -71,7 +71,7 @@ public class PaymentAddress {
|
||||||
private BigInteger addSecp256k1(BigInteger b1, BigInteger b2) {
|
private BigInteger addSecp256k1(BigInteger b1, BigInteger b2) {
|
||||||
BigInteger ret = b1.add(b2);
|
BigInteger ret = b1.add(b2);
|
||||||
|
|
||||||
if(ret.bitLength() > CURVE.getN().bitLength()) {
|
if(ret.compareTo(CURVE.getN()) > 0) {
|
||||||
return ret.mod(CURVE.getN());
|
return ret.mod(CURVE.getN());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ public class PaymentAddress {
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isSecp256k1(BigInteger b) {
|
private boolean isSecp256k1(BigInteger b) {
|
||||||
return b.compareTo(BigInteger.ONE) > 0 && b.bitLength() <= CURVE.getN().bitLength();
|
return (b.compareTo(BigInteger.ONE) > 0) && (b.compareTo(CURVE.getN()) < 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
private BigInteger secretPoint() throws InvalidKeyException, NoSuchAlgorithmException, NoSuchProviderException, InvalidKeySpecException, NotSecp256k1Exception {
|
private BigInteger secretPoint() throws InvalidKeyException, NoSuchAlgorithmException, NoSuchProviderException, InvalidKeySpecException, NotSecp256k1Exception {
|
||||||
|
|
Loading…
Reference in a new issue