如何使用Intel Ivy Bridge的RNG?

时间:2014-10-19 11:42:19

标签: random prng

我读到Intel Ivy Bridge处理器提供RNG(RdRand)。但是我该如何使用它?

我的CPU E3-1270v2没有提供RNG标志。

flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid fsgsbase smep erms

此外,在/ dev中,没有hwrng或hw_random。

aac0%                loop5#               ram14#               stdout@              tty34%               tty62%
block/               loop6#               ram15#               systty@              tty35%               tty63%
bsg/                 loop7#               ram2#                tty%                 tty36%               tty7%
bus/                 lp0%                 ram3#                tty0%                tty37%               tty8%
cdrom@               lp1%                 ram4#                tty1%                tty38%               tty9%
char/                lp2%                 ram5#                tty10%               tty39%               ttyS0%
console%             lp3%                 ram6#                tty11%               tty4%                ttyS1%
core@                MAKEDEV@             ram7#                tty12%               tty40%               ttyS2%
cpu/                 mapper/              ram8#                tty13%               tty41%               ttyS3%
cpu_dma_latency%     mcelog%              ram9#                tty14%               tty42%               urandom%
crash%               mem%                 random%              tty15%               tty43%               usbmon0%
disk/                net/                 raw/                 tty16%               tty44%               usbmon1%
dvd@                 network_latency%     root@                tty17%               tty45%               usbmon2%
fb@                  network_throughput%  rtc@                 tty18%               tty46%               vcs%
fb0%                 null%                rtc0%                tty19%               tty47%               vcs1%
fd@                  nvram%               scd0@                tty2%                tty48%               vcs2%
full%                oldmem%              sda#                 tty20%               tty49%               vcs3%
fuse%                port%                sda1#                tty21%               tty5%                vcs4%
hidraw0%             ppp%                 sda2#                tty22%               tty50%               vcs5%
hidraw1%             ptmx%                sda3#                tty23%               tty51%               vcs6%
hpet%                ptp0%                sg0%                 tty24%               tty52%               vcsa%
hugepages/           ptp1%                sg1%                 tty25%               tty53%               vcsa1%
hvc0%                ptp2%                sg2%                 tty26%               tty54%               vcsa2%
input/               ptp3%                sg3%                 tty27%               tty55%               vcsa3%
kmsg%                pts/                 sg4%                 tty28%               tty56%               vcsa4%
log=                 ram0#                sg5%                 tty29%               tty57%               vcsa5%
loop0#               ram1#                shm/                 tty3%                tty58%               vcsa6%
loop1#               ram10#               snapshot%            tty30%               tty59%               vga_arbiter%
loop2#               ram11#               sr0#                 tty31%               tty6%                watchdog%
loop3#               ram12#               stderr@              tty32%               tty60%               zero%
loop4#               ram13#               stdin@               tty33%               tty61%               

那么,我如何使用英特尔的RNG Feed?

2 个答案:

答案 0 :(得分:2)

如果处理器支持RdRand,它应该自动以/ dev / random方式提供它。然而,即使英特尔声称" Ivy Bridge支持RdRand",对于某些以前的Ivy Bridge模型可能也不是这样。更多信息:

http://en.wikipedia.org/wiki/RdRand

回答你的问题:像往常一样使用/ dev / random。如果支持RdRand,您应该能够获得比没有RdRand更多的随机数据。

答案 1 :(得分:0)

新引导系统会发生什么,熵计数会很低。你可以看到这样有多少:

# sysctl kernel.random.entropy_avail

看看:rngd

这有助于提高你的熵水平。