-
Notifications
You must be signed in to change notification settings - Fork 5
/
keypairoomClient-8-9-10-11-12.zen
139 lines (109 loc) · 5.46 KB
/
keypairoomClient-8-9-10-11-12.zen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# SPDX-License-Identifier: AGPL-3.0-or-later
# Copyright (C) 2022-2023 Dyne.org foundation <[email protected]>.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
Scenario 'ecdh': Create the key
Scenario 'ethereum': Create key
Scenario 'reflow': Create the key
Scenario 'eddsa': Create the key
Scenario 'es256': Create the key
# Loading the user name from data
Given my name is in a 'string' named 'username'
# Loading the answers from 3 secret questions. The user will have to pick the 3 challenges from a list
# and have to remember the questions - the order is not important cause Zenroom will sort alphabetically
# the data in input
#
# NOTE: the challenges will never be communicated to the server or to anybody else!
Given I have a 'string dictionary' named 'userChallenges'
# Loading the individual challenges, in order to have them hashed
# and the hashes OPTIONALLY stored by the server, to improve regeneration of the keypair
Given I have a 'string' named 'whereParentsMet' in 'userChallenges'
Given I have a 'string' named 'nameFirstPet' in 'userChallenges'
Given I have a 'string' named 'whereHomeTown' in 'userChallenges'
Given I have a 'string' named 'nameFirstTeacher' in 'userChallenges'
Given I have a 'string' named 'nameMotherMaid' in 'userChallenges'
# Loading the pbkdf received from the server, containing a signed hash of known data
Given that I have a 'base64' named 'seedServerSideShard.HMAC'
# Save the backup for mnemonic dump, before factoring with the salt
# it is shortened to 16 bytes by hashing sha512 the KDF and taking the first 16 bytes
When I create the key derivation of 'userChallenges'
and I create the hash of 'key derivation' using 'sha512'
and I split the leftmost '16' bytes of 'hash'
and I delete the 'key derivation'
and I delete the 'hash'
and I rename the 'leftmost' to 'seed'
# Hash again the user's challenges with salt for the seed root
When I rename 'seedServerSideShard.HMAC' to 'salt'
and I create the key derivation of 'seed' with password 'salt'
and I rename the 'key derivation' to 'seed.root'
# In the following flow the order should NOT be changed
When I create the hash of 'seed.root'
When I rename the 'hash' to 'seed.ecdh'
When I create the hash of 'seed.ecdh'
When I rename the 'hash' to 'seed.eddsa'
When I create the hash of 'seed.eddsa'
When I rename the 'hash' to 'seed.ethereum'
When I create the hash of 'seed.ethereum'
When I rename the 'hash' to 'seed.reflow'
When I create the hash of 'seed.reflow'
When I rename the 'hash' to 'seed.bitcoin'
When I create the hash of 'seed.bitcoin'
When I rename the 'hash' to 'seed.es256'
# end of the sorted creation flow
When I create the ecdh key with secret key 'seed.ecdh'
When I create the eddsa key with secret key 'seed.eddsa'
When I create the ethereum key with secret key 'seed.ethereum'
When I create the reflow key with secret key 'seed.reflow'
When I create the bitcoin key with secret key 'seed.bitcoin'
When I create the es256 key with secret key 'seed.es256'
# Here we create the "credential" key (used to request a Coconut zkp credential)
# from the reflow key, cause they both are BL381 keys the credential sk doesn't have a pk
When I pickup from path 'keyring.reflow'
When I create credential key with secret 'reflow'
When I create the ecdh public key
When I create the eddsa public key
When I create the ethereum address
When I create the reflow public key
When I create the bitcoin public key
When I create the es256 public key
# Creating the hashes of the single challenges, to OPTIONALLY help
# regeneration of the keypair
# When I create the 'base64 dictionary'
# and I rename the 'base64 dictionary' to 'hashedAnswers'
# When I create the key derivation of 'whereParentsMet'
# and I rename the 'key derivation' to 'whereParentsMet.kdf'
# When I move 'whereParentsMet.kdf' in 'hashedAnswers'
# When I create the key derivation of 'nameFirstPet'
# and I rename the 'key derivation' to 'nameFirstPet.kdf'
# When I move 'nameFirstPet.kdf' in 'hashedAnswers'
# When I create the key derivation of 'whereHomeTown'
# and I rename the 'key derivation' to 'whereHomeTown.kdf'
# When I move 'whereHomeTown.kdf' in 'hashedAnswers'
# When I create the key derivation of 'nameFirstTeacher'
# and I rename the 'key derivation' to 'nameFirstTeacher.kdf'
# When I move 'nameFirstTeacher.kdf' in 'hashedAnswers'
# When I create the key derivation of 'nameMotherMaid'
# and I rename the 'key derivation' to 'nameMotherMaid.kdf'
# When I move 'nameMotherMaid.kdf' in 'hashedAnswers'
# this prints the hashes of the challenges
# Then print the 'hashedAnswers'
Then print the 'keyring'
# This prints the seed for the private keys as mnemonic
Then print the 'seed' as 'mnemonic'
Then print the 'ecdh public key' as 'base58'
Then print the 'eddsa public key' as 'base58'
Then print the 'ethereum address'
Then print the 'reflow public key' as 'base58'
Then print the 'bitcoin public key' as 'base58'
Then print the 'es256 public key' as 'base58'