blowfish fixes

This commit is contained in:
erana 2012-01-20 17:17:34 +09:00
parent 728d30a647
commit bf823e0964
1 changed files with 3 additions and 4 deletions

View File

@ -1142,9 +1142,8 @@
(define blowfish-F (if BIG-ENDIAN-HOST blowfish-F-be blowfish-F-le)) ;; FIXME default is big endian (define blowfish-F (if BIG-ENDIAN-HOST blowfish-F-be blowfish-F-le)) ;; FIXME default is big endian
(define (blowfish-R l r i) (define (blowfish-R l r i)
(let ((l (bitwise-xor l (dictionary-ref (blowfish-p blowfish-context) i))) (set! l (bitwise-xor l (dictionary-ref (blowfish-p blowfish-context) i)))
(r (bitwise-xor r ((dictionary-ref (blowfish-p blowfish-context) blowfish_F l))))) (set! r (bitwise-xor r ((dictionary-ref (blowfish-p blowfish-context) blowfish_F l)))))
))
;; blowfish-rounds == 16 -> ;; blowfish-rounds == 16 ->
(define (blowfish-encrypt bc ret_xl ret_xr) ;; NOTE bc = blowfish-context (define (blowfish-encrypt bc ret_xl ret_xr) ;; NOTE bc = blowfish-context
@ -1361,4 +1360,4 @@
(if (not (eq? buffer plain3)) (if (not (eq? buffer plain3))
(display "Blowfish selftest failed - 2.")) (display "Blowfish selftest failed - 2."))
)) )))