qcomwlan_secif.c 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /* Copyright (c) 2011, The Linux Foundation. All rights reserved.
  2. *
  3. * This program is free software; you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License version 2 and
  5. * only version 2 as published by the Free Software Foundation.
  6. *
  7. * This program is distributed in the hope that it will be useful,
  8. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. * GNU General Public License for more details.
  11. */
  12. #include <linux/export.h>
  13. #include <linux/qcomwlan_secif.h>
  14. /*
  15. * APIs for calling crypto routines from kernel
  16. */
  17. struct crypto_ahash *wcnss_wlan_crypto_alloc_ahash(const char *alg_name,
  18. u32 type, u32 mask)
  19. {
  20. return crypto_alloc_ahash(alg_name, type, mask);
  21. }
  22. EXPORT_SYMBOL(wcnss_wlan_crypto_alloc_ahash);
  23. int wcnss_wlan_crypto_ahash_digest(struct ahash_request *req)
  24. {
  25. return crypto_ahash_digest(req);
  26. }
  27. EXPORT_SYMBOL(wcnss_wlan_crypto_ahash_digest);
  28. void wcnss_wlan_crypto_free_ahash(struct crypto_ahash *tfm)
  29. {
  30. crypto_free_ahash(tfm);
  31. }
  32. EXPORT_SYMBOL(wcnss_wlan_crypto_free_ahash);
  33. int wcnss_wlan_crypto_ahash_setkey(struct crypto_ahash *tfm, const u8 *key,
  34. unsigned int keylen)
  35. {
  36. return crypto_ahash_setkey(tfm, key, keylen);
  37. }
  38. EXPORT_SYMBOL(wcnss_wlan_crypto_ahash_setkey);
  39. struct crypto_ablkcipher *
  40. wcnss_wlan_crypto_alloc_ablkcipher(const char *alg_name, u32 type, u32 mask)
  41. {
  42. return crypto_alloc_ablkcipher(alg_name, type, mask);
  43. }
  44. EXPORT_SYMBOL(wcnss_wlan_crypto_alloc_ablkcipher);
  45. void wcnss_wlan_ablkcipher_request_free(struct ablkcipher_request *req)
  46. {
  47. ablkcipher_request_free(req);
  48. }
  49. EXPORT_SYMBOL(wcnss_wlan_ablkcipher_request_free);
  50. void wcnss_wlan_crypto_free_ablkcipher(struct crypto_ablkcipher *tfm)
  51. {
  52. crypto_free_ablkcipher(tfm);
  53. }
  54. EXPORT_SYMBOL(wcnss_wlan_crypto_free_ablkcipher);