[PATCH] eal: add support for TRNG with Arm RNG feature
Stephen Hemminger
stephen at networkplumber.org
Fri Jul 26 21:00:26 CEST 2024
On Fri, 26 Jul 2024 18:34:44 +0000
Shunzhi Wen <Shunzhi.Wen at arm.com> wrote:
> > I'm missing a rationale here. Why is this useful?
> >
> This creates an API for HW that supports cryptographically secure random number generation.
>
> > If you want to extend <rte_random.h> with a cryptographically secure
> > random number generator, that's fine.
> >
> > To have an API that's only available on certain ARM CPUs is not.
> >
> > NAK
> >
> The primary goal of this patch is to provide a direct interface to HW,
> instead of letting kernel handle it. This is not an API just for Arm
> CPUs, as other vendors also have similar HW features. For instance,
> Intel and AMD has support for x86 RDRAND and RDSEED instructions, thus
> can easily implement this API.
>
> > A new function should be called something with "secure", rather than "true"
> > (which is a bit silly, since we might well live in a completely deterministic
> > universe). "secure" would more clearly communicate the intent, and also
> > doesn't imply any particular implementation.
> >
> Regarding the terminology, “cryptographically secure random number”
> is a more accurate and meaningful term than “true random number.”
> This change will be made in the description, and the function name will
> be replaced with rte_csrand.
If you decide to rte_csrand() it should fallback to get_random or get_entropy.
Note: many people don't fully trust RDRAND or ARM CPU instructions.
That is why the Linux entropy calls do not use only the HW instructions.
More information about the dev
mailing list