From 9f8ae6743f261a51007a1048080f2d40282a4217 Mon Sep 17 00:00:00 2001 From: "Kevin M. Rosenberg" Date: Sat, 4 Dec 2004 18:27:59 +0000 Subject: [PATCH] r10181: Automated commit for Debian build of md5 upstream-version-1.8.5 --- debian/changelog | 6 ++++++ md5.lisp | 42 +++++++++++++++++++++++++----------------- 2 files changed, 31 insertions(+), 17 deletions(-) diff --git a/debian/changelog b/debian/changelog index 0defa9a..cdca01d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +cl-md5 (1.8.5-1) unstable; urgency=low + + * Patch from John Desoi for Lispworks compatibility + + -- Kevin M. Rosenberg Sat, 4 Dec 2004 11:27:47 -0700 + cl-md5 (1.8.4-1) unstable; urgency=medium * Patch from Andreas Fuchs on sbcl-devel which fixes segfault on sbcl diff --git a/md5.lisp b/md5.lisp index a7ce4a3..46ff79c 100644 --- a/md5.lisp +++ b/md5.lisp @@ -63,15 +63,22 @@ ;;; Section 2: Basic Datatypes +#-lispworks (eval-when (:compile-toplevel :load-toplevel :execute) (deftype ub32 () "Corresponds to the 32bit quantity word of the MD5 Spec" `(unsigned-byte 32))) -(defmacro assemble-ub32 (a b c d) - "Assemble an ub32 value from the given (unsigned-byte 8) values, +#+lispworks +(deftype ub32 () + "Corresponds to the 32bit quantity word of the MD5 Spec" + `(unsigned-byte 32)) + +(eval-when (:compile-toplevel :load-toplevel :execute) + (defmacro assemble-ub32 (a b c d) + "Assemble an ub32 value from the given (unsigned-byte 8) values, where a is the intended low-order byte and d the high-order byte." - `(the ub32 (logior (ash ,d 24) (ash ,c 16) (ash ,b 8) ,a))) + `(the ub32 (logior (ash ,d 24) (ash ,c 16) (ash ,b 8) ,a)))) ;;; Section 3.4: Auxilliary functions @@ -244,20 +251,6 @@ accordingly." ;;; Section 3.4: Converting 8bit-vectors into 16-Word Blocks (declaim (inline fill-block fill-block-ub8 fill-block-char)) -(defun fill-block (block buffer offset) - "Convert a complete 64 byte input vector segment into the given 16 -word MD5 block. This currently works on (unsigned-byte 8) and -character simple-arrays, via the functions `fill-block-ub8' and -`fill-block-char' respectively." - (declare (type (integer 0 #.(- most-positive-fixnum 64)) offset) - (type (simple-array ub32 (16)) block) - (type (simple-array * (*)) buffer) - (optimize (speed 3) (safety 0) (space 0) (debug 0))) - (etypecase buffer - ((simple-array (unsigned-byte 8) (*)) - (fill-block-ub8 block buffer offset)) - (simple-string - (fill-block-char block buffer offset)))) (defun fill-block-ub8 (block buffer offset) "Convert a complete 64 (unsigned-byte 8) input vector segment @@ -305,6 +298,21 @@ offset into the given 16 word MD5 block." (char-code (schar buffer (+ j 2))) (char-code (schar buffer (+ j 3))))))) +(defun fill-block (block buffer offset) + "Convert a complete 64 byte input vector segment into the given 16 +word MD5 block. This currently works on (unsigned-byte 8) and +character simple-arrays, via the functions `fill-block-ub8' and +`fill-block-char' respectively." + (declare (type (integer 0 #.(- most-positive-fixnum 64)) offset) + (type (simple-array ub32 (16)) block) + (type (simple-array * (*)) buffer) + (optimize (speed 3) (safety 0) (space 0) (debug 0))) + (etypecase buffer + ((simple-array (unsigned-byte 8) (*)) + (fill-block-ub8 block buffer offset)) + (simple-string + (fill-block-char block buffer offset)))) + ;;; Section 3.5: Message Digest Output (declaim (inline md5regs-digest)) -- 2.34.1