File tree Expand file tree Collapse file tree
HashLib/src/Include/Simd/SHA1 Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4242 // Save state for final addition
4343 movdqa xmm8, xmm0 // ABCD_SAVE
4444
45- // Load and byte-swap all 4 message blocks
45+ // Load, byte-swap, and reverse dword order for all 4 message blocks.
46+ // The per-dword BSWAP mask puts W[0] at [31:0], but sha1rnds4 reads
47+ // W[0] from [127:96]. The pshufd $1B reverses the dword order.
4648 movdqu xmm7, oword [r9] // BSWAP mask at offset 0
4749 movdqu xmm3, oword [rdx]
4850 pshufb xmm3, xmm7
51+ pshufd xmm3, xmm3, $1B
4952 movdqu xmm4, oword [rdx + $10 ]
5053 pshufb xmm4, xmm7
54+ pshufd xmm4, xmm4, $1B
5155 movdqu xmm5, oword [rdx + $20 ]
5256 pshufb xmm5, xmm7
57+ pshufd xmm5, xmm5, $1B
5358 movdqu xmm6, oword [rdx + $30 ]
5459 pshufb xmm6, xmm7
60+ pshufd xmm6, xmm6, $1B
5561
5662 // Save E for final addition (reuse xmm7)
5763 movdqa xmm7, xmm1 // E_SAVE
You can’t perform that action at this time.
0 commit comments