From: okada Date: Mon, 6 Dec 1999 12:17:00 +0000 (+0000) Subject: hex-util.el sha1-el.el Fix. X-Git-Tag: slim-1_13_5~31 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=640b82c2120a99824a48e80c123481cf4c2f11b1;p=elisp%2Fflim.git hex-util.el sha1-el.el Fix. --- diff --git a/hex-util.el b/hex-util.el index 72ec56f..92a09ff 100644 --- a/hex-util.el +++ b/hex-util.el @@ -43,9 +43,9 @@ (dst (make-string (/ len 2) 0)) (idx 0)(pos 0)) (while (< pos len) -;;;; logior and lsh are not byte-coded. -;;;; (aset dst idx (logior (lsh (hex-char-to-num (aref string pos)) 4) -;;;; (hex-char-to-num (aref string (1+ pos))))) +;;; logior and lsh are not byte-coded. +;;; (aset dst idx (logior (lsh (hex-char-to-num (aref string pos)) 4) +;;; (hex-char-to-num (aref string (1+ pos))))) (aset dst idx (+ (* (hex-char-to-num (aref string pos)) 16) (hex-char-to-num (aref string (1+ pos))))) (setq idx (1+ idx) @@ -58,11 +58,11 @@ (dst (make-string (* len 2) 0)) (idx 0)(pos 0)) (while (< pos len) -;;;; logand and lsh are not byte-coded. -;;;; (aset dst idx (num-to-hex-char (logand (lsh (aref string pos) -4) 15))) +;;; logand and lsh are not byte-coded. +;;; (aset dst idx (num-to-hex-char (logand (lsh (aref string pos) -4) 15))) (aset dst idx (num-to-hex-char (/ (aref string pos) 16))) (setq idx (1+ idx)) -;;;; (aset dst idx (num-to-hex-char (logand (aref string pos) 15))) +;;; (aset dst idx (num-to-hex-char (logand (aref string pos) 15))) (aset dst idx (num-to-hex-char (% (aref string pos) 16))) (setq idx (1+ idx) pos (1+ pos))) diff --git a/sha1-el.el b/sha1-el.el index 1ff999f..96d52a3 100644 --- a/sha1-el.el +++ b/sha1-el.el @@ -95,21 +95,21 @@ It must be a string \(program name\) or list of strings \(name and its args\).") (defconst sha1-K3-high 51810) ; (string-to-number "CA62" 16) (defconst sha1-K3-low 49622) ; (string-to-number "C1D6" 16) -;;;; original definition of sha1-F0. -;;;; (defmacro sha1-F0 (B C D) -;;;; (` (logior (logand (, B) (, C)) -;;;; (logand (lognot (, B)) (, D))))) -;;;; a little optimization from GnuPG/cipher/sha1.c. +;;; original definition of sha1-F0. +;;; (defmacro sha1-F0 (B C D) +;;; (` (logior (logand (, B) (, C)) +;;; (logand (lognot (, B)) (, D))))) +;;; a little optimization from GnuPG/cipher/sha1.c. (defmacro sha1-F0 (B C D) (` (logxor (, D) (logand (, B) (logxor (, C) (, D)))))) (defmacro sha1-F1 (B C D) (` (logxor (, B) (, C) (, D)))) -;;;; original definition of sha1-F2. -;;;; (defmacro sha1-F2 (B C D) -;;;; (` (logior (logand (, B) (, C)) -;;;; (logand (, B) (, D)) -;;;; (logand (, C) (, D))))) -;;;; a little optimization from GnuPG/cipher/sha1.c. +;;; original definition of sha1-F2. +;;; (defmacro sha1-F2 (B C D) +;;; (` (logior (logand (, B) (, C)) +;;; (logand (, B) (, D)) +;;; (logand (, C) (, D))))) +;;; a little optimization from GnuPG/cipher/sha1.c. (defmacro sha1-F2 (B C D) (` (logior (logand (, B) (, C)) (logand (, D) (logior (, B) (, C))))))