mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-04 06:38:47 +00:00
Core Foundation and Security vendor libraries.
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
package Security
|
||||
|
||||
import CF "core:sys/darwin/CoreFoundation"
|
||||
|
||||
foreign import Security "system:Security.framework"
|
||||
|
||||
// A reference to a random number generator.
|
||||
RandomRef :: distinct rawptr
|
||||
|
||||
@(link_prefix="Sec", default_calling_convention="c")
|
||||
foreign Security {
|
||||
// Default random ref for /dev/random. Synonym for nil.
|
||||
@(link_name="kSecRandomDefault") kSecRandomDefault: RandomRef
|
||||
|
||||
// Generates an array of cryptographically secure random bytes.
|
||||
RandomCopyBytes :: proc(rnd: RandomRef = kSecRandomDefault, count: uint, bytes: [^]byte) -> errSec ---
|
||||
|
||||
CopyErrorMessageString :: proc(status: errSec, reserved: rawptr = nil) -> CF.String ---
|
||||
}
|
||||
Reference in New Issue
Block a user