Duy Truong | 790f06d | 2013-02-13 16:38:12 -0800 | [diff] [blame] | 1 | /* Copyright (c) 2011, The Linux Foundation. All rights reserved. |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 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 | |
Steve Muckle | f132c6c | 2012-06-06 18:30:57 -0700 | [diff] [blame] | 13 | #include <linux/export.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 14 | #include <linux/qcomwlan_secif.h> |
| 15 | |
| 16 | /* |
| 17 | * APIs for calling crypto routines from kernel |
| 18 | */ |
| 19 | struct crypto_ahash *wcnss_wlan_crypto_alloc_ahash(const char *alg_name, |
| 20 | u32 type, u32 mask) |
| 21 | { |
| 22 | return crypto_alloc_ahash(alg_name, type, mask); |
| 23 | } |
| 24 | EXPORT_SYMBOL(wcnss_wlan_crypto_alloc_ahash); |
| 25 | |
| 26 | int wcnss_wlan_crypto_ahash_digest(struct ahash_request *req) |
| 27 | { |
| 28 | return crypto_ahash_digest(req); |
| 29 | } |
| 30 | EXPORT_SYMBOL(wcnss_wlan_crypto_ahash_digest); |
| 31 | |
| 32 | void wcnss_wlan_crypto_free_ahash(struct crypto_ahash *tfm) |
| 33 | { |
| 34 | crypto_free_ahash(tfm); |
| 35 | } |
| 36 | EXPORT_SYMBOL(wcnss_wlan_crypto_free_ahash); |
| 37 | |
| 38 | int wcnss_wlan_crypto_ahash_setkey(struct crypto_ahash *tfm, const u8 *key, |
| 39 | unsigned int keylen) |
| 40 | { |
| 41 | return crypto_ahash_setkey(tfm, key, keylen); |
| 42 | } |
| 43 | EXPORT_SYMBOL(wcnss_wlan_crypto_ahash_setkey); |
| 44 | |
| 45 | struct crypto_ablkcipher * |
| 46 | wcnss_wlan_crypto_alloc_ablkcipher(const char *alg_name, u32 type, u32 mask) |
| 47 | { |
| 48 | return crypto_alloc_ablkcipher(alg_name, type, mask); |
| 49 | } |
| 50 | EXPORT_SYMBOL(wcnss_wlan_crypto_alloc_ablkcipher); |
| 51 | |
| 52 | void wcnss_wlan_ablkcipher_request_free(struct ablkcipher_request *req) |
| 53 | { |
| 54 | ablkcipher_request_free(req); |
| 55 | } |
| 56 | EXPORT_SYMBOL(wcnss_wlan_ablkcipher_request_free); |
| 57 | |
| 58 | void wcnss_wlan_crypto_free_ablkcipher(struct crypto_ablkcipher *tfm) |
| 59 | { |
| 60 | crypto_free_ablkcipher(tfm); |
| 61 | } |
| 62 | EXPORT_SYMBOL(wcnss_wlan_crypto_free_ablkcipher); |
| 63 | |