aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/ablkcipher.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/ablkcipher.c')
-rw-r--r--crypto/ablkcipher.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/crypto/ablkcipher.c b/crypto/ablkcipher.c
index 2731acb86e7d..0083140304d2 100644
--- a/crypto/ablkcipher.c
+++ b/crypto/ablkcipher.c
@@ -13,14 +13,16 @@
13 * 13 *
14 */ 14 */
15 15
16#include <crypto/algapi.h> 16#include <crypto/internal/skcipher.h>
17#include <linux/errno.h> 17#include <linux/err.h>
18#include <linux/init.h> 18#include <linux/init.h>
19#include <linux/kernel.h> 19#include <linux/kernel.h>
20#include <linux/module.h> 20#include <linux/module.h>
21#include <linux/slab.h> 21#include <linux/slab.h>
22#include <linux/seq_file.h> 22#include <linux/seq_file.h>
23 23
24#include "internal.h"
25
24static int setkey_unaligned(struct crypto_ablkcipher *tfm, const u8 *key, 26static int setkey_unaligned(struct crypto_ablkcipher *tfm, const u8 *key,
25 unsigned int keylen) 27 unsigned int keylen)
26{ 28{
@@ -105,5 +107,24 @@ const struct crypto_type crypto_ablkcipher_type = {
105}; 107};
106EXPORT_SYMBOL_GPL(crypto_ablkcipher_type); 108EXPORT_SYMBOL_GPL(crypto_ablkcipher_type);
107 109
110int crypto_grab_skcipher(struct crypto_skcipher_spawn *spawn, const char *name,
111 u32 type, u32 mask)
112{
113 struct crypto_alg *alg;
114 int err;
115
116 type = crypto_skcipher_type(type);
117 mask = crypto_skcipher_mask(mask);
118
119 alg = crypto_alg_mod_lookup(name, type, mask);
120 if (IS_ERR(alg))
121 return PTR_ERR(alg);
122
123 err = crypto_init_spawn(&spawn->base, alg, spawn->base.inst, mask);
124 crypto_mod_put(alg);
125 return err;
126}
127EXPORT_SYMBOL_GPL(crypto_grab_skcipher);
128
108MODULE_LICENSE("GPL"); 129MODULE_LICENSE("GPL");
109MODULE_DESCRIPTION("Asynchronous block chaining cipher type"); 130MODULE_DESCRIPTION("Asynchronous block chaining cipher type");