Permalink
Browse files

move MASSAGE-SYMBOL to a common place

Turns out ciphers--via (SETF %FIND-CIPHER)--and digests need it.  The
new directory structure hid that, and it must have worked by accident
earlier due to ASDF's dependency traversal.  Tidy up some dependencies
while we're at it.
  • Loading branch information...
1 parent 764f4d5 commit d57e9fe48a469dc3901d0849e03840940e9f5002 @froydnj committed Nov 15, 2009
Showing with 12 additions and 12 deletions.
  1. +3 −3 ironclad.asd
  2. +0 −9 src/digests/digest.lisp
  3. +9 −0 src/macro-utils.lisp
View
@@ -50,7 +50,7 @@
(:file "padding" :depends-on ("common"))
(:file "pkcs5" :depends-on ("common"))
(:module "ciphers"
- :depends-on ("package" "common" "macro-utils")
+ :depends-on ("common" "macro-utils")
:components
(
;; block ciphers of various kinds
@@ -74,7 +74,7 @@
;; stream ciphers
(:file "arcfour" :depends-on ("cipher"))))
(:module "digests"
- :depends-on ("package" "common")
+ :depends-on ("common" "macro-utils")
:components
((:file "digest")
(:file "crc24" :depends-on ("digest"))
@@ -91,7 +91,7 @@
(:file "tiger" :depends-on ("digest"))
(:file "whirlpool" :depends-on ("digest"))))
(:module "macs"
- :depends-on ("package" "common" "digests")
+ :depends-on ("common" "digests")
:components
((:file "hmac")
(:file "cmac")))
@@ -342,15 +342,6 @@ An error will be signaled if there is insufficient room in DIGEST."))
(defgeneric digest-length (digest)
(:documentation "Return the number of bytes in a digest generated by DIGEST."))
-(defun massage-symbol (symbol)
- (let ((package (symbol-package symbol))
- (ironclad (load-time-value (find-package :ironclad))))
- (cond
- ((eq package ironclad) symbol)
- ((eq package (load-time-value (find-package :keyword)))
- (find-symbol (symbol-name symbol) ironclad))
- (t nil))))
-
(defmethod digest-length ((digest-name symbol))
(or (digestp (massage-symbol digest-name))
(error 'unsupported-digest :name digest-name)))
@@ -8,3 +8,12 @@
(defun unquote (thing)
(if (quotationp thing) (second thing) thing))
+
+(defun massage-symbol (symbol)
+ (let ((package (symbol-package symbol))
+ (ironclad (load-time-value (find-package :ironclad))))
+ (cond
+ ((eq package ironclad) symbol)
+ ((eq package (load-time-value (find-package :keyword)))
+ (find-symbol (symbol-name symbol) ironclad))
+ (t nil))))

0 comments on commit d57e9fe

Please sign in to comment.