diff options
Diffstat (limited to 'accounts/keystore')
-rw-r--r-- | accounts/keystore/key.go | 8 | ||||
-rw-r--r-- | accounts/keystore/keystore_passphrase.go | 4 |
2 files changed, 2 insertions, 10 deletions
diff --git a/accounts/keystore/key.go b/accounts/keystore/key.go index ecc955d74..211fa863d 100644 --- a/accounts/keystore/key.go +++ b/accounts/keystore/key.go @@ -91,14 +91,6 @@ type cipherparamsJSON struct { IV string `json:"iv"` } -type scryptParamsJSON struct { - N int `json:"n"` - R int `json:"r"` - P int `json:"p"` - DkLen int `json:"dklen"` - Salt string `json:"salt"` -} - func (k *Key) MarshalJSON() (j []byte, err error) { jStruct := plainKeyJSON{ hex.EncodeToString(k.Address[:]), diff --git a/accounts/keystore/keystore_passphrase.go b/accounts/keystore/keystore_passphrase.go index 679fc15d6..535608a60 100644 --- a/accounts/keystore/keystore_passphrase.go +++ b/accounts/keystore/keystore_passphrase.go @@ -140,7 +140,7 @@ func EncryptKey(key *Key, auth string, scryptN, scryptP int) ([]byte, error) { Cipher: "aes-128-ctr", CipherText: hex.EncodeToString(cipherText), CipherParams: cipherParamsJSON, - KDF: "scrypt", + KDF: keyHeaderKDF, KDFParams: scryptParamsJSON, MAC: hex.EncodeToString(mac), } @@ -275,7 +275,7 @@ func getKDFKey(cryptoJSON cryptoJSON, auth string) ([]byte, error) { } dkLen := ensureInt(cryptoJSON.KDFParams["dklen"]) - if cryptoJSON.KDF == "scrypt" { + if cryptoJSON.KDF == keyHeaderKDF { n := ensureInt(cryptoJSON.KDFParams["n"]) r := ensureInt(cryptoJSON.KDFParams["r"]) p := ensureInt(cryptoJSON.KDFParams["p"]) |