Does Ampere support the Hardware instruction RNDR?

I received this question from our developers email address. I have no idea about the answer and thought that I would post it.

My UEFI application requires the openssl crypto service in order to obtain a random number. It uses EDK2 and runs on the “Ampere® Altra® and Ampere® Altra® Max” processor. But unlike other arm processors, I discovered that the Ampere processor does not support the hardware instruction RNDR. So, is it possible to extract the random number from the processor of the Ampere Altra? As an aside, I had already asked a question in the EDK2 development group (#120160).

1 Like

You need FEAT_RNG for it. Which is v8.5 feature while Altra is v8.2 only.

So sorry, no hardware random numbers for you.

1 Like

Not quite - Altra doesn’t support FEAT_RNG but it does hardware random numbers via its TRNG. See edk2-platforms/Silicon/Ampere/AmpereAltraPkg/Library/TrngLib/TrngLib.c at ampere · AmpereComputing/edk2-platforms · GitHub for how to access it.

1 Like

I’m not sure if we support Arm’s TRNG interface though.
(Documentation – Arm Developer - Arm True Random Number Generator Firmware Interface)

2 Likes