You are not logged in.
Pages: 1
Win64 ABI violation in SBlockMix (mormot.crypt.other.pas, ASMSSE2)
x86_64 SBlockMix uses xmm8..xmm11 and never restores them. On Win64 those are callee-saved, so SCrypt() silently corrupts the caller's FP state.
The hash stays correct, so no vector test catches it a build with only the restore removed still passes all of RFC 7914.
Fix, once per call outside the R-loop:
sub rsp, 72
movaps [rsp], xmm8
movaps [rsp + 10H], xmm9
movaps [rsp + 20H], xmm10
movaps [rsp + 30H], xmm11
... body unchanged ...
movaps xmm8, [rsp]
movaps xmm9, [rsp + 10H]
movaps xmm10, [rsp + 20H]
movaps xmm11, [rsp + 30H]
add rsp, 72ps: rsi/rdi are callee-saved too and get push/pop'ed r10/r11 are volatile on both ABIs and remove that entirely.
Offline
agreed on the rule the other six are preserved already
since the routine never writes them
of xmm6..xmm15 it only touches xmm8..xmm11, and the probe loads all ten to confirm rest come back byte 1:1
ps. I do not use GH
Offline
Should be fine with
https://github.com/synopse/mORMot2/commit/2c1daf90d
Note that a patch file also works great.
With no GT from Micro$oft account needed. ![]()
Thanks for the feedback!
Offline
Pages: 1