blob: c16e48fc09aad1c7cc1eac9f8a91eddc229174f6 [file] [log] [blame]
Duy Truong790f06d2013-02-13 16:38:12 -08001/* Copyright (c) 2011, The Linux Foundation. All rights reserved.
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002 *
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 Mucklef132c6c2012-06-06 18:30:57 -070013#include <linux/export.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070014#include <linux/qcomwlan_secif.h>
15
16/*
17 * APIs for calling crypto routines from kernel
18 */
19struct 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}
24EXPORT_SYMBOL(wcnss_wlan_crypto_alloc_ahash);
25
26int wcnss_wlan_crypto_ahash_digest(struct ahash_request *req)
27{
28 return crypto_ahash_digest(req);
29}
30EXPORT_SYMBOL(wcnss_wlan_crypto_ahash_digest);
31
32void wcnss_wlan_crypto_free_ahash(struct crypto_ahash *tfm)
33{
34 crypto_free_ahash(tfm);
35}
36EXPORT_SYMBOL(wcnss_wlan_crypto_free_ahash);
37
38int 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}
43EXPORT_SYMBOL(wcnss_wlan_crypto_ahash_setkey);
44
45struct crypto_ablkcipher *
46wcnss_wlan_crypto_alloc_ablkcipher(const char *alg_name, u32 type, u32 mask)
47{
48 return crypto_alloc_ablkcipher(alg_name, type, mask);
49}
50EXPORT_SYMBOL(wcnss_wlan_crypto_alloc_ablkcipher);
51
52void wcnss_wlan_ablkcipher_request_free(struct ablkcipher_request *req)
53{
54 ablkcipher_request_free(req);
55}
56EXPORT_SYMBOL(wcnss_wlan_ablkcipher_request_free);
57
58void wcnss_wlan_crypto_free_ablkcipher(struct crypto_ablkcipher *tfm)
59{
60 crypto_free_ablkcipher(tfm);
61}
62EXPORT_SYMBOL(wcnss_wlan_crypto_free_ablkcipher);
63