|
|
@ -140,7 +140,7 @@ func EncryptKey(key *Key, auth string, scryptN, scryptP int) ([]byte, error) { |
|
|
|
Cipher: "aes-128-ctr", |
|
|
|
Cipher: "aes-128-ctr", |
|
|
|
CipherText: hex.EncodeToString(cipherText), |
|
|
|
CipherText: hex.EncodeToString(cipherText), |
|
|
|
CipherParams: cipherParamsJSON, |
|
|
|
CipherParams: cipherParamsJSON, |
|
|
|
KDF: "scrypt", |
|
|
|
KDF: keyHeaderKDF, |
|
|
|
KDFParams: scryptParamsJSON, |
|
|
|
KDFParams: scryptParamsJSON, |
|
|
|
MAC: hex.EncodeToString(mac), |
|
|
|
MAC: hex.EncodeToString(mac), |
|
|
|
} |
|
|
|
} |
|
|
@ -275,7 +275,7 @@ func getKDFKey(cryptoJSON cryptoJSON, auth string) ([]byte, error) { |
|
|
|
} |
|
|
|
} |
|
|
|
dkLen := ensureInt(cryptoJSON.KDFParams["dklen"]) |
|
|
|
dkLen := ensureInt(cryptoJSON.KDFParams["dklen"]) |
|
|
|
|
|
|
|
|
|
|
|
if cryptoJSON.KDF == "scrypt" { |
|
|
|
if cryptoJSON.KDF == keyHeaderKDF { |
|
|
|
n := ensureInt(cryptoJSON.KDFParams["n"]) |
|
|
|
n := ensureInt(cryptoJSON.KDFParams["n"]) |
|
|
|
r := ensureInt(cryptoJSON.KDFParams["r"]) |
|
|
|
r := ensureInt(cryptoJSON.KDFParams["r"]) |
|
|
|
p := ensureInt(cryptoJSON.KDFParams["p"]) |
|
|
|
p := ensureInt(cryptoJSON.KDFParams["p"]) |
|
|
|