DOKK / manpages / debian 11 / libkcapi-dev / kcapi_rng_init.3.en
KCAPI_RNG_INIT(3) Programming Interface KCAPI_RNG_INIT(3)

kcapi_rng_init - initialize cipher handle

int kcapi_rng_init(struct kcapi_handle ** handle, const char * ciphername, uint32_t flags);

handle

[out] cipher handle filled during the call

ciphername

[in] kernel crypto API cipher name as specified in /proc/crypto

flags

[in] flags specifying the type of cipher handle (unused for RNG)

This function provides the initialization of a random number generator handle and establishes the connection to the kernel.

On success, a pointer to kcapi_handle object is returned in *handle. Function kcapi_rng_destroy should be called afterwards to free resources.

return 0 upon success; -ENOENT - algorithm not available; -EOPNOTSUPP - AF_ALG family not available; -EINVAL - accept syscall failed -ENOMEM - cipher handle cannot be allocated

Stephan Mueller <smueller@chronox.de>

Author.

November 2020 libkcapi Manual 1.2.1