mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2025-02-26 07:23:53 +01:00
More static analysis tweaks.
This commit is contained in:
parent
000d81d54f
commit
98219bdd1b
1 changed files with 3 additions and 2 deletions
|
@ -114,8 +114,9 @@ public final class HDKeyDerivation {
|
|||
BigInteger ilInt = HDUtils.toBigInteger(il);
|
||||
assertLessThanN(ilInt, "Illegal derived key: I_L >= n");
|
||||
byte[] keyBytes;
|
||||
if (parent.hasPrivate()) {
|
||||
BigInteger ki = parent.getPrivAsFieldElement().add(ilInt).mod(HDUtils.getEcParams().getN());
|
||||
final BigInteger privAsFieldElement = parent.getPrivAsFieldElement();
|
||||
if (privAsFieldElement != null) {
|
||||
BigInteger ki = privAsFieldElement.add(ilInt).mod(HDUtils.getEcParams().getN());
|
||||
assertNonZero(ki, "Illegal derived key: derived private key equals 0.");
|
||||
keyBytes = ki.toByteArray();
|
||||
} else {
|
||||
|
|
Loading…
Add table
Reference in a new issue