New Upstream Snapshot - golang-github-nebulouslabs-fastrand

Ready changes

Summary

Merged new upstream version: 0.0~git20181203.6fb6489 (was: 0.0~git20170512.60b6156).

Resulting package

Built on 2022-03-07T06:16 (took 4m7s)

The resulting binary packages can be installed (if you have the apt repository enabled) by running one of:

apt install -t fresh-snapshots golang-github-nebulouslabs-fastrand-dev

Lintian Result

Diff

diff --git a/README.md b/README.md
index 8fc3ce7..a09e136 100644
--- a/README.md
+++ b/README.md
@@ -1,55 +1,4 @@
 fastrand
 --------
 
-[![GoDoc](https://godoc.org/github.com/NebulousLabs/fastrand?status.svg)](https://godoc.org/github.com/NebulousLabs/fastrand)
-[![Go Report Card](http://goreportcard.com/badge/github.com/NebulousLabs/fastrand)](https://goreportcard.com/report/github.com/NebulousLabs/fastrand)
-
-```
-go get github.com/NebulousLabs/fastrand
-```
-
-`fastrand` implements a cryptographically secure pseudorandom number generator.
-The generator is seeded using the system's default entropy source, and
-thereafter produces random values via repeated hashing. As a result, `fastrand`
-can generate randomness much faster than `crypto/rand`, and generation cannot
-fail beyond a potential panic during `init()`.
-
-`fastrand` also scales better than `crypto/rand` and `math/rand` when called in
-parallel. In fact, `fastrand` can even outperform `math/rand` when using enough threads.
-
-
-## Benchmarks ##
-
-```
-// 32 byte reads
-BenchmarkRead32                     	10000000	       175 ns/op	 181.86 MB/s
-BenchmarkReadCrypto32               	  500000	      2733 ns/op	  11.71 MB/s
-
-// 512 kb reads
-BenchmarkRead512kb                   	    1000	   1336217 ns/op	 383.17 MB/s
-BenchmarkReadCrypto512kb             	      50	  33423693 ns/op	  15.32 MB/s
-
-// 32 byte reads using 4 threads
-BenchmarkRead4Threads32               	 3000000	       392 ns/op	 326.46 MB/s
-BenchmarkReadCrypto4Threads32       	  200000	      7579 ns/op	  16.89 MB/s
-
-// 512 kb reads using 4 threads
-BenchmarkRead4Threads512kb           	    1000	   1899048 ns/op	1078.43 MB/s
-BenchmarkReadCrypto4Threads512kb    	      20	  97423380 ns/op	  21.02 MB/s
-```
-
-## Security ##
-
-`fastrand` uses an algorithm similar to Fortuna, which is the basis for the
-`/dev/random` device in FreeBSD. However, although the techniques used by
-`fastrand` are known to be secure, the specific implementation has not been
-reviewed by a security professional. Use with caution.
-
-The general strategy is to use `crypto/rand` at init to get 32 bytes of strong
-entropy. From there, the entropy is concatenated to a counter and hashed
-repeatedly, providing 64 bytes of random output each time the counter is
-incremented. The counter is 16 bytes, which provides strong guarantees that a
-cycle will not be seen throughout the lifetime of the program.
-
-The `sync/atomic` package is used to ensure that multiple threads calling
-`fastrand` concurrently are always guaranteed to end up with unique counters.
+This repository has moved to [GitLab](https://gitlab.com/NebulousLabs/fastrand).
diff --git a/debian/changelog b/debian/changelog
index 8e4d397..9e14419 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,8 +1,12 @@
-golang-github-nebulouslabs-fastrand (0.0~git20170512.60b6156-2) UNRELEASED; urgency=medium
+golang-github-nebulouslabs-fastrand (0.0~git20181203.6fb6489-1) UNRELEASED; urgency=medium
 
+  [ Alexandre Viau ]
   * Point Vcs-* urls to salsa.debian.org.
 
- -- Alexandre Viau <aviau@debian.org>  Mon, 02 Apr 2018 19:33:00 -0400
+  [ Debian Janitor ]
+  * New upstream snapshot.
+
+ -- Alexandre Viau <aviau@debian.org>  Mon, 07 Mar 2022 06:13:42 -0000
 
 golang-github-nebulouslabs-fastrand (0.0~git20170512.60b6156-1) unstable; urgency=medium
 
diff --git a/debian/patches/0001-blake2b-reference b/debian/patches/0001-blake2b-reference
index 3208a63..9a7198f 100644
--- a/debian/patches/0001-blake2b-reference
+++ b/debian/patches/0001-blake2b-reference
@@ -6,10 +6,10 @@ Subject: blake2b-reference
  fastrand.go | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
-diff --git a/fastrand.go b/fastrand.go
-index 3b32337..dd8f08a 100644
---- a/fastrand.go
-+++ b/fastrand.go
+Index: golang-github-nebulouslabs-fastrand/fastrand.go
+===================================================================
+--- golang-github-nebulouslabs-fastrand.orig/fastrand.go
++++ golang-github-nebulouslabs-fastrand/fastrand.go
 @@ -20,7 +20,7 @@ import (
  	"sync/atomic"
  	"unsafe"
diff --git a/fastrand.go b/fastrand.go
index 3b32337..0a21503 100644
--- a/fastrand.go
+++ b/fastrand.go
@@ -50,6 +50,9 @@ func init() {
 
 // Read fills b with random data. It always returns len(b), nil.
 func (r *randReader) Read(b []byte) (int, error) {
+	if len(b) == 0 {
+		return 0, nil
+	}
 	// Grab a unique counter from the reader, while atomically updating the
 	// counter so that concurrent callers also end up with unique values.
 	counter := atomic.AddUint64(&r.counter, 1)

Debdiff

File lists identical (after any substitutions)

No differences were encountered in the control files

More details

Full run details