mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 23:58:50 +00:00
core/crypto: Add a HAS_RAND_BYTES constant
This commit is contained in:
@@ -5,6 +5,9 @@ import "core:fmt"
|
||||
import CF "core:sys/darwin/CoreFoundation"
|
||||
import Sec "core:sys/darwin/Security"
|
||||
|
||||
HAS_RAND_BYTES :: true
|
||||
|
||||
@(private)
|
||||
_rand_bytes :: proc(dst: []byte) {
|
||||
err := Sec.RandomCopyBytes(count=len(dst), bytes=raw_data(dst))
|
||||
if err != .Success {
|
||||
@@ -12,7 +15,3 @@ _rand_bytes :: proc(dst: []byte) {
|
||||
panic(fmt.tprintf("crypto/rand_bytes: SecRandomCopyBytes returned non-zero result: %v %s", err, msg))
|
||||
}
|
||||
}
|
||||
|
||||
_has_rand_bytes :: proc() -> bool {
|
||||
return true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user