Commit 9f1394d2 authored by Dmitry Chestnykh's avatar Dmitry Chestnykh Committed by Adam Langley

crypto/ecdsa, crypto/rsa: use io.ReadFull to read from random source.

R=golang-dev, agl1
CC=golang-dev
https://golang.org/cl/4316057
parent db99a784
......@@ -37,7 +37,7 @@ var one = new(big.Int).SetInt64(1)
// curve using the procedure given in [NSA] A.2.1.
func randFieldElement(c *elliptic.Curve, rand io.Reader) (k *big.Int, err os.Error) {
b := make([]byte, c.BitSize/8+8)
_, err = rand.Read(b)
_, err = io.ReadFull(rand, b)
if err != nil {
return
}
......
......@@ -127,7 +127,7 @@ func nonZeroRandomBytes(s []byte, rand io.Reader) (err os.Error) {
for i := 0; i < len(s); i++ {
for s[i] == 0 {
_, err = rand.Read(s[i : i+1])
_, err = io.ReadFull(rand, s[i:i+1])
if err != nil {
return
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment