hc32_ll_aes.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. /**
  2. *******************************************************************************
  3. * @file hc32_ll_aes.h
  4. * @brief This file contains all the functions prototypes of the AES driver
  5. * library.
  6. @verbatim
  7. Change Logs:
  8. Date Author Notes
  9. 2022-12-31 CDT First version
  10. @endverbatim
  11. *******************************************************************************
  12. * Copyright (C) 2022, Xiaohua Semiconductor Co., Ltd. All rights reserved.
  13. *
  14. * This software component is licensed by XHSC under BSD 3-Clause license
  15. * (the "License"); You may not use this file except in compliance with the
  16. * License. You may obtain a copy of the License at:
  17. * opensource.org/licenses/BSD-3-Clause
  18. *
  19. *******************************************************************************
  20. */
  21. #ifndef __HC32_LL_AES_H__
  22. #define __HC32_LL_AES_H__
  23. /* C binding of definitions if building with C++ compiler */
  24. #ifdef __cplusplus
  25. extern "C"
  26. {
  27. #endif
  28. /*******************************************************************************
  29. * Include files
  30. ******************************************************************************/
  31. #include "hc32_ll_def.h"
  32. #include "hc32f4xx.h"
  33. #include "hc32f4xx_conf.h"
  34. /**
  35. * @addtogroup LL_Driver
  36. * @{
  37. */
  38. /**
  39. * @addtogroup LL_AES
  40. * @{
  41. */
  42. #if (LL_AES_ENABLE == DDL_ON)
  43. /*******************************************************************************
  44. * Global type definitions ('typedef')
  45. ******************************************************************************/
  46. /*******************************************************************************
  47. * Global pre-processor symbols/macros ('#define')
  48. ******************************************************************************/
  49. /**
  50. * @defgroup AES_Global_Macros AES Global Macros
  51. * @{
  52. */
  53. /**
  54. * @defgroup AES_Key_Size AES Key Size
  55. * @{
  56. */
  57. #define AES_KEY_SIZE_16BYTE (16U)
  58. #define AES_KEY_SIZE_24BYTE (24U)
  59. #define AES_KEY_SIZE_32BYTE (32U)
  60. /**
  61. * @}
  62. */
  63. /**
  64. * @}
  65. */
  66. /*******************************************************************************
  67. * Global variable definitions ('extern')
  68. ******************************************************************************/
  69. /*******************************************************************************
  70. Global function prototypes (definition in C source)
  71. ******************************************************************************/
  72. /**
  73. * @addtogroup AES_Global_Functions
  74. * @{
  75. */
  76. int32_t AES_Encrypt(const uint8_t *pu8Plaintext, uint32_t u32PlaintextSize,
  77. const uint8_t *pu8Key, uint8_t u8KeySize,
  78. uint8_t *pu8Ciphertext);
  79. int32_t AES_Decrypt(const uint8_t *pu8Ciphertext, uint32_t u32CiphertextSize,
  80. const uint8_t *pu8Key, uint8_t u8KeySize,
  81. uint8_t *pu8Plaintext);
  82. /**
  83. * @}
  84. */
  85. #endif /* LL_AES_ENABLE */
  86. /**
  87. * @}
  88. */
  89. /**
  90. * @}
  91. */
  92. #ifdef __cplusplus
  93. }
  94. #endif
  95. #endif /* __HC32_LL_AES_H__ */
  96. /*******************************************************************************
  97. * EOF (not truncated)
  98. ******************************************************************************/