ocfs2: Use sendmsg(MSG_SPLICE_PAGES) rather than sendpage()
[linux-block.git] / crypto / algif_aead.c
CommitLineData
2874c5fd 1// SPDX-License-Identifier: GPL-2.0-or-later
400c40cf
SM
2/*
3 * algif_aead: User-space interface for AEAD algorithms
4 *
5 * Copyright (C) 2014, Stephan Mueller <smueller@chronox.de>
6 *
7 * This file provides the user-space API for AEAD ciphers.
8 *
d887c52d
SM
9 * The following concept of the memory management is used:
10 *
11 * The kernel maintains two SGLs, the TX SGL and the RX SGL. The TX SGL is
bf63e250
DH
12 * filled by user space with the data submitted via sendpage. Filling up
13 * the TX SGL does not cause a crypto operation -- the data will only be
d887c52d
SM
14 * tracked by the kernel. Upon receipt of one recvmsg call, the caller must
15 * provide a buffer which is tracked with the RX SGL.
16 *
17 * During the processing of the recvmsg operation, the cipher request is
18 * allocated and prepared. As part of the recvmsg operation, the processed
19 * TX buffers are extracted from the TX SGL into a separate SGL.
20 *
21 * After the completion of the crypto operation, the RX SGL and the cipher
22 * request is released. The extracted TX SGL parts are released together with
23 * the RX SGL release.
400c40cf
SM
24 */
25
83094e5e 26#include <crypto/internal/aead.h>
400c40cf
SM
27#include <crypto/scatterwalk.h>
28#include <crypto/if_alg.h>
72548b09
SM
29#include <crypto/skcipher.h>
30#include <crypto/null.h>
400c40cf
SM
31#include <linux/init.h>
32#include <linux/list.h>
33#include <linux/kernel.h>
34#include <linux/mm.h>
35#include <linux/module.h>
36#include <linux/net.h>
37#include <net/sock.h>
38
2a2a251f
SM
39struct aead_tfm {
40 struct crypto_aead *aead;
8d605398 41 struct crypto_sync_skcipher *null_tfm;
2a2a251f
SM
42};
43
d887c52d
SM
44static inline bool aead_sufficient_data(struct sock *sk)
45{
46 struct alg_sock *ask = alg_sk(sk);
47 struct sock *psk = ask->parent;
48 struct alg_sock *pask = alg_sk(psk);
2d97591e 49 struct af_alg_ctx *ctx = ask->private;
d887c52d
SM
50 struct aead_tfm *aeadc = pask->private;
51 struct crypto_aead *tfm = aeadc->aead;
52 unsigned int as = crypto_aead_authsize(tfm);
400c40cf 53
0c1e16cd
SM
54 /*
55 * The minimum amount of memory needed for an AEAD cipher is
56 * the AAD and in case of decryption the tag.
57 */
58 return ctx->used >= ctx->aead_assoclen + (ctx->enc ? 0 : as);
400c40cf
SM
59}
60
eccd02f3 61static int aead_sendmsg(struct socket *sock, struct msghdr *msg, size_t size)
400c40cf
SM
62{
63 struct sock *sk = sock->sk;
64 struct alg_sock *ask = alg_sk(sk);
d887c52d
SM
65 struct sock *psk = ask->parent;
66 struct alg_sock *pask = alg_sk(psk);
d887c52d
SM
67 struct aead_tfm *aeadc = pask->private;
68 struct crypto_aead *tfm = aeadc->aead;
69 unsigned int ivsize = crypto_aead_ivsize(tfm);
400c40cf 70
2d97591e 71 return af_alg_sendmsg(sock, msg, size, ivsize);
83094e5e
TS
72}
73
8d605398 74static int crypto_aead_copy_sgl(struct crypto_sync_skcipher *null_tfm,
72548b09
SM
75 struct scatterlist *src,
76 struct scatterlist *dst, unsigned int len)
77{
8d605398 78 SYNC_SKCIPHER_REQUEST_ON_STACK(skreq, null_tfm);
72548b09 79
8d605398 80 skcipher_request_set_sync_tfm(skreq, null_tfm);
cbdad1f2 81 skcipher_request_set_callback(skreq, CRYPTO_TFM_REQ_MAY_SLEEP,
72548b09
SM
82 NULL, NULL);
83 skcipher_request_set_crypt(skreq, src, dst, len, NULL);
84
85 return crypto_skcipher_encrypt(skreq);
86}
87
d887c52d
SM
88static int _aead_recvmsg(struct socket *sock, struct msghdr *msg,
89 size_t ignored, int flags)
400c40cf
SM
90{
91 struct sock *sk = sock->sk;
92 struct alg_sock *ask = alg_sk(sk);
d887c52d
SM
93 struct sock *psk = ask->parent;
94 struct alg_sock *pask = alg_sk(psk);
2d97591e 95 struct af_alg_ctx *ctx = ask->private;
d887c52d
SM
96 struct aead_tfm *aeadc = pask->private;
97 struct crypto_aead *tfm = aeadc->aead;
8d605398 98 struct crypto_sync_skcipher *null_tfm = aeadc->null_tfm;
8e1fa89a 99 unsigned int i, as = crypto_aead_authsize(tfm);
2d97591e 100 struct af_alg_async_req *areq;
8e1fa89a
SM
101 struct af_alg_tsgl *tsgl, *tmp;
102 struct scatterlist *rsgl_src, *tsgl_src = NULL;
d887c52d
SM
103 int err = 0;
104 size_t used = 0; /* [in] TX bufs to be en/decrypted */
105 size_t outlen = 0; /* [out] RX bufs produced by kernel */
106 size_t usedpages = 0; /* [in] RX bufs to be used from user */
107 size_t processed = 0; /* [in] TX bufs to be consumed */
400c40cf 108
f3c802a1
HX
109 if (!ctx->init || ctx->more) {
110 err = af_alg_wait_for_data(sk, flags, 0);
11edb555
SM
111 if (err)
112 return err;
113 }
114
400c40cf 115 /*
bf63e250
DH
116 * Data length provided by caller via sendmsg that has not yet been
117 * processed.
400c40cf 118 */
400c40cf
SM
119 used = ctx->used;
120
121 /*
bf63e250
DH
122 * Make sure sufficient data is present -- note, the same check is also
123 * present in sendmsg. The checks in sendmsg shall provide an
124 * information to the data sender that something is wrong, but they are
125 * irrelevant to maintain the kernel integrity. We need this check
126 * here too in case user space decides to not honor the error message
127 * in sendmsg and still call recvmsg. This check here protects the
128 * kernel integrity.
400c40cf 129 */
d887c52d
SM
130 if (!aead_sufficient_data(sk))
131 return -EINVAL;
400c40cf 132
0c1e16cd
SM
133 /*
134 * Calculate the minimum output buffer size holding the result of the
135 * cipher operation. When encrypting data, the receiving buffer is
136 * larger by the tag length compared to the input buffer as the
137 * encryption operation generates the tag. For decryption, the input
138 * buffer provides the tag which is consumed resulting in only the
139 * plaintext without a buffer for the tag returned to the caller.
140 */
141 if (ctx->enc)
142 outlen = used + as;
143 else
144 outlen = used - as;
19fa7752 145
400c40cf
SM
146 /*
147 * The cipher operation input data is reduced by the associated data
148 * length as this data is processed separately later on.
149 */
0c1e16cd 150 used -= ctx->aead_assoclen;
400c40cf 151
d887c52d 152 /* Allocate cipher request for current operation. */
2d97591e
SM
153 areq = af_alg_alloc_areq(sk, sizeof(struct af_alg_async_req) +
154 crypto_aead_reqsize(tfm));
155 if (IS_ERR(areq))
156 return PTR_ERR(areq);
d887c52d
SM
157
158 /* convert iovecs of output buffers into RX SGL */
2d97591e
SM
159 err = af_alg_get_rsgl(sk, msg, flags, areq, outlen, &usedpages);
160 if (err)
161 goto free;
400c40cf 162
d887c52d
SM
163 /*
164 * Ensure output buffer is sufficiently large. If the caller provides
165 * less buffer space, only use the relative required input size. This
166 * allows AIO operation where the caller sent all data to be processed
167 * and the AIO operation performs the operation on the different chunks
168 * of the input data.
169 */
0c1e16cd 170 if (usedpages < outlen) {
d887c52d 171 size_t less = outlen - usedpages;
400c40cf 172
d887c52d
SM
173 if (used < less) {
174 err = -EINVAL;
175 goto free;
176 }
177 used -= less;
178 outlen -= less;
179 }
400c40cf 180
72548b09 181 processed = used + ctx->aead_assoclen;
8e1fa89a
SM
182 list_for_each_entry_safe(tsgl, tmp, &ctx->tsgl_list, list) {
183 for (i = 0; i < tsgl->cur; i++) {
184 struct scatterlist *process_sg = tsgl->sg + i;
185
186 if (!(process_sg->length) || !sg_page(process_sg))
187 continue;
188 tsgl_src = process_sg;
189 break;
190 }
191 if (tsgl_src)
192 break;
193 }
194 if (processed && !tsgl_src) {
195 err = -EFAULT;
196 goto free;
197 }
72548b09 198
d887c52d 199 /*
72548b09
SM
200 * Copy of AAD from source to destination
201 *
202 * The AAD is copied to the destination buffer without change. Even
203 * when user space uses an in-place cipher operation, the kernel
204 * will copy the data as it does not see whether such in-place operation
205 * is initiated.
206 *
207 * To ensure efficiency, the following implementation ensure that the
208 * ciphers are invoked to perform a crypto operation in-place. This
209 * is achieved by memory management specified as follows.
d887c52d 210 */
72548b09
SM
211
212 /* Use the RX SGL as source (and destination) for crypto op. */
c1abe6f5 213 rsgl_src = areq->first_rsgl.sgl.sgt.sgl;
72548b09
SM
214
215 if (ctx->enc) {
216 /*
217 * Encryption operation - The in-place cipher operation is
218 * achieved by the following operation:
219 *
75d11e75 220 * TX SGL: AAD || PT
72548b09
SM
221 * | |
222 * | copy |
223 * v v
75d11e75 224 * RX SGL: AAD || PT || Tag
72548b09 225 */
8e1fa89a 226 err = crypto_aead_copy_sgl(null_tfm, tsgl_src,
c1abe6f5
DH
227 areq->first_rsgl.sgl.sgt.sgl,
228 processed);
72548b09
SM
229 if (err)
230 goto free;
2d97591e 231 af_alg_pull_tsgl(sk, processed, NULL, 0);
72548b09
SM
232 } else {
233 /*
234 * Decryption operation - To achieve an in-place cipher
235 * operation, the following SGL structure is used:
236 *
237 * TX SGL: AAD || CT || Tag
238 * | | ^
239 * | copy | | Create SGL link.
240 * v v |
241 * RX SGL: AAD || CT ----+
242 */
243
244 /* Copy AAD || CT to RX SGL buffer for in-place operation. */
8e1fa89a 245 err = crypto_aead_copy_sgl(null_tfm, tsgl_src,
c1abe6f5
DH
246 areq->first_rsgl.sgl.sgt.sgl,
247 outlen);
72548b09
SM
248 if (err)
249 goto free;
250
251 /* Create TX SGL for tag and chain it to RX SGL. */
2d97591e
SM
252 areq->tsgl_entries = af_alg_count_tsgl(sk, processed,
253 processed - as);
72548b09
SM
254 if (!areq->tsgl_entries)
255 areq->tsgl_entries = 1;
76e43e37
KC
256 areq->tsgl = sock_kmalloc(sk, array_size(sizeof(*areq->tsgl),
257 areq->tsgl_entries),
72548b09
SM
258 GFP_KERNEL);
259 if (!areq->tsgl) {
260 err = -ENOMEM;
261 goto free;
262 }
263 sg_init_table(areq->tsgl, areq->tsgl_entries);
264
265 /* Release TX SGL, except for tag data and reassign tag data. */
2d97591e 266 af_alg_pull_tsgl(sk, processed, areq->tsgl, processed - as);
72548b09
SM
267
268 /* chain the areq TX SGL holding the tag with RX SGL */
2d97591e 269 if (usedpages) {
72548b09 270 /* RX SGL present */
2d97591e 271 struct af_alg_sgl *sgl_prev = &areq->last_rsgl->sgl;
c1abe6f5 272 struct scatterlist *sg = sgl_prev->sgt.sgl;
72548b09 273
c1abe6f5
DH
274 sg_unmark_end(sg + sgl_prev->sgt.nents - 1);
275 sg_chain(sg, sgl_prev->sgt.nents + 1, areq->tsgl);
72548b09
SM
276 } else
277 /* no RX SGL present (e.g. authentication only) */
8e1fa89a 278 rsgl_src = areq->tsgl;
d887c52d 279 }
d887c52d
SM
280
281 /* Initialize the crypto operation */
8e1fa89a 282 aead_request_set_crypt(&areq->cra_u.aead_req, rsgl_src,
c1abe6f5 283 areq->first_rsgl.sgl.sgt.sgl, used, ctx->iv);
2d97591e
SM
284 aead_request_set_ad(&areq->cra_u.aead_req, ctx->aead_assoclen);
285 aead_request_set_tfm(&areq->cra_u.aead_req, tfm);
d887c52d
SM
286
287 if (msg->msg_iocb && !is_sync_kiocb(msg->msg_iocb)) {
288 /* AIO operation */
7d2c3f54 289 sock_hold(sk);
d887c52d 290 areq->iocb = msg->msg_iocb;
d53c5135
SM
291
292 /* Remember output size that will be generated. */
293 areq->outlen = outlen;
294
2d97591e 295 aead_request_set_callback(&areq->cra_u.aead_req,
cbdad1f2 296 CRYPTO_TFM_REQ_MAY_SLEEP,
2d97591e
SM
297 af_alg_async_cb, areq);
298 err = ctx->enc ? crypto_aead_encrypt(&areq->cra_u.aead_req) :
299 crypto_aead_decrypt(&areq->cra_u.aead_req);
7d2c3f54
SM
300
301 /* AIO operation in progress */
cbdad1f2 302 if (err == -EINPROGRESS)
7d2c3f54 303 return -EIOCBQUEUED;
7d2c3f54
SM
304
305 sock_put(sk);
d887c52d
SM
306 } else {
307 /* Synchronous operation */
2d97591e 308 aead_request_set_callback(&areq->cra_u.aead_req,
cbdad1f2 309 CRYPTO_TFM_REQ_MAY_SLEEP |
d887c52d 310 CRYPTO_TFM_REQ_MAY_BACKLOG,
2c3f8b16
GBY
311 crypto_req_done, &ctx->wait);
312 err = crypto_wait_req(ctx->enc ?
2d97591e
SM
313 crypto_aead_encrypt(&areq->cra_u.aead_req) :
314 crypto_aead_decrypt(&areq->cra_u.aead_req),
2c3f8b16 315 &ctx->wait);
400c40cf
SM
316 }
317
d887c52d
SM
318
319free:
7d2c3f54 320 af_alg_free_resources(areq);
400c40cf
SM
321
322 return err ? err : outlen;
323}
324
d887c52d
SM
325static int aead_recvmsg(struct socket *sock, struct msghdr *msg,
326 size_t ignored, int flags)
83094e5e 327{
d887c52d
SM
328 struct sock *sk = sock->sk;
329 int ret = 0;
330
331 lock_sock(sk);
332 while (msg_data_left(msg)) {
333 int err = _aead_recvmsg(sock, msg, ignored, flags);
334
335 /*
336 * This error covers -EIOCBQUEUED which implies that we can
337 * only handle one AIO request. If the caller wants to have
338 * multiple AIO requests in parallel, he must make multiple
339 * separate AIO calls.
5703c826
SM
340 *
341 * Also return the error if no data has been processed so far.
d887c52d
SM
342 */
343 if (err <= 0) {
5703c826 344 if (err == -EIOCBQUEUED || err == -EBADMSG || !ret)
d887c52d
SM
345 ret = err;
346 goto out;
347 }
348
349 ret += err;
350 }
351
352out:
2d97591e 353 af_alg_wmem_wakeup(sk);
d887c52d
SM
354 release_sock(sk);
355 return ret;
83094e5e
TS
356}
357
400c40cf
SM
358static struct proto_ops algif_aead_ops = {
359 .family = PF_ALG,
360
361 .connect = sock_no_connect,
362 .socketpair = sock_no_socketpair,
363 .getname = sock_no_getname,
364 .ioctl = sock_no_ioctl,
365 .listen = sock_no_listen,
366 .shutdown = sock_no_shutdown,
400c40cf
SM
367 .mmap = sock_no_mmap,
368 .bind = sock_no_bind,
369 .accept = sock_no_accept,
400c40cf
SM
370
371 .release = af_alg_release,
372 .sendmsg = aead_sendmsg,
2d97591e 373 .sendpage = af_alg_sendpage,
400c40cf 374 .recvmsg = aead_recvmsg,
a11e1d43 375 .poll = af_alg_poll,
400c40cf
SM
376};
377
2a2a251f
SM
378static int aead_check_key(struct socket *sock)
379{
380 int err = 0;
381 struct sock *psk;
382 struct alg_sock *pask;
383 struct aead_tfm *tfm;
384 struct sock *sk = sock->sk;
385 struct alg_sock *ask = alg_sk(sk);
386
387 lock_sock(sk);
34c86f4c 388 if (!atomic_read(&ask->nokey_refcnt))
2a2a251f
SM
389 goto unlock_child;
390
391 psk = ask->parent;
392 pask = alg_sk(ask->parent);
393 tfm = pask->private;
394
395 err = -ENOKEY;
396 lock_sock_nested(psk, SINGLE_DEPTH_NESTING);
dc26c17f 397 if (crypto_aead_get_flags(tfm->aead) & CRYPTO_TFM_NEED_KEY)
2a2a251f
SM
398 goto unlock;
399
34c86f4c
HX
400 atomic_dec(&pask->nokey_refcnt);
401 atomic_set(&ask->nokey_refcnt, 0);
2a2a251f
SM
402
403 err = 0;
404
405unlock:
406 release_sock(psk);
407unlock_child:
408 release_sock(sk);
409
410 return err;
411}
412
413static int aead_sendmsg_nokey(struct socket *sock, struct msghdr *msg,
414 size_t size)
415{
416 int err;
417
418 err = aead_check_key(sock);
419 if (err)
420 return err;
421
422 return aead_sendmsg(sock, msg, size);
423}
424
425static ssize_t aead_sendpage_nokey(struct socket *sock, struct page *page,
426 int offset, size_t size, int flags)
427{
428 int err;
429
430 err = aead_check_key(sock);
431 if (err)
432 return err;
433
2d97591e 434 return af_alg_sendpage(sock, page, offset, size, flags);
2a2a251f
SM
435}
436
437static int aead_recvmsg_nokey(struct socket *sock, struct msghdr *msg,
438 size_t ignored, int flags)
439{
440 int err;
441
442 err = aead_check_key(sock);
443 if (err)
444 return err;
445
446 return aead_recvmsg(sock, msg, ignored, flags);
447}
448
449static struct proto_ops algif_aead_ops_nokey = {
450 .family = PF_ALG,
451
452 .connect = sock_no_connect,
453 .socketpair = sock_no_socketpair,
454 .getname = sock_no_getname,
455 .ioctl = sock_no_ioctl,
456 .listen = sock_no_listen,
457 .shutdown = sock_no_shutdown,
2a2a251f
SM
458 .mmap = sock_no_mmap,
459 .bind = sock_no_bind,
460 .accept = sock_no_accept,
2a2a251f
SM
461
462 .release = af_alg_release,
463 .sendmsg = aead_sendmsg_nokey,
464 .sendpage = aead_sendpage_nokey,
465 .recvmsg = aead_recvmsg_nokey,
a11e1d43 466 .poll = af_alg_poll,
2a2a251f
SM
467};
468
400c40cf
SM
469static void *aead_bind(const char *name, u32 type, u32 mask)
470{
2a2a251f
SM
471 struct aead_tfm *tfm;
472 struct crypto_aead *aead;
8d605398 473 struct crypto_sync_skcipher *null_tfm;
2a2a251f
SM
474
475 tfm = kzalloc(sizeof(*tfm), GFP_KERNEL);
476 if (!tfm)
477 return ERR_PTR(-ENOMEM);
478
479 aead = crypto_alloc_aead(name, type, mask);
480 if (IS_ERR(aead)) {
481 kfree(tfm);
482 return ERR_CAST(aead);
483 }
484
3a2d4fb5 485 null_tfm = crypto_get_default_null_skcipher();
72548b09
SM
486 if (IS_ERR(null_tfm)) {
487 crypto_free_aead(aead);
488 kfree(tfm);
489 return ERR_CAST(null_tfm);
490 }
491
2a2a251f 492 tfm->aead = aead;
72548b09 493 tfm->null_tfm = null_tfm;
2a2a251f
SM
494
495 return tfm;
400c40cf
SM
496}
497
498static void aead_release(void *private)
499{
2a2a251f
SM
500 struct aead_tfm *tfm = private;
501
502 crypto_free_aead(tfm->aead);
3a2d4fb5 503 crypto_put_default_null_skcipher();
2a2a251f 504 kfree(tfm);
400c40cf
SM
505}
506
507static int aead_setauthsize(void *private, unsigned int authsize)
508{
2a2a251f
SM
509 struct aead_tfm *tfm = private;
510
511 return crypto_aead_setauthsize(tfm->aead, authsize);
400c40cf
SM
512}
513
514static int aead_setkey(void *private, const u8 *key, unsigned int keylen)
515{
2a2a251f 516 struct aead_tfm *tfm = private;
2a2a251f 517
dc26c17f 518 return crypto_aead_setkey(tfm->aead, key, keylen);
400c40cf
SM
519}
520
521static void aead_sock_destruct(struct sock *sk)
522{
523 struct alg_sock *ask = alg_sk(sk);
2d97591e 524 struct af_alg_ctx *ctx = ask->private;
d887c52d
SM
525 struct sock *psk = ask->parent;
526 struct alg_sock *pask = alg_sk(psk);
527 struct aead_tfm *aeadc = pask->private;
528 struct crypto_aead *tfm = aeadc->aead;
529 unsigned int ivlen = crypto_aead_ivsize(tfm);
400c40cf 530
2d97591e 531 af_alg_pull_tsgl(sk, ctx->used, NULL, 0);
400c40cf
SM
532 sock_kzfree_s(sk, ctx->iv, ivlen);
533 sock_kfree_s(sk, ctx, ctx->len);
534 af_alg_release_parent(sk);
535}
536
2a2a251f 537static int aead_accept_parent_nokey(void *private, struct sock *sk)
400c40cf 538{
2d97591e 539 struct af_alg_ctx *ctx;
400c40cf 540 struct alg_sock *ask = alg_sk(sk);
2a2a251f
SM
541 struct aead_tfm *tfm = private;
542 struct crypto_aead *aead = tfm->aead;
d887c52d 543 unsigned int len = sizeof(*ctx);
2a2a251f 544 unsigned int ivlen = crypto_aead_ivsize(aead);
400c40cf
SM
545
546 ctx = sock_kmalloc(sk, len, GFP_KERNEL);
547 if (!ctx)
548 return -ENOMEM;
549 memset(ctx, 0, len);
550
551 ctx->iv = sock_kmalloc(sk, ivlen, GFP_KERNEL);
552 if (!ctx->iv) {
553 sock_kfree_s(sk, ctx, len);
554 return -ENOMEM;
555 }
556 memset(ctx->iv, 0, ivlen);
557
d887c52d 558 INIT_LIST_HEAD(&ctx->tsgl_list);
400c40cf 559 ctx->len = len;
2c3f8b16 560 crypto_init_wait(&ctx->wait);
400c40cf
SM
561
562 ask->private = ctx;
563
400c40cf
SM
564 sk->sk_destruct = aead_sock_destruct;
565
566 return 0;
567}
568
2a2a251f
SM
569static int aead_accept_parent(void *private, struct sock *sk)
570{
571 struct aead_tfm *tfm = private;
572
dc26c17f 573 if (crypto_aead_get_flags(tfm->aead) & CRYPTO_TFM_NEED_KEY)
2a2a251f
SM
574 return -ENOKEY;
575
576 return aead_accept_parent_nokey(private, sk);
577}
578
400c40cf
SM
579static const struct af_alg_type algif_type_aead = {
580 .bind = aead_bind,
581 .release = aead_release,
582 .setkey = aead_setkey,
583 .setauthsize = aead_setauthsize,
584 .accept = aead_accept_parent,
2a2a251f 585 .accept_nokey = aead_accept_parent_nokey,
400c40cf 586 .ops = &algif_aead_ops,
2a2a251f 587 .ops_nokey = &algif_aead_ops_nokey,
400c40cf
SM
588 .name = "aead",
589 .owner = THIS_MODULE
590};
591
592static int __init algif_aead_init(void)
593{
594 return af_alg_register_type(&algif_type_aead);
595}
596
597static void __exit algif_aead_exit(void)
598{
599 int err = af_alg_unregister_type(&algif_type_aead);
600 BUG_ON(err);
601}
602
603module_init(algif_aead_init);
604module_exit(algif_aead_exit);
605MODULE_LICENSE("GPL");
606MODULE_AUTHOR("Stephan Mueller <smueller@chronox.de>");
607MODULE_DESCRIPTION("AEAD kernel crypto API user space interface");