From ec1faec15ae983ba16a39eb494447a3064517ef3 Mon Sep 17 00:00:00 2001 From: erana Date: Fri, 20 Jan 2012 15:10:29 +0900 Subject: [PATCH] blowfish fixes --- scsh/encryption/blowfish.scm | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/scsh/encryption/blowfish.scm b/scsh/encryption/blowfish.scm index 46c8152..ab4e56a 100644 --- a/scsh/encryption/blowfish.scm +++ b/scsh/encryption/blowfish.scm @@ -1071,13 +1071,15 @@ (let ((colornumber 0)) (do ((i (- (string-length sy) 1) (- i 1))) ((< i 0) (- colornumber 1)) - (let ((c (string-ref (string sy) i))) + (let ((c (string-ref (if (number? sy) + (number->string sy) + (symbol->string sy)) i))) (let ((n (cond ((or (eq? c #\a)(eq? c #\A)) - 10) - ((or (eq? c #\b)(eq? c #\B)) - 11) - ((or (eq? c #\c)(eq? c #\C)) - 12) + 10) + ((or (eq? c #\b)(eq? c #\B)) + 11) + ((or (eq? c #\c)(eq? c #\C)) + 12) ((or (eq? c #\d)(eq? c #\D)) 13) ((or (eq? c #\e)(eq? c #\E)) @@ -1085,7 +1087,7 @@ ((or (eq? c #\f)(eq? c #\F)) 15) (else (string->number (string c)))))) - (set! colornumber (+ (* (+ n 1) 16 i) colornumber))))))) + (set! colornumber (+ (* (+ n 1) 16 i) colornumber))))))) (define :blowfish-record