core/crypto: Add a HAS_RAND_BYTES constant

This commit is contained in:
Yawning Angel
2024-04-23 11:47:43 +09:00
parent 902e877467
commit a6eb64df6c
8 changed files with 24 additions and 31 deletions
+4 -4
View File
@@ -6,8 +6,12 @@ foreign odin_env {
env_rand_bytes :: proc "contextless" (buf: []byte) ---
}
HAS_RAND_BYTES :: true
@(private)
_MAX_PER_CALL_BYTES :: 65536 // 64kiB
@(private)
_rand_bytes :: proc(dst: []byte) {
dst := dst
@@ -18,7 +22,3 @@ _rand_bytes :: proc(dst: []byte) {
dst = dst[to_read:]
}
}
_has_rand_bytes :: proc() -> bool {
return true
}