authorgravatar for devnexen@gmail.comDavid Carlier <devnexen@gmail.com> 2023-04-16 13:27:38+01:00
committergravatar for devnexen@gmail.comDavid Carlier <devnexen@gmail.com> 2023-04-22 21:01:12+01:00
logc579a23c5d997964a67883db5677c290bdbd7da6
tree6983581531848eb5058c69b121ef57e27a687da7
parent21aa55d34e432b677f71cbb377aa89c8cdbd1483

std: add CCRandomGenerateBytes macOs native api.


1 files changed, 28 insertions(+), 0 deletions(-)

lib/std/c/darwin.zig+28
......@@ -897,7 +897,35 @@ pub extern "c" fn pthread_attr_get_qos_class_np(attr: *pthread_attr_t, qos_class
897897pub extern "c" fn pthread_set_qos_class_self_np(qos_class: qos_class_t, relative_priority: c_int) c_int;
898898pub extern "c" fn pthread_get_qos_class_np(pthread: std.c.pthread_t, qos_class: *qos_class_t, relative_priority: *c_int) c_int;
899899
900pub const CCryptorStatus = enum(i32) {
901 /// Operation completed
902 kCCSuccess = 0,
903 /// Illegal parameter
904 kCCParamError = -4300,
905 /// Provided buffer too small
906 kCCBufferTooSmall = -4301,
907 /// Failed memory allocation
908 kCCMemoryFailure = -4302,
909 /// Size alignment issue
910 kCCAlignmentError = -4303,
911 /// Decoding issue
912 kCCDecodeError = -4304,
913 /// Call not implemented
914 kCCUnimplemented = -4305,
915 kCCOverflow = -4306,
916 kCCRNGFailure = -4307,
917 /// Unspecified error
918 kCCUnspecifiedError = -4308,
919 kCCCallSequenceError = -4309,
920 kCCKeySizeError = -4310,
921 /// Invalid key
922 kCCInvalidKey = -4311,
923};
924
925pub const CCRNGStatus = CCryptorStatus;
926
900927pub extern "c" fn arc4random_buf(buf: [*]u8, len: usize) void;
928pub extern "c" fn CCRandomGenerateBytes(bytes: ?*anyopaque, count: usize) CCRNGStatus;
901929
902930// Grand Central Dispatch is exposed by libSystem.
903931pub extern "c" fn dispatch_release(object: *anyopaque) void;