3
0
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:
Andreas Schildbach 2014-12-19 21:02:34 +01:00
parent 17071ce15c
commit e8e13de4d4
2 changed files with 3 additions and 3 deletions

View File

@ -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;

View File

@ -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) {