parent
ea12d45337
commit
883c54e077
|
@ -1,6 +1,6 @@
|
||||||
USING: alien.c-types io io.files io.nonblocking kernel
|
USING: alien.c-types io io.files io.nonblocking kernel
|
||||||
namespaces random io.encodings.binary singleton init
|
namespaces random io.encodings.binary singleton init
|
||||||
accessors ;
|
accessors system ;
|
||||||
IN: random.unix
|
IN: random.unix
|
||||||
|
|
||||||
TUPLE: unix-random path ;
|
TUPLE: unix-random path ;
|
||||||
|
@ -15,7 +15,14 @@ C: <unix-random> unix-random
|
||||||
M: unix-random random-bytes* ( n tuple -- byte-array )
|
M: unix-random random-bytes* ( n tuple -- byte-array )
|
||||||
path>> file-read-unbuffered ;
|
path>> file-read-unbuffered ;
|
||||||
|
|
||||||
[
|
os "openbsd" = [
|
||||||
"/dev/random" <unix-random> secure-random-generator set-global
|
[
|
||||||
"/dev/urandom" <unix-random> insecure-random-generator set-global
|
"/dev/srandom" <unix-random> secure-random-generator set-global
|
||||||
] "random.unix" add-init-hook
|
"/dev/prandom" <unix-random> insecure-random-generator set-global
|
||||||
|
] "random.unix" add-init-hook
|
||||||
|
] [
|
||||||
|
[
|
||||||
|
"/dev/random" <unix-random> secure-random-generator set-global
|
||||||
|
"/dev/urandom" <unix-random> insecure-random-generator set-global
|
||||||
|
] "random.unix" add-init-hook
|
||||||
|
] if
|
||||||
|
|
Loading…
Reference in New Issue