From 1aba7aed6dba65030e5429713c956921efbb4861 Mon Sep 17 00:00:00 2001 From: Zahary Karadjov Date: Sun, 2 Aug 2020 20:54:48 +0300 Subject: [PATCH] Updated Keystore test vectors --- beacon_chain/spec/keystore.nim | 2 ++ tests/test_keystore.nim | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/beacon_chain/spec/keystore.nim b/beacon_chain/spec/keystore.nim index 9f98005c7..175f3d962 100644 --- a/beacon_chain/spec/keystore.nim +++ b/beacon_chain/spec/keystore.nim @@ -491,6 +491,7 @@ proc createKeystore*(kdfKind: KdfKind, privKey: ValidatorPrivkey, password = KeystorePass "", path = KeyPath "", + description = "", salt: openarray[byte] = @[], iv: openarray[byte] = @[]): Keystore = let @@ -503,6 +504,7 @@ proc createKeystore*(kdfKind: KdfKind, crypto: cryptoField, pubkey: pubkey, path: path, + description: description, uuid: $uuid, version: 4) diff --git a/tests/test_keystore.nim b/tests/test_keystore.nim index f37a90b4e..9798cff3a 100644 --- a/tests/test_keystore.nim +++ b/tests/test_keystore.nim @@ -45,6 +45,7 @@ const "message": "54ecc8863c0550351eee5720f3be6a5d4a016025aa91cd6436cfec938d6a8d30" } }, + "description": "This is a test keystore that uses scrypt to secure the secret.", "pubkey": "9612d7a727c9d0a22e185a1c768478dfe919cada9266988cb32359c11f2b7b27f4ae4040902382ae2910c15e2b420d07", "path": "m/12381/60/3141592653/589793238", "uuid": "1d85ae20-35c5-4611-98e8-aa14a633906f", @@ -76,6 +77,7 @@ const "message": "a9249e0ca7315836356e4c7440361ff22b9fe71e2e2ed34fc1eb03976924ed48" } }, + "description": "This is a test keystore that uses scrypt to secure the secret.", "pubkey": "9612d7a727c9d0a22e185a1c768478dfe919cada9266988cb32359c11f2b7b27f4ae4040902382ae2910c15e2b420d07", "path": "m/12381/60/0/0", "uuid": "64625def-3331-4eea-ab6f-782f3ed16a83", @@ -87,6 +89,8 @@ const salt = hexToSeqByte("d4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3") iv = hexToSeqByte("264daa3f303d7259501c93d997d84fe6") + description = "This is a test keystore that uses scrypt to secure the secret." + let rng = newRng() @@ -106,6 +110,7 @@ suiteReport "Keystore": let keystore = createKeystore(kdfPbkdf2, rng[], secret, KeystorePass password, salt=salt, iv=iv, + description = description, path = validateKeyPath "m/12381/60/0/0") var encryptJson = parseJson Json.encode(keystore)