Commit 75a2ff15 authored by Niels Möller's avatar Niels Möller
Browse files

(EXPAND): Fixed the rotation part of the

data expansion.

Rev: src/nettle/x86/sha1-compress.asm:1.2
parent 22092275
......@@ -34,16 +34,18 @@ define(<K3>, <<$>0x8F1BBCDC>) C Rounds 40-59
define(<K4>, <<$>0xCA62C1D6>) C Rounds 60-79
C expand(i) is the expansion function
C
C W[i] = W[i - 16] ^ W[i - 14] ^ W[i - 8] ^ W[i - 3]
C W[i] = (W[i - 16] ^ W[i - 14] ^ W[i - 8] ^ W[i - 3]) <<< 1
C
C where W[i] is stored in DATA[i & 15].
C
C Result is stored back in W[i], and also left in TMP, the only register that is used.
C Result is stored back in W[i], and also left in TMP, the only
C register that is used.
define(<EXPAND>, <
movl eval(4 * ($1 & 15)) (DATA), TMP
xorl eval(4 * (($1 + 2) & 15)) (DATA), TMP
xorl eval(4 * (($1 + 8) & 15)) (DATA), TMP
xorl eval(4 * (($1 + 13) & 15)) (DATA), TMP
roll <$>1, TMP
movl TMP, eval(4 * ($1 & 15)) (DATA)
>)dnl
define(<NOEXPAND>, <eval(4 * ($1 & 15)) (DATA)>)dnl
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment