Commits

Anonymous committed 356264d

Correct over-long hex character usage, packages.

Comments (0)

Files changed (5)

+2008-07-16  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* ascii-armor.el:
+	* ascii-armor.el (ascii-armor-to-vec16):
+	* md5-old.el (md5-i2):
+	* md5-old.el (md5<<<):
+	* md5-old.el (md5+):
+	* md5-old.el (md5-t):
+	* md5-old.el (md5-vector):
+	* rc16.el (rc16-set-key):
+	* rc16.el (rc16-mixin):
+	* rc16.el (rc16-short):
+	* sha1-old.el (sha1):
+	* sha1-old.el (sha1<<<):
+	* sha1-old.el (sha1+):
+	* sha1-old.el (sha1-vector):
+	Don't try to use character syntax for integers above #xFF, use
+	integer hex syntax instead.
+
 2005-09-26  Norbert Koch  <viteno@xemacs.org>
 
 	* Makefile (VERSION): XEmacs package 0.20 released.
       (aset out-vec out-idx (ash buf (- 16 bits-in-buf)))
       (decf bits-in-buf 16)
       ;; turn off the used bits
-      (setq buf (logand buf (lognot (ash ?\xffff bits-in-buf)))))
+      (setq buf (logand buf (lognot (ash #xffff bits-in-buf)))))
 
     out-vec))
 
 	  (logior x
 		  ;; this is normally a lognot, but that would set
 		  ;; high bits, and there's no logand to clear them.
-		  (logxor z ?\xffff))))
+		  (logxor z #xffff))))
 
 (defsubst md5-f (x y z)
   (cons (md5-f2 (car x) (car y) (car z))
       (rotatef a b)
       (decf shift 16))
 
-    (cons (logand ?\xffff (logior (ash a shift) (ash b (- shift 16))))
-	  (logand ?\xffff (logior (ash b shift) (ash a (- shift 16)))))))
+    (cons (logand #xffff (logior (ash a shift) (ash b (- shift 16))))
+	  (logand #xffff (logior (ash b shift) (ash a (- shift 16)))))))
 
 (defsubst md5+ (&rest args)
   ;; enough room to just add without carry checks
   (let* ((lo (apply #'+ (mapcar #'cdr args)))
 	 (hi (+ (ash lo -16) (apply #'+ (mapcar #'car args)))))
-    (cons (logand ?\xffff hi)
-	  (logand ?\xffff lo))))
+    (cons (logand #xffff hi)
+	  (logand #xffff lo))))
 
 ;; array of values for i=[1..64] => floor(2^32 * abs(sin(i)))
 (defconst md5-t
 
-  [(?\xd76a . ?\xa478)
-   (?\xe8c7 . ?\xb756)
-   (?\x2420 . ?\x70db)
-   (?\xc1bd . ?\xceee)
-   (?\xf57c . ?\x0faf)
-   (?\x4787 . ?\xc62a)
-   (?\xa830 . ?\x4613)
-   (?\xfd46 . ?\x9501)
-   (?\x6980 . ?\x98d8)
-   (?\x8b44 . ?\xf7af)
-   (?\xffff . ?\x5bb1)
-   (?\x895c . ?\xd7be)
-   (?\x6b90 . ?\x1122)
-   (?\xfd98 . ?\x7193)
-   (?\xa679 . ?\x438e)
-   (?\x49b4 . ?\x0821)
+  [(#xd76a . #xa478)
+   (#xe8c7 . #xb756)
+   (#x2420 . #x70db)
+   (#xc1bd . #xceee)
+   (#xf57c . #x0faf)
+   (#x4787 . #xc62a)
+   (#xa830 . #x4613)
+   (#xfd46 . #x9501)
+   (#x6980 . #x98d8)
+   (#x8b44 . #xf7af)
+   (#xffff . #x5bb1)
+   (#x895c . #xd7be)
+   (#x6b90 . #x1122)
+   (#xfd98 . #x7193)
+   (#xa679 . #x438e)
+   (#x49b4 . #x0821)
 
-   (?\xf61e . ?\x2562)
-   (?\xc040 . ?\xb340)
-   (?\x265e . ?\x5a51)
-   (?\xe9b6 . ?\xc7aa)
-   (?\xd62f . ?\x105d)
-   (?\x0244 . ?\x1453)
-   (?\xd8a1 . ?\xe681)
-   (?\xe7d3 . ?\xfbc8)
-   (?\x21e1 . ?\xcde6)
-   (?\xc337 . ?\x07d6)
-   (?\xf4d5 . ?\x0d87)
-   (?\x455a . ?\x14ed)
-   (?\xa9e3 . ?\xe905)
-   (?\xfcef . ?\xa3f8)
-   (?\x676f . ?\x02d9)
-   (?\x8d2a . ?\x4c8a)
+   (#xf61e . #x2562)
+   (#xc040 . #xb340)
+   (#x265e . #x5a51)
+   (#xe9b6 . #xc7aa)
+   (#xd62f . #x105d)
+   (#x0244 . #x1453)
+   (#xd8a1 . #xe681)
+   (#xe7d3 . #xfbc8)
+   (#x21e1 . #xcde6)
+   (#xc337 . #x07d6)
+   (#xf4d5 . #x0d87)
+   (#x455a . #x14ed)
+   (#xa9e3 . #xe905)
+   (#xfcef . #xa3f8)
+   (#x676f . #x02d9)
+   (#x8d2a . #x4c8a)
 
-   (?\xfffa . ?\x3942)
-   (?\x8771 . ?\xf681)
-   (?\x6d9d . ?\x6122)
-   (?\xfde5 . ?\x380c)
-   (?\xa4be . ?\xea44)
-   (?\x4bde . ?\xcfa9)
-   (?\xf6bb . ?\x4b60)
-   (?\xbebf . ?\xbc70)
-   (?\x289b . ?\x7ec6)
-   (?\xeaa1 . ?\x27fa)
-   (?\xd4ef . ?\x3085)
-   (?\x0488 . ?\x1d05)
-   (?\xd9d4 . ?\xd039)
-   (?\xe6db . ?\x99e5)
-   (?\x1fa2 . ?\x7cf8)
-   (?\xc4ac . ?\x5665)
+   (#xfffa . #x3942)
+   (#x8771 . #xf681)
+   (#x6d9d . #x6122)
+   (#xfde5 . #x380c)
+   (#xa4be . #xea44)
+   (#x4bde . #xcfa9)
+   (#xf6bb . #x4b60)
+   (#xbebf . #xbc70)
+   (#x289b . #x7ec6)
+   (#xeaa1 . #x27fa)
+   (#xd4ef . #x3085)
+   (#x0488 . #x1d05)
+   (#xd9d4 . #xd039)
+   (#xe6db . #x99e5)
+   (#x1fa2 . #x7cf8)
+   (#xc4ac . #x5665)
 
-   (?\xf429 . ?\x2244)
-   (?\x432a . ?\xff97)
-   (?\xab94 . ?\x23a7)
-   (?\xfc93 . ?\xa039)
-   (?\x655b . ?\x59c3)
-   (?\x8f0c . ?\xcc92)
-   (?\xffef . ?\xf47d)
-   (?\x8584 . ?\x5dd1)
-   (?\x6fa8 . ?\x7e4f)
-   (?\xfe2c . ?\xe6e0)
-   (?\xa301 . ?\x4314)
-   (?\x4e08 . ?\x11a1)
-   (?\xf753 . ?\x7e82)
-   (?\xbd3a . ?\xf235)
-   (?\x2ad7 . ?\xd2bb)
-   (?\xeb86 . ?\xd391)])
+   (#xf429 . #x2244)
+   (#x432a . #xff97)
+   (#xab94 . #x23a7)
+   (#xfc93 . #xa039)
+   (#x655b . #x59c3)
+   (#x8f0c . #xcc92)
+   (#xffef . #xf47d)
+   (#x8584 . #x5dd1)
+   (#x6fa8 . #x7e4f)
+   (#xfe2c . #xe6e0)
+   (#xa301 . #x4314)
+   (#x4e08 . #x11a1)
+   (#xf753 . #x7e82)
+   (#xbd3a . #xf235)
+   (#x2ad7 . #xd2bb)
+   (#xeb86 . #xd391)])
 
 (eval-and-compile
   (defun md5-rewrite (fun w x y z vec-idx shift)
 
 (defun md5-vector (vec)
   ;; initialize the chaining variables
-  (let ((a (cons ?\x6745 ?\x2301))
-	(b (cons ?\xefcd ?\xab89))
-	(c (cons ?\x98ba ?\xdcfe))
-	(d (cons ?\x1032 ?\x5476))
+  (let ((a (cons #x6745 #x2301))
+	(b (cons #xefcd #xab89))
+	(c (cons #x98ba #xdcfe))
+	(d (cons #x1032 #x5476))
 	(v-offset 0))
 
     (dotimes (count (/ (length vec) 16))
       (incf v-offset 16))
 
     ;; swap back from LSB-first.  i feel ill.
-    (mapconcat #'(lambda (x) (format "%02x%02x" (logand ?\xff x) (ash x -8)))
+    (mapconcat #'(lambda (x) (format "%02x%02x" (logand #xff x) (ash x -8)))
 	       (list (cdr a) (car a)
 		     (cdr b) (car b)
 		     (cdr c) (car c)
 	  temp1 temp2)
       (while (< counter 65536)
 	(setq temp1 (aref state counter))
-	(setq stateidx (logand ?\xffff (+ stateidx temp1 (aref key keyidx))))
+	(setq stateidx (logand #xffff (+ stateidx temp1 (aref key keyidx))))
 	(setq temp2 (aref state stateidx))
 	(aset state stateidx temp1)
 	(aset state counter temp2)
 ;; added by Ray.  is this a good thing?
 (defun rc16-mixin (context val)
   (let* ((state (rc16-context-state context))
-	 (x (logand ?\xffff (1+ (rc16-context-x context))))
+	 (x (logand #xffff (1+ (rc16-context-x context))))
 	 (sx (aref state x))
-	 (y (logand ?\xffff 
+	 (y (logand #xffff 
 		    (logxor val
 			    (+ sx (rc16-context-y context)))))
 	 (sy (aref state y)))
 ;; return a random value
 (defun rc16-short (context)
   (let* ((state (rc16-context-state context))
-	 (x (logand ?\xffff (1+ (rc16-context-x context))))
+	 (x (logand #xffff (1+ (rc16-context-x context))))
 	 (sx (aref state x))
-	 (y (logand ?\xffff (+ sx (rc16-context-y context))))
+	 (y (logand #xffff (+ sx (rc16-context-y context))))
 	 (sy (aref state y)))
     (rc16-context-set-x context x)
     (rc16-context-set-y context y)
     (aset state y sx)
     (aset state x sy)
-    (aref state (logand ?\xffff (+ sx sy)))))
+    (aref state (logand #xffff (+ sx sy)))))
 
 (defun rc16-encrypt (context data)
   (let* ((cipher (make-string (length data) 0))
     ;; slightly hairier math when writing the length into len-string.
 
     (dotimes (idx 4)
-      (aset len-string (+ 4 idx) (logand ?\xff
+      (aset len-string (+ 4 idx) (logand #xff
 				   (ash length (+ -21 (* 8 idx))))))
 
     (sha1-vector
   (let ((a (car val))
 	(b (cdr val)))
     ;; only three cases ever occur
-    (cond ((= shift 1) (cons (logand ?\xffff (logior (ash a 1) (ash b -15)))
-			     (logand ?\xffff (logior (ash b 1) (ash a -15)))))
-	  ((= shift 5) (cons (logand ?\xffff (logior (ash a 5) (ash b -11)))
-			     (logand ?\xffff (logior (ash b 5) (ash a -11)))))
+    (cond ((= shift 1) (cons (logand #xffff (logior (ash a 1) (ash b -15)))
+			     (logand #xffff (logior (ash b 1) (ash a -15)))))
+	  ((= shift 5) (cons (logand #xffff (logior (ash a 5) (ash b -11)))
+			     (logand #xffff (logior (ash b 5) (ash a -11)))))
 	  ;; shift = 30, which is a swap and a shift by 14
-	  (t (cons (logand ?\xffff (logior (ash b 14) (ash a -2)))
-		   (logand ?\xffff (logior (ash a 14) (ash b -2))))))))
+	  (t (cons (logand #xffff (logior (ash b 14) (ash a -2)))
+		   (logand #xffff (logior (ash a 14) (ash b -2))))))))
 
 (defsubst sha1+ (&rest args)
   ;; since we only use 16 bits, there's enough room to just add
   ;; without carry checks for each add.
   (let* ((lo (apply #'+ (mapcar #'cdr args)))
 	 (hi (+ (ash lo -16) (apply #'+ (mapcar #'car args)))))
-    (cons (logand ?\xffff hi)
-	  (logand ?\xffff lo))))
+    (cons (logand #xffff hi)
+	  (logand #xffff lo))))
 
 (defsubst sha1-logxor4 (a b c d)
   (cons (logxor (car a) (car b) (car c) (car d))
 
 (defun sha1-vector (vec)
   ;; initialize the chaining variables
-  (let ((a (cons ?\x6745 ?\x2301))
-	(b (cons ?\xefcd ?\xab89))
-	(c (cons ?\x98ba ?\xdcfe))
-	(d (cons ?\x1032 ?\x5476))
-	(e (cons ?\xc3d2 ?\xe1f0))
+  (let ((a (cons #x6745 #x2301))
+	(b (cons #xefcd #xab89))
+	(c (cons #x98ba #xdcfe))
+	(d (cons #x1032 #x5476))
+	(e (cons #xc3d2 #xe1f0))
 	(w (make-vector 80 0))
 	(v-offset 0))
 
 	(dotimes (count 20)
 ;;	  (insert (format "%s %s %s %s %s\n"
 ;;			  a b c d e))
-	  (sha1-rewrite sha1-f1 '(?\x5a82 . ?\x7999)))
+	  (sha1-rewrite sha1-f1 '(#x5a82 . #x7999)))
 
 	(dotimes (count 20)
-	  (sha1-rewrite sha1-f2&4 '(?\x6ed9 . ?\xeba1)))
+	  (sha1-rewrite sha1-f2&4 '(#x6ed9 . #xeba1)))
 
 	(dotimes (count 20)
-	  (sha1-rewrite sha1-f3 '(?\x8f1b . ?\xbcdc)))
+	  (sha1-rewrite sha1-f3 '(#x8f1b . #xbcdc)))
 
 	(dotimes (count 20)
-	  (sha1-rewrite sha1-f2&4 '(?\xca62 . ?\xc1d6)))
+	  (sha1-rewrite sha1-f2&4 '(#xca62 . #xc1d6)))
 
 	(setq a (sha1+ AA a)
 	      b (sha1+ BB b)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.