]> git.ipfire.org Git - thirdparty/nettle.git/commit
powerpc64: Add optimized assembly for sha256-compress-n ppc64-sha256
authorEric Richter <erichte@linux.ibm.com>
Tue, 4 Jun 2024 20:55:26 +0000 (15:55 -0500)
committerNiels Möller <nisse@lysator.liu.se>
Sun, 9 Jun 2024 09:55:41 +0000 (11:55 +0200)
commit97aa88c76cd309c2df16c22ce6e80c81acc00882
treef41c2856bd06976d61cf141815421336e98684f7
parentc4b730730daa279bf88f88e7ad37d5b28159c0b4
powerpc64: Add optimized assembly for sha256-compress-n

This patch introduces an optimized powerpc64 assembly implementation for
sha256-compress-n. This takes advantage of the vshasigma instruction, as
well as unrolling loops to best take advantage of running instructions
in parallel.

The following data was captured on a POWER 10 LPAR @ ~3.896GHz

Current C implementation:
         Algorithm         mode Mbyte/s
            sha256       update  280.97
       hmac-sha256     64 bytes   80.81
       hmac-sha256    256 bytes  170.50
       hmac-sha256   1024 bytes  241.92
       hmac-sha256   4096 bytes  268.54
       hmac-sha256   single msg  276.16

With optimized assembly:
         Algorithm         mode Mbyte/s
            sha256       update  461.45
       hmac-sha256     64 bytes  123.88
       hmac-sha256    256 bytes  268.81
       hmac-sha256   1024 bytes  390.91
       hmac-sha256   4096 bytes  438.02
       hmac-sha256   single msg  453.83

Signed-off-by: Eric Richter <erichte@linux.ibm.com>
fat-ppc.c
powerpc64/fat/sha256-compress-n-2.asm [new file with mode: 0644]
powerpc64/p8/sha256-compress-n.asm [new file with mode: 0644]