aboutsummaryrefslogtreecommitdiff
path: root/core/crypto/rand_bsd.odin
blob: 8e2be1d95b0d6fd67aaefdedc2f57f3aaf894048 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
//+build freebsd, openbsd
package crypto

foreign import libc "system:c"

foreign libc {
	arc4random_buf :: proc(buf: [^]byte, nbytes: uint) ---
}

_rand_bytes :: proc(dst: []byte) {
	arc4random_buf(raw_data(dst), len(dst))
}