From f59fe0c8e0b45a2f7aca9ed3e4f18427a3493766 Mon Sep 17 00:00:00 2001 From: Jae Kwon Date: Sun, 13 Mar 2016 10:14:24 -0700 Subject: [PATCH] s/Seed/MixEntropy/g --- random.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/random.go b/random.go index 803386843..edadeaab6 100644 --- a/random.go +++ b/random.go @@ -15,13 +15,13 @@ var gRandInfo *randInfo func init() { gRandInfo = &randInfo{} - gRandInfo.AddSeed(randBytes(32)) // Init + gRandInfo.MixEntropy(randBytes(32)) // Init } -// Add additional bytes of randomness, e.g. from hardware, user-input, etc. -// It is OK to call it multiple times. It does not deminish security. -func Seed(seedBytes []byte) { - gRandInfo.AddSeed(seedBytes) +// Mix additional bytes of randomness, e.g. from hardware, user-input, etc. +// It is OK to call it multiple times. It does not diminish security. +func MixEntropy(seedBytes []byte) { + gRandInfo.MixEntropy(seedBytes) } // This only uses the OS's randomness @@ -66,7 +66,7 @@ type randInfo struct { // You can call this as many times as you'd like. // XXX TODO review -func (ri *randInfo) AddSeed(seedBytes []byte) { +func (ri *randInfo) MixEntropy(seedBytes []byte) { ri.mtx.Lock() defer ri.mtx.Unlock() // Make new ri.seedBytes