You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
445B

  1. #ifndef AES128_H
  2. #define AES128_H
  3. #ifdef CONFIG_GCRYPT
  4. #include <gcrypt.h>
  5. typedef struct {
  6. gcry_cipher_hd_t ch;
  7. } AES128Context;
  8. #else
  9. typedef struct {
  10. uint32_t multbl[4][256];
  11. uint8_t subst[256];
  12. uint8_t key[11][16];
  13. } AES128Context;
  14. #endif
  15. AES128Context *aes128_init(void);
  16. void aes128_set_key(AES128Context *c, const uint8_t *key);
  17. void aes128_cbc_decrypt(AES128Context *c, uint8_t *mem, int blockcnt, uint8_t *IV);
  18. #endif