pub fn get_random() -> StatusExpand description
Get random seed from the Sentry kernel RNG backend
§Usage
The random seed received is 32 bits length. If the caller needs to forge a longer seeds without using an application hosted derivation, the syscall need to be called multiple-time.
This syscall requires the caller to hold the CAP_CRY_KRNG capability. Without this capability, Status::Denied is returned.
The syscall may fail if the kernel RNG source fails to properly delivers a FIPS compliant random value. In that case, the syscall returns Status::Critical.
The generated seed is delivered through the SVC_EXCHANGE zone.
§Example
ⓘ
match (get_random()) {
Status::Ok => (),
any_err => return(any_err),
};