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
4231de39
Commit
4231de39
authored
Jul 30, 2015
by
Jeffrey Wilcke
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1553 from prusnak/develop
remove elliptic.P224 usage
parents
64e2f52c
3f07afbb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
14 deletions
+1
-14
asn1.go
crypto/ecies/asn1.go
+1
-9
ecies_test.go
crypto/ecies/ecies_test.go
+0
-5
No files found.
crypto/ecies/asn1.go
View file @
4231de39
...
...
@@ -81,11 +81,9 @@ func doScheme(base, v []int) asn1.ObjectIdentifier {
type
secgNamedCurve
asn1
.
ObjectIdentifier
var
(
secgNamedCurveP224
=
secgNamedCurve
{
1
,
3
,
132
,
0
,
33
}
secgNamedCurveP256
=
secgNamedCurve
{
1
,
2
,
840
,
10045
,
3
,
1
,
7
}
secgNamedCurveP384
=
secgNamedCurve
{
1
,
3
,
132
,
0
,
34
}
secgNamedCurveP521
=
secgNamedCurve
{
1
,
3
,
132
,
0
,
35
}
rawCurveP224
=
[]
byte
{
6
,
5
,
4
,
3
,
1
,
2
,
9
,
4
,
0
,
3
,
3
}
rawCurveP256
=
[]
byte
{
6
,
8
,
4
,
2
,
1
,
3
,
4
,
7
,
2
,
2
,
0
,
6
,
6
,
1
,
3
,
1
,
7
}
rawCurveP384
=
[]
byte
{
6
,
5
,
4
,
3
,
1
,
2
,
9
,
4
,
0
,
3
,
4
}
rawCurveP521
=
[]
byte
{
6
,
5
,
4
,
3
,
1
,
2
,
9
,
4
,
0
,
3
,
5
}
...
...
@@ -93,8 +91,6 @@ var (
func
rawCurve
(
curve
elliptic
.
Curve
)
[]
byte
{
switch
curve
{
case
elliptic
.
P224
()
:
return
rawCurveP224
case
elliptic
.
P256
()
:
return
rawCurveP256
case
elliptic
.
P384
()
:
...
...
@@ -120,8 +116,6 @@ func (curve secgNamedCurve) Equal(curve2 secgNamedCurve) bool {
func
namedCurveFromOID
(
curve
secgNamedCurve
)
elliptic
.
Curve
{
switch
{
case
curve
.
Equal
(
secgNamedCurveP224
)
:
return
elliptic
.
P224
()
case
curve
.
Equal
(
secgNamedCurveP256
)
:
return
elliptic
.
P256
()
case
curve
.
Equal
(
secgNamedCurveP384
)
:
...
...
@@ -134,8 +128,6 @@ func namedCurveFromOID(curve secgNamedCurve) elliptic.Curve {
func
oidFromNamedCurve
(
curve
elliptic
.
Curve
)
(
secgNamedCurve
,
bool
)
{
switch
curve
{
case
elliptic
.
P224
()
:
return
secgNamedCurveP224
,
true
case
elliptic
.
P256
()
:
return
secgNamedCurveP256
,
true
case
elliptic
.
P384
()
:
...
...
@@ -248,7 +240,7 @@ var idEcPublicKeySupplemented = doScheme(idPublicKeyType, []int{0})
func
curveToRaw
(
curve
elliptic
.
Curve
)
(
rv
asn1
.
RawValue
,
ok
bool
)
{
switch
curve
{
case
elliptic
.
P2
24
(),
elliptic
.
P2
56
(),
elliptic
.
P384
(),
elliptic
.
P521
()
:
case
elliptic
.
P256
(),
elliptic
.
P384
(),
elliptic
.
P521
()
:
raw
:=
rawCurve
(
curve
)
return
asn1
.
RawValue
{
Tag
:
30
,
...
...
crypto/ecies/ecies_test.go
View file @
4231de39
...
...
@@ -407,11 +407,6 @@ type testCase struct {
}
var
testCases
=
[]
testCase
{
testCase
{
Curve
:
elliptic
.
P224
(),
Name
:
"P224"
,
Expected
:
false
,
},
testCase
{
Curve
:
elliptic
.
P256
(),
Name
:
"P256"
,
...
...
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