From: Kevin M. Rosenberg Date: Wed, 11 Feb 2004 22:46:13 +0000 (+0000) Subject: r8650: Automated commit for Debian build of md5 upstream-version-1.8.3 X-Git-Tag: v1.8.5~5 X-Git-Url: http://git.kpe.io/?p=md5.git;a=commitdiff_plain;h=20fe3addfbc0a5103c81c6d4d75ee34a9537ce12 r8650: Automated commit for Debian build of md5 upstream-version-1.8.3 --- diff --git a/debian/changelog b/debian/changelog index c9f780d..fb7f3dc 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +cl-md5 (1.8.3-1) unstable; urgency=low + + * Patch from pmai sent by Matthew Kennedy + + -- Kevin M. Rosenberg Wed, 11 Feb 2004 15:45:58 -0700 + cl-md5 (1.8.2-1) unstable; urgency=low * Fix compilation on Allegro's case sensitive mode diff --git a/md5.lisp b/md5.lisp index e0f87b7..dbdafb2 100644 --- a/md5.lisp +++ b/md5.lisp @@ -392,24 +392,34 @@ bounded by start and end, which must be numeric bounding-indices." (ext:optimize-interface (safety 1) (debug 1))) (let ((regs (md5-state-regs state)) (block (md5-state-block state)) - (buffer (md5-state-buffer state)) - (buffer-index (md5-state-buffer-index state)) - (length (- end start))) - (declare (type md5-regs regs) (type fixnum length) - (type (integer 0 63) buffer-index) + (buffer (md5-state-buffer state))) + (declare (type md5-regs regs) (type (simple-array (unsigned-byte 32) (16)) block) (type (simple-array (unsigned-byte 8) (64)) buffer)) ;; Handle old rest - (unless (zerop buffer-index) - (let ((amount (min (- 64 buffer-index) length))) - (declare (type (integer 0 63) amount)) - (copy-to-buffer sequence start amount buffer buffer-index) - (setq start (the fixnum (+ start amount))) - (when (>= start end) - (setf (md5-state-buffer-index state) (+ buffer-index amount)) - (return-from update-md5-state state))) - (fill-block-ub8 block buffer 0) - (update-md5-block regs block)) + (unless (zerop (md5-state-buffer-index state)) + (let* ((buffer-index (md5-state-buffer-index state)) + (remainder (- 64 buffer-index)) + (length (- end start)) + (amount (min remainder length))) + (declare (type (integer 0 63) buffer-index remainder amount) + (type fixnum length)) + (copy-to-buffer sequence start amount buffer buffer-index) + (setf (md5-state-amount state) + #-md5-small-length (+ (md5-state-amount state) amount) + #+md5-small-length (the (unsigned-byte 29) + (+ (md5-state-amount state) amount))) + (setq start (the fixnum (+ start amount))) + (if (< length remainder) + (setf (md5-state-buffer-index state) + (the (integer 0 63) (+ buffer-index amount))) + (progn + (fill-block-ub8 block buffer 0) + (update-md5-block regs block) + (setf (md5-state-buffer-index state) 0))))) + ;; Leave when nothing to do + (when (>= start end) + (return-from update-md5-state state)) ;; Handle main-part and new-rest (etypecase sequence ((simple-array (unsigned-byte 8) (*)) @@ -439,9 +449,11 @@ bounded by start and end, which must be numeric bounding-indices." (copy-to-buffer sequence offset amount buffer 0)) (setf (md5-state-buffer-index state) amount)))))) (setf (md5-state-amount state) - #-md5-small-length (+ (md5-state-amount state) length) + #-md5-small-length (+ (md5-state-amount state) + (the fixnum (- end start))) #+md5-small-length (the (unsigned-byte 29) - (+ (md5-state-amount state) length))) + (+ (md5-state-amount state) + (the fixnum (- end start))))) state)) (defun finalize-md5-state (state)