nim / rpms / golang

Forked from rpms/golang 5 years ago
Clone

Blame golang-1.2-remove-ECC-p224.patch

Vincent Batts 5152b3a
diff -r 87dea3f5ebe7 api/go1.txt
Vincent Batts 5152b3a
--- a/api/go1.txt	Fri Nov 29 08:32:31 2013 +1100
Vincent Batts 5152b3a
+++ b/api/go1.txt	Fri Dec 06 13:31:29 2013 -0500
Vincent Batts 5152b3a
@@ -412,7 +412,6 @@
Vincent Batts 5152b3a
 pkg crypto/ecdsa, type PublicKey struct, embedded elliptic.Curve
Vincent Batts 5152b3a
 pkg crypto/elliptic, func GenerateKey(Curve, io.Reader) ([]uint8, *big.Int, *big.Int, error)
Vincent Batts 5152b3a
 pkg crypto/elliptic, func Marshal(Curve, *big.Int, *big.Int) []uint8
Vincent Batts 5152b3a
-pkg crypto/elliptic, func P224() Curve
Vincent Batts 5152b3a
 pkg crypto/elliptic, func P256() Curve
Vincent Batts 5152b3a
 pkg crypto/elliptic, func P384() Curve
Vincent Batts 5152b3a
 pkg crypto/elliptic, func P521() Curve
Vincent Batts 5152b3a
diff -r 87dea3f5ebe7 src/pkg/crypto/ecdsa/ecdsa_test.go
Vincent Batts 5152b3a
--- a/src/pkg/crypto/ecdsa/ecdsa_test.go	Fri Nov 29 08:32:31 2013 +1100
Vincent Batts 5152b3a
+++ b/src/pkg/crypto/ecdsa/ecdsa_test.go	Fri Dec 06 13:31:29 2013 -0500
Vincent Batts 5152b3a
@@ -33,7 +33,6 @@
Vincent Batts 5152b3a
 }
Vincent Batts 5152b3a
 
Vincent Batts 5152b3a
 func TestKeyGeneration(t *testing.T) {
Vincent Batts 5152b3a
-	testKeyGeneration(t, elliptic.P224(), "p224")
Vincent Batts 5152b3a
 	if testing.Short() {
Vincent Batts 5152b3a
 		return
Vincent Batts 5152b3a
 	}
Vincent Batts 5152b3a
@@ -63,7 +62,6 @@
Vincent Batts 5152b3a
 }
Vincent Batts 5152b3a
 
Vincent Batts 5152b3a
 func TestSignAndVerify(t *testing.T) {
Vincent Batts 5152b3a
-	testSignAndVerify(t, elliptic.P224(), "p224")
Vincent Batts 5152b3a
 	if testing.Short() {
Vincent Batts 5152b3a
 		return
Vincent Batts 5152b3a
 	}
Vincent Batts 5152b3a
@@ -129,8 +127,6 @@
Vincent Batts 5152b3a
 			parts := strings.SplitN(line, ",", 2)
Vincent Batts 5152b3a
 
Vincent Batts 5152b3a
 			switch parts[0] {
Vincent Batts 5152b3a
-			case "P-224":
Vincent Batts 5152b3a
-				pub.Curve = elliptic.P224()
Vincent Batts 5152b3a
 			case "P-256":
Vincent Batts 5152b3a
 				pub.Curve = elliptic.P256()
Vincent Batts 5152b3a
 			case "P-384":
Vincent Batts 5152b3a
diff -r 87dea3f5ebe7 src/pkg/crypto/elliptic/bottombits.go
Vincent Batts 5152b3a
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
Vincent Batts 5152b3a
+++ b/src/pkg/crypto/elliptic/bottombits.go	Fri Dec 06 13:31:29 2013 -0500
Vincent Batts 5152b3a
@@ -0,0 +1,14 @@
Vincent Batts 5152b3a
+
Vincent Batts 5152b3a
+// Copyright 2012 The Go Authors.  All rights reserved.
Vincent Batts 5152b3a
+// Use of this source code is governed by a BSD-style
Vincent Batts 5152b3a
+// license that can be found in the LICENSE file.
Vincent Batts 5152b3a
+
Vincent Batts 5152b3a
+package elliptic
Vincent Batts 5152b3a
+
Vincent Batts 5152b3a
+const bottom12Bits = 0xfff
Vincent Batts 5152b3a
+const bottom28Bits = 0xfffffff
Vincent Batts 5152b3a
+
Vincent Batts 5152b3a
+const two31p3 = 1<<31 + 1<<3
Vincent Batts 5152b3a
+const two31m3 = 1<<31 - 1<<3
Vincent Batts 5152b3a
+const two31m15m3 = 1<<31 - 1<<15 - 1<<3
Vincent Batts 5152b3a
+
Vincent Batts 5152b3a
diff -r 87dea3f5ebe7 src/pkg/crypto/elliptic/elliptic.go
Vincent Batts 5152b3a
--- a/src/pkg/crypto/elliptic/elliptic.go	Fri Nov 29 08:32:31 2013 +1100
Vincent Batts 5152b3a
+++ b/src/pkg/crypto/elliptic/elliptic.go	Fri Dec 06 13:31:29 2013 -0500
Vincent Batts 5152b3a
@@ -326,7 +326,6 @@
Vincent Batts 5152b3a
 var p521 *CurveParams
Vincent Batts 5152b3a
 
Vincent Batts 5152b3a
 func initAll() {
Vincent Batts 5152b3a
-	initP224()
Vincent Batts 5152b3a
 	initP256()
Vincent Batts 5152b3a
 	initP384()
Vincent Batts 5152b3a
 	initP521()
Vincent Batts 5152b3a
diff -r 87dea3f5ebe7 src/pkg/crypto/elliptic/elliptic_test.go
Vincent Batts 5152b3a
--- a/src/pkg/crypto/elliptic/elliptic_test.go	Fri Nov 29 08:32:31 2013 +1100
Vincent Batts 5152b3a
+++ b/src/pkg/crypto/elliptic/elliptic_test.go	Fri Dec 06 13:31:29 2013 -0500
Vincent Batts 5152b3a
@@ -1,3 +1,5 @@
Vincent Batts 5152b3a
+// +build ignore
Vincent Batts 5152b3a
+
Vincent Batts 5152b3a
 // Copyright 2010 The Go Authors. All rights reserved.
Vincent Batts 5152b3a
 // Use of this source code is governed by a BSD-style
Vincent Batts 5152b3a
 // license that can be found in the LICENSE file.
Vincent Batts 5152b3a
diff -r 87dea3f5ebe7 src/pkg/crypto/elliptic/p224.go
Vincent Batts 5152b3a
--- a/src/pkg/crypto/elliptic/p224.go	Fri Nov 29 08:32:31 2013 +1100
Vincent Batts 5152b3a
+++ b/src/pkg/crypto/elliptic/p224.go	Fri Dec 06 13:31:29 2013 -0500
Vincent Batts 5152b3a
@@ -1,3 +1,5 @@
Vincent Batts 5152b3a
+// +build ignore
Vincent Batts 5152b3a
+
Vincent Batts 5152b3a
 // Copyright 2012 The Go Authors.  All rights reserved.
Vincent Batts 5152b3a
 // Use of this source code is governed by a BSD-style
Vincent Batts 5152b3a
 // license that can be found in the LICENSE file.
Vincent Batts 5152b3a
@@ -183,10 +185,6 @@
Vincent Batts 5152b3a
 	}
Vincent Batts 5152b3a
 }
Vincent Batts 5152b3a
 
Vincent Batts 5152b3a
-const two31p3 = 1<<31 + 1<<3
Vincent Batts 5152b3a
-const two31m3 = 1<<31 - 1<<3
Vincent Batts 5152b3a
-const two31m15m3 = 1<<31 - 1<<15 - 1<<3
Vincent Batts 5152b3a
-
Vincent Batts 5152b3a
 // p224ZeroModP31 is 0 mod p where bit 31 is set in all limbs so that we can
Vincent Batts 5152b3a
 // subtract smaller amounts without underflow. See the section "Subtraction" in
Vincent Batts 5152b3a
 // [1] for reasoning.
Vincent Batts 5152b3a
@@ -215,9 +213,6 @@
Vincent Batts 5152b3a
 // "Subtraction" in [1] for why.
Vincent Batts 5152b3a
 var p224ZeroModP63 = [8]uint64{two63p35, two63m35, two63m35, two63m35, two63m35m19, two63m35, two63m35, two63m35}
Vincent Batts 5152b3a
 
Vincent Batts 5152b3a
-const bottom12Bits = 0xfff
Vincent Batts 5152b3a
-const bottom28Bits = 0xfffffff
Vincent Batts 5152b3a
-
Vincent Batts 5152b3a
 // p224Mul computes *out = a*b
Vincent Batts 5152b3a
 //
Vincent Batts 5152b3a
 // a[i] < 2**29, b[i] < 2**30 (or vice versa)
Vincent Batts 5152b3a
diff -r 87dea3f5ebe7 src/pkg/crypto/elliptic/p224_test.go
Vincent Batts 5152b3a
--- a/src/pkg/crypto/elliptic/p224_test.go	Fri Nov 29 08:32:31 2013 +1100
Vincent Batts 5152b3a
+++ b/src/pkg/crypto/elliptic/p224_test.go	Fri Dec 06 13:31:29 2013 -0500
Vincent Batts 5152b3a
@@ -1,3 +1,5 @@
Vincent Batts 5152b3a
+// +build ignore
Vincent Batts 5152b3a
+
Vincent Batts 5152b3a
 // Copyright 2012 The Go Authors.  All rights reserved.
Vincent Batts 5152b3a
 // Use of this source code is governed by a BSD-style
Vincent Batts 5152b3a
 // license that can be found in the LICENSE file.
Vincent Batts 5152b3a
diff -r 87dea3f5ebe7 src/pkg/crypto/x509/x509.go
Vincent Batts 5152b3a
--- a/src/pkg/crypto/x509/x509.go	Fri Nov 29 08:32:31 2013 +1100
Vincent Batts 5152b3a
+++ b/src/pkg/crypto/x509/x509.go	Fri Dec 06 13:31:29 2013 -0500
Vincent Batts 5152b3a
@@ -305,9 +305,6 @@
Vincent Batts 5152b3a
 
Vincent Batts 5152b3a
 // RFC 5480, 2.1.1.1. Named Curve
Vincent Batts 5152b3a
 //
Vincent Batts 5152b3a
-// secp224r1 OBJECT IDENTIFIER ::= {
Vincent Batts 5152b3a
-//   iso(1) identified-organization(3) certicom(132) curve(0) 33 }
Vincent Batts 5152b3a
-//
Vincent Batts 5152b3a
 // secp256r1 OBJECT IDENTIFIER ::= {
Vincent Batts 5152b3a
 //   iso(1) member-body(2) us(840) ansi-X9-62(10045) curves(3)
Vincent Batts 5152b3a
 //   prime(1) 7 }
Vincent Batts 5152b3a
@@ -320,7 +317,6 @@
Vincent Batts 5152b3a
 //
Vincent Batts 5152b3a
 // NB: secp256r1 is equivalent to prime256v1
Vincent Batts 5152b3a
 var (
Vincent Batts 5152b3a
-	oidNamedCurveP224 = asn1.ObjectIdentifier{1, 3, 132, 0, 33}
Vincent Batts 5152b3a
 	oidNamedCurveP256 = asn1.ObjectIdentifier{1, 2, 840, 10045, 3, 1, 7}
Vincent Batts 5152b3a
 	oidNamedCurveP384 = asn1.ObjectIdentifier{1, 3, 132, 0, 34}
Vincent Batts 5152b3a
 	oidNamedCurveP521 = asn1.ObjectIdentifier{1, 3, 132, 0, 35}
Vincent Batts 5152b3a
@@ -328,8 +324,6 @@
Vincent Batts 5152b3a
 
Vincent Batts 5152b3a
 func namedCurveFromOID(oid asn1.ObjectIdentifier) elliptic.Curve {
Vincent Batts 5152b3a
 	switch {
Vincent Batts 5152b3a
-	case oid.Equal(oidNamedCurveP224):
Vincent Batts 5152b3a
-		return elliptic.P224()
Vincent Batts 5152b3a
 	case oid.Equal(oidNamedCurveP256):
Vincent Batts 5152b3a
 		return elliptic.P256()
Vincent Batts 5152b3a
 	case oid.Equal(oidNamedCurveP384):
Vincent Batts 5152b3a
@@ -342,8 +336,6 @@
Vincent Batts 5152b3a
 
Vincent Batts 5152b3a
 func oidFromNamedCurve(curve elliptic.Curve) (asn1.ObjectIdentifier, bool) {
Vincent Batts 5152b3a
 	switch curve {
Vincent Batts 5152b3a
-	case elliptic.P224():
Vincent Batts 5152b3a
-		return oidNamedCurveP224, true
Vincent Batts 5152b3a
 	case elliptic.P256():
Vincent Batts 5152b3a
 		return oidNamedCurveP256, true
Vincent Batts 5152b3a
 	case elliptic.P384():
Vincent Batts 5152b3a
@@ -1373,7 +1365,7 @@
Vincent Batts 5152b3a
 		hashFunc = crypto.SHA1
Vincent Batts 5152b3a
 	case *ecdsa.PrivateKey:
Vincent Batts 5152b3a
 		switch priv.Curve {
Vincent Batts 5152b3a
-		case elliptic.P224(), elliptic.P256():
Vincent Batts 5152b3a
+		case elliptic.P256():
Vincent Batts 5152b3a
 			hashFunc = crypto.SHA256
Vincent Batts 5152b3a
 			signatureAlgorithm.Algorithm = oidSignatureECDSAWithSHA256
Vincent Batts 5152b3a
 		case elliptic.P384():