According to the ABI, the stack pointer is quadword aligned, so starting
the stack storage at offset -8, may cause the return address to be
stepped on. Adjusting to use -16 as the starting point, which also
matches other POWER assembly code.

Signed-off-by: Eric Richter <[email protected]>
---
 powerpc64/p8/sha256-compress-n.asm | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/powerpc64/p8/sha256-compress-n.asm 
b/powerpc64/p8/sha256-compress-n.asm
index 309db1fa..e08ae132 100644
--- a/powerpc64/p8/sha256-compress-n.asm
+++ b/powerpc64/p8/sha256-compress-n.asm
@@ -216,8 +216,8 @@ PROLOGUE(_nettle_sha256_compress_n)
 
        C Store non-volatile registers
 
-       li      T0, -8
-       li      T1, -24
+       li      T0, -16
+       li      T1, -32
        stvx    v20, T0, SP
        stvx    v21, T1, SP
        subi    T0, T0, 32
@@ -321,8 +321,8 @@ PROLOGUE(_nettle_sha256_compress_n)
 
 
        C Restore nonvolatile registers
-       li      T0, -8
-       li      T1, -24
+       li      T0, -16
+       li      T1, -32
        lvx     v20, T0, SP
        lvx     v21, T1, SP
        subi    T0, T0, 32
-- 
2.46.0

_______________________________________________
nettle-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to