mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-02-12 02:05:53 +00:00
Restrict access to ECKey.CURVE_PARAMS. The field is almost redundant. Parameters can be fetched from ECKey.CURVE as well.
This commit is contained in:
parent
17071ce15c
commit
e8e13de4d4
@ -112,8 +112,8 @@ public class ECKey implements EncryptableItem, Serializable {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/** The parameters of the secp256k1 curve that Bitcoin uses. */
|
// The parameters of the secp256k1 curve that Bitcoin uses.
|
||||||
public static final X9ECParameters CURVE_PARAMS = CustomNamedCurves.getByName("secp256k1");
|
private static final X9ECParameters CURVE_PARAMS = CustomNamedCurves.getByName("secp256k1");
|
||||||
|
|
||||||
/** The parameters of the secp256k1 curve that Bitcoin uses. */
|
/** The parameters of the secp256k1 curve that Bitcoin uses. */
|
||||||
public static final ECDomainParameters CURVE;
|
public static final ECDomainParameters CURVE;
|
||||||
|
@ -153,7 +153,7 @@ public class BIP38PrivateKey extends VersionedChecksummedBytes {
|
|||||||
BigInteger seedFactor = new BigInteger(1, Sha256Hash.createDouble(seed).getBytes());
|
BigInteger seedFactor = new BigInteger(1, Sha256Hash.createDouble(seed).getBytes());
|
||||||
checkState(passFactor.signum() >= 0);
|
checkState(passFactor.signum() >= 0);
|
||||||
checkState(seedFactor.signum() >= 0);
|
checkState(seedFactor.signum() >= 0);
|
||||||
BigInteger priv = passFactor.multiply(seedFactor).mod(ECKey.CURVE_PARAMS.getN());
|
BigInteger priv = passFactor.multiply(seedFactor).mod(ECKey.CURVE.getN());
|
||||||
|
|
||||||
return ECKey.fromPrivate(priv, compressed);
|
return ECKey.fromPrivate(priv, compressed);
|
||||||
} catch (GeneralSecurityException x) {
|
} catch (GeneralSecurityException x) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user