mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
x86 asm: move rdrand from x86-assembly-cheat
This commit is contained in:
16
README.adoc
16
README.adoc
@@ -12416,6 +12416,22 @@ link:userland/arch/x86_64/loop.S[LOOP]
|
||||
|
||||
Vs <<x86-jcc-instructions,Jcc>>: https://stackoverflow.com/questions/6805692/x86-assembly-programming-loops-with-ecx-and-loop-instruction-versus-jmp-jcond Holy CISC!
|
||||
|
||||
=== x86 random number generator instructions
|
||||
|
||||
<<intel-manual-1>> 5.1.15 Random Number Generator Instructions
|
||||
|
||||
Example: link:userland/arch/x86_64/rdrand.S[RDRAND]
|
||||
|
||||
If you run that executable multiple times, it prints a random number every time to stdout.
|
||||
|
||||
RDRAND is a true random number generator!
|
||||
|
||||
This Intel engineer says its based on quantum effects: https://stackoverflow.com/questions/17616960/true-random-numbers-with-c11-and-rdrand/18004959#18004959
|
||||
|
||||
Generated some polemic when kernel devs wanted to use it as part of `/dev/random`, because it could be used as a cryptographic backdoor by Intel since it is a black box.
|
||||
|
||||
RDRAND sets the carry flag when data is ready so we must loop if the carry flag isn't set.
|
||||
|
||||
=== x86 SIMD
|
||||
|
||||
History:
|
||||
|
||||
Reference in New Issue
Block a user