cipher_aes_xts.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  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 "crypto/aes_platform.h"
  12. /*
  13. * Available in cipher_fips.c, and compiled with different values depending
  14. * on we're in the FIPS module or not.
  15. */
  16. extern const int ossl_aes_xts_allow_insecure_decrypt;
  17. PROV_CIPHER_FUNC(void, xts_stream,
  18. (const unsigned char *in, unsigned char *out, size_t len,
  19. const AES_KEY *key1, const AES_KEY *key2,
  20. const unsigned char iv[16]));
  21. typedef struct prov_aes_xts_ctx_st {
  22. PROV_CIPHER_CTX base; /* Must be first */
  23. union {
  24. OSSL_UNION_ALIGN;
  25. AES_KEY ks;
  26. } ks1, ks2; /* AES key schedules to use */
  27. XTS128_CONTEXT xts;
  28. OSSL_xts_stream_fn stream;
  29. } PROV_AES_XTS_CTX;
  30. const PROV_CIPHER_HW *ossl_prov_cipher_hw_aes_xts(size_t keybits);