[RFC 1/1] Optimizing the rand function on arm64 platforms

Xi Ruoyao xry111@xry111.site
Mon Jul 24 18:00:54 GMT 2023


On Mon, 2023-07-24 at 10:46 -0400, Cristian Rodríguez via Libc-alpha
wrote:
> On Sun, Jul 23, 2023 at 10:35 PM Tian Tao via Libc-alpha <
> libc-alpha@sourceware.org> wrote:
> 
> > Armv8.5 adds the FEAT_RNG feature so that true random numbers can be
> > obtained from the cpu. This optimization is therefore proposed for
> > the
> > arm64 platform.
> > 
> 
> 
> Unfortunately standards preclude you to fix this terrible interfaces, it is
> highly suggested you move your efforts into adding feat_rng support to the
> linux kernel so it uses as a source of entropy

It already does:

https://git.kernel.org/linus/1a50ec0b3b2e9a83f1b1245ea37a853aac2f741c

> and to the efforts of providing a really fast user space interface to reduce the
> syscall overhead.. the VDSO approach failed to gain approval of kernel
> developers so maybe  a "rng_state" accessible via rseq can work..

I think it's a different topic.  The vDSO approach is for CSPRNG, but we
don't actually need all PRNGs to be cryptography secure. 

> These interfaces are broken beyond repair and you should look
> elsewhere for random numbers.


-- 
Xi Ruoyao <xry111@xry111.site>
School of Aerospace Science and Technology, Xidian University


More information about the Libc-alpha mailing list