]>
Commit | Line | Data |
---|---|---|
2874c5fd | 1 | // SPDX-License-Identifier: GPL-2.0-or-later |
1da177e4 LT |
2 | /* |
3 | * Cryptographic API. | |
4 | * | |
5 | * Compression operations. | |
6 | * | |
7 | * Copyright (c) 2002 James Morris <[email protected]> | |
1da177e4 | 8 | */ |
1da177e4 | 9 | #include <linux/crypto.h> |
1da177e4 LT |
10 | #include "internal.h" |
11 | ||
c441a909 EB |
12 | int crypto_comp_compress(struct crypto_comp *comp, |
13 | const u8 *src, unsigned int slen, | |
14 | u8 *dst, unsigned int *dlen) | |
1da177e4 | 15 | { |
c441a909 EB |
16 | struct crypto_tfm *tfm = crypto_comp_tfm(comp); |
17 | ||
6c2bb98b | 18 | return tfm->__crt_alg->cra_compress.coa_compress(tfm, src, slen, dst, |
1da177e4 LT |
19 | dlen); |
20 | } | |
c441a909 | 21 | EXPORT_SYMBOL_GPL(crypto_comp_compress); |
1da177e4 | 22 | |
c441a909 EB |
23 | int crypto_comp_decompress(struct crypto_comp *comp, |
24 | const u8 *src, unsigned int slen, | |
25 | u8 *dst, unsigned int *dlen) | |
1da177e4 | 26 | { |
c441a909 EB |
27 | struct crypto_tfm *tfm = crypto_comp_tfm(comp); |
28 | ||
6c2bb98b | 29 | return tfm->__crt_alg->cra_compress.coa_decompress(tfm, src, slen, dst, |
1da177e4 LT |
30 | dlen); |
31 | } | |
c441a909 | 32 | EXPORT_SYMBOL_GPL(crypto_comp_decompress); |