Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (load "~/quicklisp/setup.lisp")
- (ql:quickload "bit-smasher")
- (defparameter *lens*
- (append (map 'list #'char-code "129,154,49,198,200,133,97,254,41,6,2,1,255,0,191,108")
- '(17 31 73 47 23)))
- (defparameter *list*
- (loop for i upto 255 collect i))
- (rplacd (last *list*) *list*)
- (defparameter *lh* *list*)
- (defparameter *skp* 0)
- (defun reverseip (l len)
- (if (= len 0)
- l
- (let ((lt (nthcdr len l)))
- (rplacd (nthcdr (1- len) l) '())
- (loop
- for i from (1- (length l)) downto 0
- for j upto (1- (length l))
- do (if (or (< i j)
- (= i j))
- (return)
- (rotatef (nth j l) (nth i l))))
- (nconc l lt)
- l)))
- (dotimes (i 64)
- (dolist (len *lens*)
- (reverseip *list* len)
- (setf *list* (nthcdr (+ len *skp*) *list*))
- (incf *skp*)))
- (let ((denseh '()))
- (dotimes (i 16)
- (setf denseh
- (nconc denseh
- (list
- (reduce #'bit-xor
- (mapcar #'bit-smasher:bits<-
- (subseq *lh* (* 16 i) (+ (* 16 i) 16))))))))
- (format t "~{~a~}~%" (mapcar #'bit-smasher:bits->hex denseh)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement