Skip to content

Commit

Permalink
ECKey.recoverFromSignature: respect the compressed flag again.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikehearn committed May 29, 2014
1 parent d2837e8 commit 4504633
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/main/java/com/google/bitcoin/core/ECKey.java
Original file line number Diff line number Diff line change
Expand Up @@ -869,7 +869,7 @@ public static ECKey recoverFromSignature(int recId, ECDSASignature sig, Sha256Ha
BigInteger srInv = rInv.multiply(sig.s).mod(n);
BigInteger eInvrInv = rInv.multiply(eInv).mod(n);
ECPoint.Fp q = (ECPoint.Fp) ECAlgorithms.sumOfTwoMultiplies(CURVE.getG(), eInvrInv, R, srInv);
return ECKey.fromPublicOnly(q.getEncoded(true));
return ECKey.fromPublicOnly(q.getEncoded(compressed));
}

/** Decompress a compressed public key (x co-ord and low-bit of y-coord). */
Expand Down

0 comments on commit 4504633

Please sign in to comment.