wlan_crypto_aes_ctr_i.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. * Copyright (c) 2017 The Linux Foundation. All rights reserved.
  3. */
  4. /*
  5. * AES functions
  6. *
  7. * Copyright (c) 2003-2006, Jouni Malinen <[email protected]>
  8. *
  9. * This software may be distributed under the terms of the BSD license.
  10. * See README for more details.
  11. */
  12. #ifndef _WLAN_CRYPTO_AES_CTR_I_H_
  13. #define _WLAN_CRYPTO_AES_CTR_I_H_
  14. #ifdef WLAN_SUPPORT_FILS
  15. /**
  16. * wlan_crypto_aes_ctr_encrypt - AES-128/192/256 CTR mode encryption
  17. * @key: Key for encryption (key_len bytes)
  18. * @key_len: Length of the key (16, 24, or 32 bytes)
  19. * @nonce: Nonce for counter mode (16 bytes)
  20. * @data: Data to encrypt in-place
  21. * @data_len: Length of data in bytes
  22. *
  23. * Returns: 0 on success, -1 on failure
  24. */
  25. int32_t wlan_crypto_aes_ctr_encrypt(const uint8_t *key, size_t key_len,
  26. const uint8_t *nonce, uint8_t *data,
  27. size_t data_len);
  28. /**
  29. * wlan_crypto_aes_128_ctr_encrypt - AES-128 CTR mode encryption
  30. * @key: Key for encryption (key_len bytes)
  31. * @nonce: Nonce for counter mode (16 bytes)
  32. * @data: Data to encrypt in-place
  33. * @data_len: Length of data in bytes
  34. *
  35. * Returns: 0 on success, -1 on failure
  36. */
  37. int32_t wlan_crypto_aes_128_ctr_encrypt(const uint8_t *key,
  38. const uint8_t *nonce, uint8_t *data,
  39. size_t data_len);
  40. #endif /* WLAN_SUPPORT_FILS */
  41. #endif /* end of _WLAN_CRYPTO_AES_CTR_I_H_ */