2
0

cipher_aes.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. * Copyright 2019-2024 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 "crypto/aes_platform.h"
  12. typedef struct prov_aes_ctx_st {
  13. PROV_CIPHER_CTX base; /* Must be first */
  14. union {
  15. OSSL_UNION_ALIGN;
  16. AES_KEY ks;
  17. } ks;
  18. /* Platform specific data */
  19. union {
  20. int dummy;
  21. #if defined(OPENSSL_CPUID_OBJ) && defined(__s390__)
  22. struct {
  23. union {
  24. OSSL_UNION_ALIGN;
  25. /*-
  26. * KM-AES parameter block - begin
  27. * (see z/Architecture Principles of Operation >= SA22-7832-06)
  28. */
  29. struct {
  30. unsigned char k[32];
  31. } km;
  32. /* KM-AES parameter block - end */
  33. /*-
  34. * KMO-AES/KMF-AES parameter block - begin
  35. * (see z/Architecture Principles of Operation >= SA22-7832-08)
  36. */
  37. struct {
  38. unsigned char cv[16];
  39. unsigned char k[32];
  40. } kmo_kmf;
  41. /* KMO-AES/KMF-AES parameter block - end */
  42. } param;
  43. unsigned int fc;
  44. } s390x;
  45. #endif /* defined(OPENSSL_CPUID_OBJ) && defined(__s390__) */
  46. } plat;
  47. } PROV_AES_CTX;
  48. #define ossl_prov_cipher_hw_aes_ofb ossl_prov_cipher_hw_aes_ofb128
  49. #define ossl_prov_cipher_hw_aes_cfb ossl_prov_cipher_hw_aes_cfb128
  50. const PROV_CIPHER_HW *ossl_prov_cipher_hw_aes_ecb(size_t keybits);
  51. const PROV_CIPHER_HW *ossl_prov_cipher_hw_aes_cbc(size_t keybits);
  52. const PROV_CIPHER_HW *ossl_prov_cipher_hw_aes_ofb128(size_t keybits);
  53. const PROV_CIPHER_HW *ossl_prov_cipher_hw_aes_cfb128(size_t keybits);
  54. const PROV_CIPHER_HW *ossl_prov_cipher_hw_aes_cfb1(size_t keybits);
  55. const PROV_CIPHER_HW *ossl_prov_cipher_hw_aes_cfb8(size_t keybits);
  56. const PROV_CIPHER_HW *ossl_prov_cipher_hw_aes_ctr(size_t keybits);