mirror of
https://github.com/pmai/sha3.git
synced 2025-12-21 15:24:28 +01:00
Add specific declarations, switch 16bit SBCL to not use rotate-byte.
This commit is contained in:
@ -145,7 +145,7 @@
|
|||||||
(declare (fixnum y))
|
(declare (fixnum y))
|
||||||
(dotimes (x #.+keccak-state-columns+)
|
(dotimes (x #.+keccak-state-columns+)
|
||||||
(declare (fixnum x))
|
(declare (fixnum x))
|
||||||
(let* ((element (+ (* y +keccak-state-columns+) x))
|
(let* ((element (+ (the fixnum (* y +keccak-state-columns+)) x))
|
||||||
(part (* element +keccak-state-splits+))
|
(part (* element +keccak-state-splits+))
|
||||||
(offset (* element +keccak-1600-lane-byte-width+))
|
(offset (* element +keccak-1600-lane-byte-width+))
|
||||||
(index (the fixnum (+ start offset))))
|
(index (the fixnum (+ start offset))))
|
||||||
@ -284,11 +284,6 @@
|
|||||||
#.*optimize-declaration*
|
#.*optimize-declaration*
|
||||||
#+sbcl
|
#+sbcl
|
||||||
(sb-ext:muffle-conditions sb-ext:code-deletion-note))
|
(sb-ext:muffle-conditions sb-ext:code-deletion-note))
|
||||||
#+(and xxx sbcl)
|
|
||||||
(if (or (zerop offset) (= offset 16))
|
|
||||||
value
|
|
||||||
(sb-rotate-byte:rotate-byte offset (byte 16 0) value))
|
|
||||||
#-(and xxx sbcl)
|
|
||||||
(if (or (zerop offset) (= offset 16))
|
(if (or (zerop offset) (= offset 16))
|
||||||
value
|
value
|
||||||
(logior (the keccak-1600-part (ash (ldb (byte (- 16 offset) 0) value) offset))
|
(logior (the keccak-1600-part (ash (ldb (byte (- 16 offset) 0) value) offset))
|
||||||
|
|||||||
@ -139,7 +139,7 @@
|
|||||||
(declare (fixnum y))
|
(declare (fixnum y))
|
||||||
(dotimes (x #.+keccak-state-columns+)
|
(dotimes (x #.+keccak-state-columns+)
|
||||||
(declare (fixnum x))
|
(declare (fixnum x))
|
||||||
(let* ((element (+ (* y +keccak-state-columns+) x))
|
(let* ((element (+ (the fixnum (* y +keccak-state-columns+)) x))
|
||||||
(part (* element +keccak-state-splits+))
|
(part (* element +keccak-state-splits+))
|
||||||
(offset (* element +keccak-1600-lane-byte-width+))
|
(offset (* element +keccak-1600-lane-byte-width+))
|
||||||
(index (the fixnum (+ start offset))))
|
(index (the fixnum (+ start offset))))
|
||||||
|
|||||||
@ -77,7 +77,7 @@
|
|||||||
(declare (type (integer 0 200) rate-bytes))
|
(declare (type (integer 0 200) rate-bytes))
|
||||||
(dotimes (y +keccak-state-rows+)
|
(dotimes (y +keccak-state-rows+)
|
||||||
(dotimes (x +keccak-state-columns+)
|
(dotimes (x +keccak-state-columns+)
|
||||||
(let* ((element (+ (* y +keccak-state-columns+) x))
|
(let* ((element (+ (the fixnum (* y +keccak-state-columns+)) x))
|
||||||
(offset (* element +keccak-1600-lane-byte-width+))
|
(offset (* element +keccak-1600-lane-byte-width+))
|
||||||
(index (the fixnum (+ start offset))))
|
(index (the fixnum (+ start offset))))
|
||||||
(when (>= offset rate-bytes)
|
(when (>= offset rate-bytes)
|
||||||
|
|||||||
Reference in New Issue
Block a user