diff options
Diffstat (limited to 'accounts/keystore')
-rw-r--r-- | accounts/keystore/keystore_passphrase.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/accounts/keystore/keystore_passphrase.go b/accounts/keystore/keystore_passphrase.go index 8ef510fcf..2eae25841 100644 --- a/accounts/keystore/keystore_passphrase.go +++ b/accounts/keystore/keystore_passphrase.go @@ -36,6 +36,7 @@ import ( "path/filepath" "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/math" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/crypto/randentropy" "github.com/pborman/uuid" @@ -115,8 +116,7 @@ func EncryptKey(key *Key, auth string, scryptN, scryptP int) ([]byte, error) { return nil, err } encryptKey := derivedKey[:16] - keyBytes0 := crypto.FromECDSA(key.PrivateKey) - keyBytes := common.LeftPadBytes(keyBytes0, 32) + keyBytes := math.PaddedBigBytes(key.PrivateKey.D, 32) iv := randentropy.GetEntropyCSPRNG(aes.BlockSize) // 16 cipherText, err := aesCTRXOR(encryptKey, keyBytes, iv) |