Skip to content

Commit

Permalink
Unexport seed value
Browse files Browse the repository at this point in the history
  • Loading branch information
awnumar committed Jul 21, 2019
1 parent 79bffd0 commit 6c8a456
Show file tree
Hide file tree
Showing 398 changed files with 3 additions and 254,784 deletions.
8 changes: 3 additions & 5 deletions fastrand.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,13 @@ type randReader struct {
// random generator. It uses blake2b as its hashing function. Reader is safe
// for concurrent use by multiple goroutines.
var Reader *randReader

// Seed holds the global seed value for the CSPRNG.
var Seed *memguard.LockedBuffer
var entropy *memguard.LockedBuffer

// init provides the initial entropy for the reader that will seed all numbers
// coming out of fastrand.
func init() {
r := &randReader{}
Seed = memguard.NewBufferRandom(32)
entropy = memguard.NewBufferRandom(32)
Reader = r
}

Expand Down Expand Up @@ -87,7 +85,7 @@ func (r *randReader) Read(b []byte) (int, error) {
binary.LittleEndian.PutUint64(seed[0:8], counter)
binary.LittleEndian.PutUint64(seed[8:16], counterExtra)
// Leave 16 bytes for the inner counter.
copy(seed[32:], Seed.Bytes())
copy(seed[32:], entropy.Bytes())

// Set up an inner counter, that can be incremented to produce unique
// entropy within this thread.
Expand Down
91 changes: 0 additions & 91 deletions vendor/github.com/awnumar/memguard/.cirrus.yml

This file was deleted.

8 changes: 0 additions & 8 deletions vendor/github.com/awnumar/memguard/AUTHORS

This file was deleted.

201 changes: 0 additions & 201 deletions vendor/github.com/awnumar/memguard/LICENSE

This file was deleted.

58 changes: 0 additions & 58 deletions vendor/github.com/awnumar/memguard/README.md

This file was deleted.

Loading

0 comments on commit 6c8a456

Please sign in to comment.