aboutsummaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-02-01 00:44:42 +0800
committerobscuren <geffobscura@gmail.com>2015-02-01 00:44:42 +0800
commitbb2e847363146be29b8519ec8c25d089cb5841aa (patch)
tree8ebc2458c5a0147255d40af50fa2595fc65a5d8e /crypto
parent9016ce8dd8c7460799329ec4eb2b51f4ff3d9291 (diff)
parenta008c21cf0a0f458ef112b99048b459618dd0cdc (diff)
downloaddexon-bb2e847363146be29b8519ec8c25d089cb5841aa.tar
dexon-bb2e847363146be29b8519ec8c25d089cb5841aa.tar.gz
dexon-bb2e847363146be29b8519ec8c25d089cb5841aa.tar.bz2
dexon-bb2e847363146be29b8519ec8c25d089cb5841aa.tar.lz
dexon-bb2e847363146be29b8519ec8c25d089cb5841aa.tar.xz
dexon-bb2e847363146be29b8519ec8c25d089cb5841aa.tar.zst
dexon-bb2e847363146be29b8519ec8c25d089cb5841aa.zip
Merge branch 'bounty' into develop
Diffstat (limited to 'crypto')
-rw-r--r--crypto/secp256k1/secp256.go6
-rw-r--r--crypto/secp256k1/secp256_rand.go2
2 files changed, 2 insertions, 6 deletions
diff --git a/crypto/secp256k1/secp256.go b/crypto/secp256k1/secp256.go
index 53ad9b477..c01598b84 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 5e8035e0f..027b5f386 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]
}