cipher_aes_gcm.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
  3. *
  4. * Licensed under the Apache License 2.0 (the "License"). You may not use
  5. * this file except in compliance with the License. You can obtain a copy
  6. * in the file LICENSE in the source distribution or at
  7. * https://www.openssl.org/source/license.html
  8. */
  9. #include <openssl/aes.h>
  10. #include "prov/ciphercommon.h"
  11. #include "prov/ciphercommon_gcm.h"
  12. #include "crypto/aes_platform.h"
  13. typedef struct prov_aes_gcm_ctx_st {
  14. PROV_GCM_CTX base; /* must be first entry in struct */
  15. union {
  16. OSSL_UNION_ALIGN;
  17. AES_KEY ks;
  18. } ks; /* AES key schedule to use */
  19. /* Platform specific data */
  20. union {
  21. int dummy;
  22. #if defined(OPENSSL_CPUID_OBJ) && defined(__s390__)
  23. struct {
  24. union {
  25. OSSL_UNION_ALIGN;
  26. S390X_KMA_PARAMS kma;
  27. } param;
  28. unsigned int fc;
  29. unsigned int hsflag; /* hash subkey set flag */
  30. unsigned char ares[16];
  31. unsigned char mres[16];
  32. unsigned char kres[16];
  33. int areslen;
  34. int mreslen;
  35. int kreslen;
  36. int res;
  37. } s390x;
  38. #endif /* defined(OPENSSL_CPUID_OBJ) && defined(__s390__) */
  39. } plat;
  40. } PROV_AES_GCM_CTX;
  41. const PROV_GCM_HW *ossl_prov_aes_hw_gcm(size_t keybits);