;;;; entropy-unix.scm ;;;; Kon Lovett, Oct '09 (module entropy-unix (;export make-entropy-source-random-device make-entropy-source-urandom-device) (import scheme) (import chicken) (use entropy-source entropy-port) ;;; (define-constant TIMEOUT 5.0) ;;; Entropy from /dev/random (define (make-entropy-source-random-device) (make-entropy-source/file-timed "/dev/random" TIMEOUT 'random-device "Entropy from random device") ) (register-entropy-source! 'random-device make-entropy-source-random-device) ;;; Entropy from /dev/urandom (define (make-entropy-source-urandom-device) (make-entropy-source/file-timed "/dev/urandom" TIMEOUT 'urandom-device "Entropy from urandom device") ) (register-entropy-source! 'urandom-device make-entropy-source-urandom-device) ) ;module entropy-unix