X-Git-Url: http://git.chise.org/gitweb/?p=elisp%2Flemi.git;a=blobdiff_plain;f=mail%2Fhmac-sha1.el;fp=mail%2Fhmac-sha1.el;h=70b665f822ac3e5fc2bc1e3e4c0cbbefc6fadf04;hp=00fe338c86c2637c344ff4fc9a7e8b52b2dc328e;hb=52bffc6e896ff5f2aa60b3458db367a91204b37c;hpb=c24db2f3e7e8819e055ecb7349743101b867d429 diff --git a/mail/hmac-sha1.el b/mail/hmac-sha1.el index 00fe338..70b665f 100644 --- a/mail/hmac-sha1.el +++ b/mail/hmac-sha1.el @@ -65,14 +65,21 @@ (eval-when-compile (require 'hmac-def)) (require 'hex-util) ; (decode-hex-string STRING) -(require 'sha1) ; expects (sha1-binary STRING) +(require 'sha1) ; expects (sha1 STRING) -;;; (defun sha1-binary (string) -;;; "Return the SHA1 of STRING in binary form." -;;; (decode-hex-string (sha1 string))) +;; To share *.elc files between Emacs w/ and w/o DL patch, +;; this check must be done at load-time. +(cond + ((fboundp 'sha1-binary) + ;; do nothing. + ) + (t + (defun sha1-binary (string) + "Return the SHA1 of STRING in binary form." + (decode-hex-string (sha1 string))))) (define-hmac-function hmac-sha1 sha1-binary 64 20) ; => (hmac-sha1 TEXT KEY) -;; (define-hmac-function hmac-sha1-96 sha1-binary 64 20 96) +(define-hmac-function hmac-sha1-96 sha1-binary 64 20 96) (provide 'hmac-sha1)