GhosttySysRandomSecureFn typedef

Callback type for secure random bytes.

Fills @p buf with @p len cryptographically secure random bytes. The library uses this for secrets, so it must be a real CSPRNG (getrandom, arc4random_buf, BCryptGenRandom, crypto.getRandomValues, ...); a predictable source is a security hole.

@param userdata The userdata pointer set via GHOSTTY_SYS_OPT_USERDATA @param buf Buffer to fill @param len Number of bytes to fill @return true if the buffer was filled, false if no entropy is available

Implementation

typedef GhosttySysRandomSecureFn =
    ffi.Pointer<ffi.NativeFunction<GhosttySysRandomSecureFnFunction>>;