crypto_aes.h 805 B

1234567891011121314151617181920212223242526272829303132
  1. #ifndef _CRYPTO_AES_H_
  2. #define _CRYPTO_AES_H_
  3. #include <stddef.h>
  4. #include <stdint.h>
  5. /* Opaque structure. */
  6. struct crypto_aes_key;
  7. /**
  8. * crypto_aes_key_expand(key, len):
  9. * Expand the ${len}-byte AES key ${key} into a structure which can be passed
  10. * to crypto_aes_encrypt_block. The length must be 16 or 32.
  11. */
  12. struct crypto_aes_key * crypto_aes_key_expand(const uint8_t *, size_t);
  13. /**
  14. * crypto_aes_encrypt_block(in, out, key):
  15. * Using the expanded AES key ${key}, encrypt the block ${in} and write the
  16. * resulting ciphertext to ${out}.
  17. */
  18. void crypto_aes_encrypt_block(const uint8_t *, uint8_t *,
  19. const struct crypto_aes_key *);
  20. /**
  21. * crypto_aes_key_free(key):
  22. * Free the expanded AES key ${key}.
  23. */
  24. void crypto_aes_key_free(struct crypto_aes_key *);
  25. #endif /* !_CRYPTO_AES_H_ */