tkip.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * Copyright 2002-2004, Instant802 Networks, Inc.
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License version 2 as
  6. * published by the Free Software Foundation.
  7. */
  8. #ifndef TKIP_H
  9. #define TKIP_H
  10. #include <linux/types.h>
  11. #include <linux/crypto.h>
  12. #include "ieee80211_key.h"
  13. u8 * ieee80211_tkip_add_iv(u8 *pos, struct ieee80211_key *key,
  14. u8 iv0, u8 iv1, u8 iv2);
  15. void ieee80211_tkip_gen_phase1key(struct ieee80211_key *key, u8 *ta,
  16. u16 *phase1key);
  17. void ieee80211_tkip_gen_rc4key(struct ieee80211_key *key, u8 *ta,
  18. u8 *rc4key);
  19. void ieee80211_tkip_encrypt_data(struct crypto_blkcipher *tfm,
  20. struct ieee80211_key *key,
  21. u8 *pos, size_t payload_len, u8 *ta);
  22. enum {
  23. TKIP_DECRYPT_OK = 0,
  24. TKIP_DECRYPT_NO_EXT_IV = -1,
  25. TKIP_DECRYPT_INVALID_KEYIDX = -2,
  26. TKIP_DECRYPT_REPLAY = -3,
  27. };
  28. int ieee80211_tkip_decrypt_data(struct crypto_blkcipher *tfm,
  29. struct ieee80211_key *key,
  30. u8 *payload, size_t payload_len, u8 *ta,
  31. int only_iv, int queue,
  32. u32 *out_iv32, u16 *out_iv16);
  33. #endif /* TKIP_H */