diff options
author | Gustav Simonsson <gustav.simonsson@gmail.com> | 2015-02-05 00:06:06 +0800 |
---|---|---|
committer | Gustav Simonsson <gustav.simonsson@gmail.com> | 2015-02-11 05:49:28 +0800 |
commit | 8c056aebe10c8c56f7c25889780b04e00f9ca00b (patch) | |
tree | 9186028c43f33dec61d21924866248da2c559330 /crypto/key_store_test.go | |
parent | e40c1c62ce0c2d9567066d84ea74fd24b424a81a (diff) | |
download | go-tangerine-8c056aebe10c8c56f7c25889780b04e00f9ca00b.tar.gz go-tangerine-8c056aebe10c8c56f7c25889780b04e00f9ca00b.tar.zst go-tangerine-8c056aebe10c8c56f7c25889780b04e00f9ca00b.zip |
Set both key generation and ECDSA nonce to use mixed entropy
* Move random entropy functions to new package randentropy
* Add function to get n bytes entropy where up to first 32
bytes are mixed with OS entropy sources
Diffstat (limited to 'crypto/key_store_test.go')
-rw-r--r-- | crypto/key_store_test.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crypto/key_store_test.go b/crypto/key_store_test.go index 0d229ab65..a136ba992 100644 --- a/crypto/key_store_test.go +++ b/crypto/key_store_test.go @@ -1,7 +1,7 @@ package crypto import ( - crand "crypto/rand" + "github.com/ethereum/go-ethereum/crypto/randentropy" "reflect" "testing" ) @@ -9,7 +9,7 @@ import ( func TestKeyStorePlain(t *testing.T) { ks := NewKeyStorePlain(DefaultDataDir()) pass := "" // not used but required by API - k1, err := ks.GenerateNewKey(crand.Reader, pass) + k1, err := ks.GenerateNewKey(new(randentropy.RandEntropy), pass) if err != nil { t.Fatal(err) } @@ -37,7 +37,7 @@ func TestKeyStorePlain(t *testing.T) { func TestKeyStorePassphrase(t *testing.T) { ks := NewKeyStorePassphrase(DefaultDataDir()) pass := "foo" - k1, err := ks.GenerateNewKey(crand.Reader, pass) + k1, err := ks.GenerateNewKey(new(randentropy.RandEntropy), pass) if err != nil { t.Fatal(err) } @@ -63,7 +63,7 @@ func TestKeyStorePassphrase(t *testing.T) { func TestKeyStorePassphraseDecryptionFail(t *testing.T) { ks := NewKeyStorePassphrase(DefaultDataDir()) pass := "foo" - k1, err := ks.GenerateNewKey(crand.Reader, pass) + k1, err := ks.GenerateNewKey(new(randentropy.RandEntropy), pass) if err != nil { t.Fatal(err) } |