crypto_aes_aesni.h 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. #ifndef _CRYPTO_AES_AESNI_H_
  2. #define _CRYPTO_AES_AESNI_H_
  3. #include <stddef.h>
  4. #include <stdint.h>
  5. /**
  6. * crypto_aes_key_expand_aesni(key, len):
  7. * Expand the ${len}-byte AES key ${key} into a structure which can be passed
  8. * to crypto_aes_encrypt_block_aesni. The length must be 16 or 32. This
  9. * implementation uses x86 AESNI instructions, and should only be used if
  10. * CPUSUPPORT_X86_AESNI is defined and cpusupport_x86_aesni() returns nonzero.
  11. */
  12. void * crypto_aes_key_expand_aesni(const uint8_t *, size_t);
  13. /**
  14. * crypto_aes_encrypt_block_aesni(in, out, key):
  15. * Using the expanded AES key ${key}, encrypt the block ${in} and write the
  16. * resulting ciphertext to ${out}. This implementation uses x86 AESNI
  17. * instructions, and should only be used if CPUSUPPORT_X86_AESNI is defined
  18. * and cpusupport_x86_aesni() returns nonzero.
  19. */
  20. void crypto_aes_encrypt_block_aesni(const uint8_t *, uint8_t *, const void *);
  21. /**
  22. * crypto_aes_key_free_aesni(key):
  23. * Free the expanded AES key ${key}.
  24. */
  25. void crypto_aes_key_free_aesni(void *);
  26. #endif /* !_CRYPTO_AES_AESNI_H_ */