summaryrefslogtreecommitdiff
path: root/hwrand.pl
diff options
context:
space:
mode:
Diffstat (limited to 'hwrand.pl')
-rwxr-xr-xhwrand.pl8
1 files changed, 8 insertions, 0 deletions
diff --git a/hwrand.pl b/hwrand.pl
new file mode 100755
index 0000000..87fd667
--- /dev/null
+++ b/hwrand.pl
@@ -0,0 +1,8 @@
+#!/usr/bin/perl
+open my $hw, "</dev/hwrng" and open my $rnd, "</dev/random" or die;
+for (;;) {
+ my $l = read $hw, my $d, 512;
+ ioctl $rnd, 0x40085203, pack("ii", 4 * $l, $l) . $d or die;
+ vec(my $w, fileno $rnd, 1) = 1;
+ select undef, $w, undef, undef
+}