Add PowerPC crypto acceleration support for SHA2.
Needs ReviewPublic

Authored by slandden on May 24 2019, 6:06 AM.

Details

Summary

Parent D490

There is also a Power assembly version available for <= POWER 7,
but it was not ported.

I am getting ~10% improovement on sha256 and 40% improovement on sha512.

Before:

|  nanosecs/byte   mebibytes/sec   cycles/byte  auto Mhz

SHA224 | 3.24 ns/B 293.9 MiB/s 6.15 c/B 1895
SHA256 | 3.24 ns/B 294.7 MiB/s 6.11 c/B 1887
SHA384 | 2.69 ns/B 354.8 MiB/s 5.10 c/B 1895
SHA512 | 2.69 ns/B 354.7 MiB/s 5.10 c/B 1895

After:

|  nanosecs/byte   mebibytes/sec   cycles/byte  auto Mhz

SHA224 | 2.91 ns/B 327.4 MiB/s 5.52 c/B 1895
SHA256 | 2.92 ns/B 326.1 MiB/s 5.54 c/B 1895
SHA384 | 1.82 ns/B 523.4 MiB/s 3.45 c/B 1895
SHA512 | 1.82 ns/B 525.0 MiB/s 3.44 c/B 1895

Fixes T4530

Test Plan

This is integrated into the existing tests, and they all pass. I modified the benchmark.c program to benchmark the hashes, but I wasn't happy with the code quality enough to submit that.

Diff Detail

Repository
rC libgcrypt
Lint
Lint Skipped
Unit
Unit Tests Skipped
slandden created this revision.May 24 2019, 6:06 AM
slandden edited the summary of this revision. (Show Details)
slandden planned changes to this revision.May 24 2019, 6:31 AM

Didn't do sufficient testing.

slandden updated this revision to Diff 1389.May 24 2019, 9:03 PM

Fix alignment needs of vcrypto instructions.

slandden updated this revision to Diff 1393.May 28 2019, 1:35 AM
slandden edited the summary of this revision. (Show Details)

fix build with a fixup that got applied twice. better benchmarks

slandden updated this revision to Diff 1404.Jun 4 2019, 7:11 PM

include missing file.