Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rndr: Add support for aarch64 RNDR register backend #494

Closed

Commits on Jul 30, 2024

  1. rndr: Add support for aarch64 RNDR register backend

    AArch64 platforms from version Armv8.4 onwards may implement FEAT_RNG.
    FEAT_RNG introduces the RNDR (and RNDRRS) register, reading from which
    returns a random number.
    
    Add support for using the RNDR register as a backend for getrandom.
    The implementation is hidden behind a new "rndr" crate feature.
    For the backend to work, users must ensure that the target platform
    supports FEAT_RNG because it is not possible to reliably detect the
    feature at runtime across platforms.
    mrkajetanp committed Jul 30, 2024
    Configuration menu
    Copy the full SHA
    6783b87 View commit details
    Browse the repository at this point in the history
  2. rndr_with_fallback: Add a RNDR backend with a Linux fallback

    Currently, detecting whether FEAT_RNG is available without std relies
    on the Linux Kernel's MRS emulation.
    
    This commit adds a safe rndr_with_fallback backend for Linux systems.
    With this backend, getrandom will use the RNDR register on Linux systems
    where it is available and automatically fallback onto using Linux's
    getrandom syscall on systems where it is not.
    This implementation allows the crate to be build for Linux with this
    feature in advance and then run without having to know whether
    FEAT_RNG is implemented or not.
    
    For the time being, this backend is not used by default on any platform
    configuration. The intention is for it to be usable as an opt-in when an
    opt-in mechanism is available in the crate.
    mrkajetanp committed Jul 30, 2024
    Configuration menu
    Copy the full SHA
    f3c5244 View commit details
    Browse the repository at this point in the history