blowfish fixes - 22

This commit is contained in:
erana 2012-01-20 20:49:34 +09:00
parent 58ef81fef7
commit ac702302f5
1 changed files with 5 additions and 5 deletions

View File

@ -1152,11 +1152,11 @@
(+ (vector-ref (blowfish-s2 blowfish-context) 2) (+ (vector-ref (blowfish-s2 blowfish-context) 2)
(vector-ref (blowfish-s3 blowfish-context) 3)))) (vector-ref (blowfish-s3 blowfish-context) 3))))
(define (blowfish-F-le x) (define (blowfish-F-le x)
(bitwise-xor (+ (vector-ref (blowfish-s0 blowfish-context) 3) (bitwise-xor (+ (dictionary-ref-with-index (blowfish-s0 blowfish-context) 3)
(vector-ref (blowfish-s1 blowfish-context) 2)) (dictionary-ref-with-index (blowfish-s1 blowfish-context) 2))
(+ (vector-ref (blowfish-s2 blowfish-context) 1) (+ (dictionary-ref (blowfish-s2 blowfish-context) 1)
(vector-ref (blowfish-s3 blowfish-context) 0)))) (dictionary-ref (blowfish-s3 blowfish-context) 0))))
(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-le blowfish-F-be)) ;; FIXME2 default is big endian
(define (blowfish-R bc l r i) (define (blowfish-R bc l r i)
(set! l (bitwise-xor l (dictionary-ref (blowfish-p bc) i))) (set! l (bitwise-xor l (dictionary-ref (blowfish-p bc) i)))