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
edbd902a
Commit
edbd902a
authored
Jun 03, 2015
by
Gustav Simonsson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Initialise curve N value in package init
parent
32e1b104
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
crypto.go
crypto/crypto.go
+3
-1
No files found.
crypto/crypto.go
View file @
edbd902a
...
@@ -27,9 +27,12 @@ import (
...
@@ -27,9 +27,12 @@ import (
"golang.org/x/crypto/ripemd160"
"golang.org/x/crypto/ripemd160"
)
)
var
secp256k1n
*
big
.
Int
func
init
()
{
func
init
()
{
// specify the params for the s256 curve
// specify the params for the s256 curve
ecies
.
AddParamsForCurve
(
S256
(),
ecies
.
ECIES_AES128_SHA256
)
ecies
.
AddParamsForCurve
(
S256
(),
ecies
.
ECIES_AES128_SHA256
)
secp256k1n
=
common
.
String2Big
(
"0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"
)
}
}
func
Sha3
(
data
...
[]
byte
)
[]
byte
{
func
Sha3
(
data
...
[]
byte
)
[]
byte
{
...
@@ -153,7 +156,6 @@ func GenerateKey() (*ecdsa.PrivateKey, error) {
...
@@ -153,7 +156,6 @@ func GenerateKey() (*ecdsa.PrivateKey, error) {
}
}
func
ValidateSignatureValues
(
v
byte
,
r
,
s
*
big
.
Int
)
bool
{
func
ValidateSignatureValues
(
v
byte
,
r
,
s
*
big
.
Int
)
bool
{
secp256k1n
:=
common
.
String2Big
(
"0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"
)
vint
:=
uint32
(
v
)
vint
:=
uint32
(
v
)
if
r
.
Cmp
(
common
.
Big0
)
==
0
||
s
.
Cmp
(
common
.
Big0
)
==
0
{
if
r
.
Cmp
(
common
.
Big0
)
==
0
||
s
.
Cmp
(
common
.
Big0
)
==
0
{
return
false
return
false
...
...
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