diff --git a/crypto/secp256k1/secp256.go b/crypto/secp256k1/secp256.go index 53ad9b477f..c01598b842 100644 --- a/crypto/secp256k1/secp256.go +++ b/crypto/secp256k1/secp256.go @@ -124,11 +124,7 @@ int secp256k1_ecdsa_sign_compact(const unsigned char *msg, int msglen, */ func Sign(msg []byte, seckey []byte) ([]byte, error) { - //var nonce []byte = RandByte(32) - nonce := make([]byte, 32) - for i := range msg { - nonce[i] = msg[i] ^ seckey[i] - } + nonce := RandByte(32) var sig []byte = make([]byte, 65) var recid C.int diff --git a/crypto/secp256k1/secp256_rand.go b/crypto/secp256k1/secp256_rand.go index 5e8035e0fd..027b5f3869 100644 --- a/crypto/secp256k1/secp256_rand.go +++ b/crypto/secp256k1/secp256_rand.go @@ -75,7 +75,7 @@ func RandByte(n int) []byte { return nil } - buff2 := RandByteWeakCrypto(n) + buff2 := saltByte(n) for i := 0; i < n; i++ { buff[i] ^= buff2[2] }