aes.h 661 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. #pragma once
  7. #include <stdint.h>
  8. #include <stdbool.h>
  9. #ifdef __cplusplus
  10. extern "C" {
  11. #endif
  12. enum AES_TYPE {
  13. AES_ENC,
  14. AES_DEC,
  15. };
  16. enum AES_BITS {
  17. AES128,
  18. AES192,
  19. AES256
  20. };
  21. void ets_aes_enable(void);
  22. void ets_aes_disable(void);
  23. int ets_aes_setkey(enum AES_TYPE type, const void *key, enum AES_BITS bits);
  24. int ets_aes_setkey_enc(const void *key, enum AES_BITS bits);
  25. int ets_aes_setkey_dec(const void *key, enum AES_BITS bits);
  26. void ets_aes_block(const void *input, void *output);
  27. #ifdef __cplusplus
  28. }
  29. #endif