cipher_aes.h 2.1 KB

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