aes.h 741 B

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