aboutsummaryrefslogtreecommitdiff
path: root/internal/cryptocore/nonce.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/cryptocore/nonce.go')
-rw-r--r--internal/cryptocore/nonce.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/internal/cryptocore/nonce.go b/internal/cryptocore/nonce.go
index 9df094c..c800807 100644
--- a/internal/cryptocore/nonce.go
+++ b/internal/cryptocore/nonce.go
@@ -11,6 +11,8 @@ func RandBytes(n int) []byte {
b := make([]byte, n)
_, err := rand.Read(b)
if err != nil {
+ // crypto/rand.Read() is documented to never return an
+ // error, so this should never happen. Still, better safe than sorry.
log.Panic("Failed to read random bytes: " + err.Error())
}
return b