Rdrand
and Rdseed
instructions are not designed for speed. Moreover, the process is even slower because Golang cannot inline assembly codes.
...>go test -bench=.
goos: windows
goarch: amd64
pkg: github.com/SeanTolstoyevski/crndm
cpu: Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
BenchmarkCrmdnAsUint64-12 10217383 115.6 ns/op
BenchmarkCrmdnAsUint32-12 10326488 116.5 ns/op
BenchmarkCrmdnAsUint16-12 10796784 114.0 ns/op
PASS
ok github.com/SeanTolstoyevski/crndm 4.756s
A Quick Guide to Go's Assembler - The Go Programming Language