Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 

49 linhas
1.1 KiB

  1. #ifndef AES_H
  2. #define AES_H
  3. #include <stdint.h>
  4. #include <stdlib.h>
  5. #define AES128_KEYBYTES 16
  6. #define AES192_KEYBYTES 24
  7. #define AES256_KEYBYTES 32
  8. #define AESCTR_NONCEBYTES 12
  9. #define AES_BLOCKBYTES 16
  10. typedef struct {
  11. uint64_t sk_exp[88];
  12. } aes128ctx;
  13. typedef struct {
  14. uint64_t sk_exp[104];
  15. } aes192ctx;
  16. typedef struct {
  17. uint64_t sk_exp[120];
  18. } aes256ctx;
  19. void aes128_keyexp(aes128ctx *r, const unsigned char *key);
  20. void aes128_ecb(unsigned char *out, const unsigned char *in, size_t nblocks, const aes128ctx *ctx);
  21. void aes128_ctr(unsigned char *out, size_t outlen, const unsigned char *iv, const aes128ctx *ctx);
  22. void aes192_keyexp(aes192ctx *r, const unsigned char *key);
  23. void aes192_ecb(unsigned char *out, const unsigned char *in, size_t nblocks, const aes192ctx *ctx);
  24. void aes192_ctr(unsigned char *out, size_t outlen, const unsigned char *iv, const aes192ctx *ctx);
  25. void aes256_keyexp(aes256ctx *r, const unsigned char *key);
  26. void aes256_ecb(unsigned char *out, const unsigned char *in, size_t nblocks, const aes256ctx *ctx);
  27. void aes256_ctr(unsigned char *out, size_t outlen, const unsigned char *iv, const aes256ctx *ctx);
  28. #endif