|
|
9b5743 |
Index: go/api/go1.txt
|
|
|
9b5743 |
===================================================================
|
|
|
9b5743 |
--- go.orig/api/go1.txt
|
|
|
9b5743 |
+++ go/api/go1.txt
|
|
|
9b5743 |
@@ -412,7 +412,6 @@ pkg crypto/ecdsa, type PublicKey struct,
|
|
|
4d1d36 |
pkg crypto/ecdsa, type PublicKey struct, embedded elliptic.Curve
|
|
|
4d1d36 |
pkg crypto/elliptic, func GenerateKey(Curve, io.Reader) ([]uint8, *big.Int, *big.Int, error)
|
|
|
4d1d36 |
pkg crypto/elliptic, func Marshal(Curve, *big.Int, *big.Int) []uint8
|
|
|
4d1d36 |
-pkg crypto/elliptic, func P224() Curve
|
|
|
4d1d36 |
pkg crypto/elliptic, func P256() Curve
|
|
|
4d1d36 |
pkg crypto/elliptic, func P384() Curve
|
|
|
4d1d36 |
pkg crypto/elliptic, func P521() Curve
|
|
|
dffe98 |
Index: go/src/crypto/ecdsa/ecdsa_test.go
|
|
|
9b5743 |
===================================================================
|
|
|
dffe98 |
--- go.orig/src/crypto/ecdsa/ecdsa_test.go
|
|
|
dffe98 |
+++ go/src/crypto/ecdsa/ecdsa_test.go
|
|
|
9b5743 |
@@ -33,7 +33,6 @@ func testKeyGeneration(t *testing.T, c e
|
|
|
4d1d36 |
}
|
|
|
4d1d36 |
|
|
|
4d1d36 |
func TestKeyGeneration(t *testing.T) {
|
|
|
4d1d36 |
- testKeyGeneration(t, elliptic.P224(), "p224")
|
|
|
4d1d36 |
if testing.Short() {
|
|
|
4d1d36 |
return
|
|
|
4d1d36 |
}
|
|
|
9b5743 |
@@ -63,7 +62,6 @@ func testSignAndVerify(t *testing.T, c e
|
|
|
4d1d36 |
}
|
|
|
4d1d36 |
|
|
|
4d1d36 |
func TestSignAndVerify(t *testing.T) {
|
|
|
4d1d36 |
- testSignAndVerify(t, elliptic.P224(), "p224")
|
|
|
4d1d36 |
if testing.Short() {
|
|
|
4d1d36 |
return
|
|
|
4d1d36 |
}
|
|
|
9b5743 |
@@ -129,8 +127,6 @@ func TestVectors(t *testing.T) {
|
|
|
4d1d36 |
parts := strings.SplitN(line, ",", 2)
|
|
|
4d1d36 |
|
|
|
4d1d36 |
switch parts[0] {
|
|
|
4d1d36 |
- case "P-224":
|
|
|
4d1d36 |
- pub.Curve = elliptic.P224()
|
|
|
4d1d36 |
case "P-256":
|
|
|
4d1d36 |
pub.Curve = elliptic.P256()
|
|
|
4d1d36 |
case "P-384":
|
|
|
dffe98 |
Index: go/src/crypto/elliptic/bottombits.go
|
|
|
9b5743 |
===================================================================
|
|
|
9b5743 |
--- /dev/null
|
|
|
dffe98 |
+++ go/src/crypto/elliptic/bottombits.go
|
|
|
4d1d36 |
@@ -0,0 +1,14 @@
|
|
|
4d1d36 |
+
|
|
|
4d1d36 |
+// Copyright 2012 The Go Authors. All rights reserved.
|
|
|
4d1d36 |
+// Use of this source code is governed by a BSD-style
|
|
|
4d1d36 |
+// license that can be found in the LICENSE file.
|
|
|
4d1d36 |
+
|
|
|
4d1d36 |
+package elliptic
|
|
|
4d1d36 |
+
|
|
|
4d1d36 |
+const bottom12Bits = 0xfff
|
|
|
4d1d36 |
+const bottom28Bits = 0xfffffff
|
|
|
4d1d36 |
+
|
|
|
4d1d36 |
+const two31p3 = 1<<31 + 1<<3
|
|
|
4d1d36 |
+const two31m3 = 1<<31 - 1<<3
|
|
|
4d1d36 |
+const two31m15m3 = 1<<31 - 1<<15 - 1<<3
|
|
|
4d1d36 |
+
|
|
|
dffe98 |
Index: go/src/crypto/elliptic/elliptic.go
|
|
|
9b5743 |
===================================================================
|
|
|
dffe98 |
--- go.orig/src/crypto/elliptic/elliptic.go
|
|
|
dffe98 |
+++ go/src/crypto/elliptic/elliptic.go
|
|
|
9b5743 |
@@ -326,7 +326,6 @@ var p384 *CurveParams
|
|
|
4d1d36 |
var p521 *CurveParams
|
|
|
4d1d36 |
|
|
|
4d1d36 |
func initAll() {
|
|
|
4d1d36 |
- initP224()
|
|
|
4d1d36 |
initP256()
|
|
|
4d1d36 |
initP384()
|
|
|
4d1d36 |
initP521()
|
|
|
dffe98 |
Index: go/src/crypto/elliptic/elliptic_test.go
|
|
|
9b5743 |
===================================================================
|
|
|
dffe98 |
--- go.orig/src/crypto/elliptic/elliptic_test.go
|
|
|
dffe98 |
+++ go/src/crypto/elliptic/elliptic_test.go
|
|
|
4d1d36 |
@@ -1,3 +1,5 @@
|
|
|
4d1d36 |
+// +build ignore
|
|
|
4d1d36 |
+
|
|
|
4d1d36 |
// Copyright 2010 The Go Authors. All rights reserved.
|
|
|
4d1d36 |
// Use of this source code is governed by a BSD-style
|
|
|
4d1d36 |
// license that can be found in the LICENSE file.
|
|
|
dffe98 |
Index: go/src/crypto/elliptic/p224.go
|
|
|
9b5743 |
===================================================================
|
|
|
dffe98 |
--- go.orig/src/crypto/elliptic/p224.go
|
|
|
dffe98 |
+++ go/src/crypto/elliptic/p224.go
|
|
|
4d1d36 |
@@ -1,3 +1,5 @@
|
|
|
4d1d36 |
+// +build ignore
|
|
|
4d1d36 |
+
|
|
|
4d1d36 |
// Copyright 2012 The Go Authors. All rights reserved.
|
|
|
4d1d36 |
// Use of this source code is governed by a BSD-style
|
|
|
4d1d36 |
// license that can be found in the LICENSE file.
|
|
|
9b5743 |
@@ -183,10 +185,6 @@ func p224Add(out, a, b *p224FieldElement
|
|
|
4d1d36 |
}
|
|
|
4d1d36 |
}
|
|
|
4d1d36 |
|
|
|
4d1d36 |
-const two31p3 = 1<<31 + 1<<3
|
|
|
4d1d36 |
-const two31m3 = 1<<31 - 1<<3
|
|
|
4d1d36 |
-const two31m15m3 = 1<<31 - 1<<15 - 1<<3
|
|
|
4d1d36 |
-
|
|
|
4d1d36 |
// p224ZeroModP31 is 0 mod p where bit 31 is set in all limbs so that we can
|
|
|
4d1d36 |
// subtract smaller amounts without underflow. See the section "Subtraction" in
|
|
|
4d1d36 |
// [1] for reasoning.
|
|
|
9b5743 |
@@ -215,9 +213,6 @@ const two63m35m19 = 1<<63 - 1<<35 - 1<<1
|
|
|
4d1d36 |
// "Subtraction" in [1] for why.
|
|
|
4d1d36 |
var p224ZeroModP63 = [8]uint64{two63p35, two63m35, two63m35, two63m35, two63m35m19, two63m35, two63m35, two63m35}
|
|
|
4d1d36 |
|
|
|
4d1d36 |
-const bottom12Bits = 0xfff
|
|
|
4d1d36 |
-const bottom28Bits = 0xfffffff
|
|
|
4d1d36 |
-
|
|
|
4d1d36 |
// p224Mul computes *out = a*b
|
|
|
4d1d36 |
//
|
|
|
4d1d36 |
// a[i] < 2**29, b[i] < 2**30 (or vice versa)
|
|
|
dffe98 |
Index: go/src/crypto/elliptic/p224_test.go
|
|
|
9b5743 |
===================================================================
|
|
|
dffe98 |
--- go.orig/src/crypto/elliptic/p224_test.go
|
|
|
dffe98 |
+++ go/src/crypto/elliptic/p224_test.go
|
|
|
4d1d36 |
@@ -1,3 +1,5 @@
|
|
|
4d1d36 |
+// +build ignore
|
|
|
4d1d36 |
+
|
|
|
4d1d36 |
// Copyright 2012 The Go Authors. All rights reserved.
|
|
|
4d1d36 |
// Use of this source code is governed by a BSD-style
|
|
|
4d1d36 |
// license that can be found in the LICENSE file.
|
|
|
dffe98 |
Index: go/src/crypto/x509/x509.go
|
|
|
9b5743 |
===================================================================
|
|
|
dffe98 |
--- go.orig/src/crypto/x509/x509.go
|
|
|
dffe98 |
+++ go/src/crypto/x509/x509.go
|
|
|
9b5743 |
@@ -306,9 +306,6 @@ func getPublicKeyAlgorithmFromOID(oid as
|
|
|
4d1d36 |
|
|
|
4d1d36 |
// RFC 5480, 2.1.1.1. Named Curve
|
|
|
4d1d36 |
//
|
|
|
4d1d36 |
-// secp224r1 OBJECT IDENTIFIER ::= {
|
|
|
4d1d36 |
-// iso(1) identified-organization(3) certicom(132) curve(0) 33 }
|
|
|
4d1d36 |
-//
|
|
|
4d1d36 |
// secp256r1 OBJECT IDENTIFIER ::= {
|
|
|
4d1d36 |
// iso(1) member-body(2) us(840) ansi-X9-62(10045) curves(3)
|
|
|
4d1d36 |
// prime(1) 7 }
|
|
|
9b5743 |
@@ -321,7 +318,6 @@ func getPublicKeyAlgorithmFromOID(oid as
|
|
|
4d1d36 |
//
|
|
|
4d1d36 |
// NB: secp256r1 is equivalent to prime256v1
|
|
|
4d1d36 |
var (
|
|
|
4d1d36 |
- oidNamedCurveP224 = asn1.ObjectIdentifier{1, 3, 132, 0, 33}
|
|
|
4d1d36 |
oidNamedCurveP256 = asn1.ObjectIdentifier{1, 2, 840, 10045, 3, 1, 7}
|
|
|
4d1d36 |
oidNamedCurveP384 = asn1.ObjectIdentifier{1, 3, 132, 0, 34}
|
|
|
4d1d36 |
oidNamedCurveP521 = asn1.ObjectIdentifier{1, 3, 132, 0, 35}
|
|
|
9b5743 |
@@ -329,8 +325,6 @@ var (
|
|
|
4d1d36 |
|
|
|
4d1d36 |
func namedCurveFromOID(oid asn1.ObjectIdentifier) elliptic.Curve {
|
|
|
4d1d36 |
switch {
|
|
|
4d1d36 |
- case oid.Equal(oidNamedCurveP224):
|
|
|
4d1d36 |
- return elliptic.P224()
|
|
|
4d1d36 |
case oid.Equal(oidNamedCurveP256):
|
|
|
4d1d36 |
return elliptic.P256()
|
|
|
4d1d36 |
case oid.Equal(oidNamedCurveP384):
|
|
|
9b5743 |
@@ -343,8 +337,6 @@ func namedCurveFromOID(oid asn1.ObjectId
|
|
|
4d1d36 |
|
|
|
4d1d36 |
func oidFromNamedCurve(curve elliptic.Curve) (asn1.ObjectIdentifier, bool) {
|
|
|
4d1d36 |
switch curve {
|
|
|
4d1d36 |
- case elliptic.P224():
|
|
|
4d1d36 |
- return oidNamedCurveP224, true
|
|
|
4d1d36 |
case elliptic.P256():
|
|
|
4d1d36 |
return oidNamedCurveP256, true
|
|
|
4d1d36 |
case elliptic.P384():
|
|
|
9b5743 |
@@ -1371,7 +1363,7 @@ func signingParamsForPrivateKey(priv int
|
|
|
9b5743 |
pubType = ECDSA
|
|
|
9b5743 |
|
|
|
4d1d36 |
switch priv.Curve {
|
|
|
4d1d36 |
- case elliptic.P224(), elliptic.P256():
|
|
|
4d1d36 |
+ case elliptic.P256():
|
|
|
4d1d36 |
hashFunc = crypto.SHA256
|
|
|
9b5743 |
sigAlgo.Algorithm = oidSignatureECDSAWithSHA256
|
|
|
4d1d36 |
case elliptic.P384():
|