mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
math/rand: make the security warning clearer and more prominent
It is still a common misconception that math/rand can be used for security-sensitive work if seeded with crypto/rand (lazyledger/lazyledger-core#270). It can not. Change-Id: I8598c352d1750eabeada50be9976ab68cbb42cc0 Reviewed-on: https://go-review.googlesource.com/c/go/+/310350 Trust: Filippo Valsorda <filippo@golang.org> Reviewed-by: Katie Hockman <katie@golang.org> Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
This commit is contained in:
parent
8c66669764
commit
d2f96f2f75
1 changed files with 5 additions and 3 deletions
|
|
@ -2,7 +2,8 @@
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
// Package rand implements pseudo-random number generators.
|
// Package rand implements pseudo-random number generators unsuitable for
|
||||||
|
// security-sensitive work.
|
||||||
//
|
//
|
||||||
// Random numbers are generated by a Source. Top-level functions, such as
|
// Random numbers are generated by a Source. Top-level functions, such as
|
||||||
// Float64 and Int, use a default shared Source that produces a deterministic
|
// Float64 and Int, use a default shared Source that produces a deterministic
|
||||||
|
|
@ -14,8 +15,9 @@
|
||||||
// Mathematical interval notation such as [0, n) is used throughout the
|
// Mathematical interval notation such as [0, n) is used throughout the
|
||||||
// documentation for this package.
|
// documentation for this package.
|
||||||
//
|
//
|
||||||
// For random numbers suitable for security-sensitive work, see the crypto/rand
|
// This package's outputs might be easily predictable regardless of how it's
|
||||||
// package.
|
// seeded. For random numbers suitable for security-sensitive work, see the
|
||||||
|
// crypto/rand package.
|
||||||
package rand
|
package rand
|
||||||
|
|
||||||
import "sync"
|
import "sync"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue