summaryrefslogtreecommitdiff
path: root/libgo/go/crypto/ecdsa/ecdsa.go
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2011-12-03 02:17:34 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2011-12-03 02:17:34 +0000
commit2fd401c8f190f1fe43e51a7f726f6ed6119a1f96 (patch)
tree7f76eff391f37fe6467ff4ffbc0c582c9959ea30 /libgo/go/crypto/ecdsa/ecdsa.go
parent02e9018f1616b23f1276151797216717b3564202 (diff)
downloadgcc-2fd401c8f190f1fe43e51a7f726f6ed6119a1f96.tar.gz
libgo: Update to weekly.2011-11-02.
From-SVN: r181964
Diffstat (limited to 'libgo/go/crypto/ecdsa/ecdsa.go')
-rw-r--r--libgo/go/crypto/ecdsa/ecdsa.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/libgo/go/crypto/ecdsa/ecdsa.go b/libgo/go/crypto/ecdsa/ecdsa.go
index 7bce1bc9675..b7f235b3b10 100644
--- a/libgo/go/crypto/ecdsa/ecdsa.go
+++ b/libgo/go/crypto/ecdsa/ecdsa.go
@@ -16,7 +16,6 @@ import (
"big"
"crypto/elliptic"
"io"
- "os"
)
// PublicKey represents an ECDSA public key.
@@ -35,7 +34,7 @@ var one = new(big.Int).SetInt64(1)
// randFieldElement returns a random element of the field underlying the given
// curve using the procedure given in [NSA] A.2.1.
-func randFieldElement(c *elliptic.Curve, rand io.Reader) (k *big.Int, err os.Error) {
+func randFieldElement(c *elliptic.Curve, rand io.Reader) (k *big.Int, err error) {
b := make([]byte, c.BitSize/8+8)
_, err = io.ReadFull(rand, b)
if err != nil {
@@ -50,7 +49,7 @@ func randFieldElement(c *elliptic.Curve, rand io.Reader) (k *big.Int, err os.Err
}
// GenerateKey generates a public&private key pair.
-func GenerateKey(c *elliptic.Curve, rand io.Reader) (priv *PrivateKey, err os.Error) {
+func GenerateKey(c *elliptic.Curve, rand io.Reader) (priv *PrivateKey, err error) {
k, err := randFieldElement(c, rand)
if err != nil {
return
@@ -86,7 +85,7 @@ func hashToInt(hash []byte, c *elliptic.Curve) *big.Int {
// larger message) using the private key, priv. It returns the signature as a
// pair of integers. The security of the private key depends on the entropy of
// rand.
-func Sign(rand io.Reader, priv *PrivateKey, hash []byte) (r, s *big.Int, err os.Error) {
+func Sign(rand io.Reader, priv *PrivateKey, hash []byte) (r, s *big.Int, err error) {
// See [NSA] 3.4.1
c := priv.PublicKey.Curve