Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
1c4c486a
Unverified
Commit
1c4c486a
authored
Feb 17, 2020
by
Felix Lange
Committed by
GitHub
Feb 17, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd/ethkey: speed up test by using weaker scrypt parameters (#20680)
parent
ac727877
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
2 deletions
+10
-2
generate.go
cmd/ethkey/generate.go
+9
-1
message_test.go
cmd/ethkey/message_test.go
+1
-1
No files found.
cmd/ethkey/generate.go
View file @
1c4c486a
...
...
@@ -52,6 +52,10 @@ If you want to encrypt an existing private key, it can be specified by setting
Name
:
"privatekey"
,
Usage
:
"file containing a raw private key to encrypt"
,
},
cli
.
BoolFlag
{
Name
:
"lightkdf"
,
Usage
:
"use less secure scrypt parameters"
,
},
},
Action
:
func
(
ctx
*
cli
.
Context
)
error
{
// Check if keyfile path given and make sure it doesn't already exist.
...
...
@@ -91,7 +95,11 @@ If you want to encrypt an existing private key, it can be specified by setting
// Encrypt key with passphrase.
passphrase
:=
promptPassphrase
(
true
)
keyjson
,
err
:=
keystore
.
EncryptKey
(
key
,
passphrase
,
keystore
.
StandardScryptN
,
keystore
.
StandardScryptP
)
scryptN
,
scryptP
:=
keystore
.
StandardScryptN
,
keystore
.
StandardScryptP
if
ctx
.
Bool
(
"lightkdf"
)
{
scryptN
,
scryptP
=
keystore
.
LightScryptN
,
keystore
.
LightScryptP
}
keyjson
,
err
:=
keystore
.
EncryptKey
(
key
,
passphrase
,
scryptN
,
scryptP
)
if
err
!=
nil
{
utils
.
Fatalf
(
"Error encrypting key: %v"
,
err
)
}
...
...
cmd/ethkey/message_test.go
View file @
1c4c486a
...
...
@@ -34,7 +34,7 @@ func TestMessageSignVerify(t *testing.T) {
message
:=
"test message"
// Create the key.
generate
:=
runEthkey
(
t
,
"generate"
,
keyfile
)
generate
:=
runEthkey
(
t
,
"generate"
,
"--lightkdf"
,
keyfile
)
generate
.
Expect
(
`
!! Unsupported terminal, password will be echoed.
Password: {{.InputLine "foobar"}}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment