liboqs icon indicating copy to clipboard operation
liboqs copied to clipboard

Common code for s390x / ppc64le, Windows

Open bhess opened this issue 2 years ago • 2 comments

Optimized common code is currently available for Intel x86-64 and Arm64v8: https://github.com/open-quantum-safe/liboqs/tree/main/src/common.

Re. other platforms: S390x [1] and ppc64le [2] in current revisions provide AES, SHA2 and SHA3 instruction sets. Work items to add optimized common code for these architectures are the following:

  • Integrate optimized AES, SHA2 and SHA3 to src/common, using the OQS API.
  • Implement CPU feature detection at build time (e.g. setting OQS_USE_S390X_AES_INSTRUCTIONS).
  • Implement CPU runtime feature detection for distribution builds.
  • Implement build-time and run-time switches for selecting optimized common code.
  • Update documentation.
  • Run appropriate tests (e.g. on TravisCI).

References: [1] z/Architecture Principles of Operation: http://publibfp.dhe.ibm.com/epubs/pdf/a227832c.pdf [2] Power ISA Version 3.1: https://ibm.ent.box.com/s/hhjfw0x0lrbtyzmiaffnbxh2fuo0fog0

bhess avatar Jun 23 '22 11:06 bhess

There's some Picnic code that could be lifted for SHA3/SHAKE support on s390x: https://github.com/IAIK/Picnic/blob/master/sha3/s390_cpacf.h. It doesn't have runtime detection yet, but can be used as basis.

sebastinas avatar Sep 08 '22 07:09 sebastinas

The AVX2 SHA-3 code doesn't work properly on Windows either. This was the reason for disabling SPHINCS+ AVX2 optimizations in Windows on #1478.

dstebila avatar May 25 '23 01:05 dstebila