diff options
author | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-07-30 18:59:25 +0800 |
---|---|---|
committer | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-07-30 18:59:25 +0800 |
commit | 4231de391402558189ff7de77da6f3083217b7c9 (patch) | |
tree | 6e2165a43dd30e0bef3bff9bd977356d22e423b4 | |
parent | 64e2f52c2ef40d6f599ea4becda3dd355ed02372 (diff) | |
parent | 3f07afbbd21a0458830461f06d818aa1f9fa51fe (diff) | |
download | dexon-4231de391402558189ff7de77da6f3083217b7c9.tar dexon-4231de391402558189ff7de77da6f3083217b7c9.tar.gz dexon-4231de391402558189ff7de77da6f3083217b7c9.tar.bz2 dexon-4231de391402558189ff7de77da6f3083217b7c9.tar.lz dexon-4231de391402558189ff7de77da6f3083217b7c9.tar.xz dexon-4231de391402558189ff7de77da6f3083217b7c9.tar.zst dexon-4231de391402558189ff7de77da6f3083217b7c9.zip |
Merge pull request #1553 from prusnak/develop
remove elliptic.P224 usage
-rw-r--r-- | crypto/ecies/asn1.go | 10 | ||||
-rw-r--r-- | crypto/ecies/ecies_test.go | 5 |
2 files changed, 1 insertions, 14 deletions
diff --git a/crypto/ecies/asn1.go b/crypto/ecies/asn1.go index 0a478e435..6eaf3d2ca 100644 --- a/crypto/ecies/asn1.go +++ b/crypto/ecies/asn1.go @@ -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.P224(), elliptic.P256(), elliptic.P384(), elliptic.P521(): + case elliptic.P256(), elliptic.P384(), elliptic.P521(): raw := rawCurve(curve) return asn1.RawValue{ Tag: 30, diff --git a/crypto/ecies/ecies_test.go b/crypto/ecies/ecies_test.go index 762124954..1c391f938 100644 --- a/crypto/ecies/ecies_test.go +++ b/crypto/ecies/ecies_test.go @@ -408,11 +408,6 @@ type testCase struct { var testCases = []testCase{ testCase{ - Curve: elliptic.P224(), - Name: "P224", - Expected: false, - }, - testCase{ Curve: elliptic.P256(), Name: "P256", Expected: true, |