You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.
Thank you very much for your reply. My code is too old.
This is my local code.
public byte[] toByteArray() {
final byte fixedV = this.v >= 27
? (byte) (this.v - 27)
: this.v;
return ByteUtil.merge(
ByteUtil.bigIntegerToBytes(this.r),
ByteUtil.bigIntegerToBytes(this.s),
new byte[]{fixedV});
}
This is latest code.
public byte[] toByteArray() {
final byte fixedV = this.v >= 27
? (byte) (this.v - 27)
: this.v;
return ByteUtil.merge(
ByteUtil.bigIntegerToBytes(this.r, 32),
ByteUtil.bigIntegerToBytes(this.s, 32),
new byte[]{fixedV});
}
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
@test
public void verifyTest() {
String pri = "87385e10d018f971f66cf2c065663d4aa427286f259f85bb8b2438130f4f1ee7";
String sourceHash = "7d50e029128286afba20cb62cf1b874d76a527a896f3d39167289a9b0446c518";
ECKey ecKey = ECKey.fromPrivate(Hex.decode(pri));
byte[] sign = ecKey.sign(Hex.decode(sourceHash)).toByteArray();
System.out.println(sign.length);
}
The result is always 64 not 65 bytes.
The text was updated successfully, but these errors were encountered: