Skip to content

Instantly share code, notes, and snippets.

View xoriole's full-sized avatar

S. Pan xoriole

  • Delft, The Netherlands
View GitHub Profile
@xoriole
xoriole / Sign.java
Created June 13, 2017 07:22
Web3j Sign.java modified to avoid double hashing when signing to make it compatible with geth version result
package org.web3j.crypto;
import java.math.BigInteger;
import java.security.SignatureException;
import java.util.Arrays;
import org.bouncycastle.asn1.x9.X9ECParameters;
import org.bouncycastle.asn1.x9.X9IntegerConverter;
import org.bouncycastle.crypto.digests.SHA256Digest;
import org.bouncycastle.crypto.ec.CustomNamedCurves;