From: Chris Hanson Date: Sat, 14 Aug 1999 03:41:01 +0000 (+0000) Subject: Improve method used to compute initialization vectors. X-Git-Tag: 20090517-FFI~4469 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=43a626f0757954bcc36ad9a140d0cc188876c11a;p=mit-scheme.git Improve method used to compute initialization vectors. --- diff --git a/v7/src/runtime/blowfish.scm b/v7/src/runtime/blowfish.scm index cba6f4705..cdeeb301d 100644 --- a/v7/src/runtime/blowfish.scm +++ b/v7/src/runtime/blowfish.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: blowfish.scm,v 1.16 1999/08/14 03:40:26 cph Exp $ +$Id: blowfish.scm,v 1.17 1999/08/14 03:41:01 cph Exp $ Copyright (c) 1997, 1999 Massachusetts Institute of Technology @@ -124,13 +124,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. (string-fill! input-buffer #\NUL) (string-fill! output-buffer #\NUL))))) -(define (write-blowfish-file-header port) - (write-string blowfish-file-header-v2 port) - (newline port) - (let ((init-vector (compute-blowfish-init-vector))) - (write-string init-vector port) - init-vector)) - (define (compute-blowfish-init-vector) ;; This init vector includes a timestamp with a resolution of ;; milliseconds, plus 20 random bits. This should make it very @@ -146,6 +139,13 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. (vector-8b-set! iv i (remainder t #x100))) iv)) +(define (write-blowfish-file-header port) + (write-string blowfish-file-header-v2 port) + (newline port) + (let ((init-vector (compute-blowfish-init-vector))) + (write-string init-vector port) + init-vector)) + (define (read-blowfish-file-header port) (let ((line (read-line port))) (cond ((string=? blowfish-file-header-v1 line)