2
0

cipher_aes_gcm.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * Copyright 2019-2020 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 char ares[16];
  30. unsigned char mres[16];
  31. unsigned char kres[16];
  32. int areslen;
  33. int mreslen;
  34. int kreslen;
  35. int res;
  36. } s390x;
  37. #endif /* defined(OPENSSL_CPUID_OBJ) && defined(__s390__) */
  38. } plat;
  39. } PROV_AES_GCM_CTX;
  40. const PROV_GCM_HW *ossl_prov_aes_hw_gcm(size_t keybits);