Skip to content

[S390x] Fat build support for AES and GHASH

Maamoun TK requested to merge mamonet/nettle:s390x-fat into s390x

This patch adds fat build support for AES and GHASH of S390x architecture. The patch does the following modifications:

  • Use conditional preprocessor directives in C files of AES-128, AES-192, and AES-256 for Encrypt, Decrypt, and Set Key functions.
  • Add fat overriding files in s390x/fat directory to include the optimized cores and rename the function names.
  • Update configure.ac and Makefile.in to support fat build for S390x architecture.
  • Add headers in fat-setup.h of AES-128, AES-192, and AES-256 for Crypt and Set/Invert Key functions.
  • Create fat-s390x.c file that redirect the execution to the supported functions at run-time which use the following facilities:
    • Use getauxval() and HWCAP_S390_STFLE macro to ensure that stfle instruction is supported on the running machine.
    • Execute stfle instruction to check if the corresponding message-security-assist extensions is supported (specifically MSA and MSA_X4).
    • Query the status of particular cipher instructions to check if certain cipher operations are supported (specifically KM for AES and KMID for GHASH).
    • Override particular cipher functions to the supported cores in case fat build is enabled.

Merge request reports