2019-05-27 09:55:01 +03:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2005-04-17 02:20:36 +04:00
|
|
|
/*
|
|
|
|
* Cryptographic API.
|
|
|
|
*
|
|
|
|
* Compression operations.
|
|
|
|
*
|
|
|
|
* Copyright (c) 2002 James Morris <jmorris@intercode.com.au>
|
|
|
|
*/
|
|
|
|
#include <linux/crypto.h>
|
|
|
|
#include "internal.h"
|
|
|
|
|
2019-12-03 00:42:29 +03:00
|
|
|
int crypto_comp_compress(struct crypto_comp *comp,
|
|
|
|
const u8 *src, unsigned int slen,
|
|
|
|
u8 *dst, unsigned int *dlen)
|
2005-04-17 02:20:36 +04:00
|
|
|
{
|
2019-12-03 00:42:29 +03:00
|
|
|
struct crypto_tfm *tfm = crypto_comp_tfm(comp);
|
|
|
|
|
2006-05-16 16:09:29 +04:00
|
|
|
return tfm->__crt_alg->cra_compress.coa_compress(tfm, src, slen, dst,
|
2005-04-17 02:20:36 +04:00
|
|
|
dlen);
|
|
|
|
}
|
2019-12-03 00:42:29 +03:00
|
|
|
EXPORT_SYMBOL_GPL(crypto_comp_compress);
|
2005-04-17 02:20:36 +04:00
|
|
|
|
2019-12-03 00:42:29 +03:00
|
|
|
int crypto_comp_decompress(struct crypto_comp *comp,
|
|
|
|
const u8 *src, unsigned int slen,
|
|
|
|
u8 *dst, unsigned int *dlen)
|
2005-04-17 02:20:36 +04:00
|
|
|
{
|
2019-12-03 00:42:29 +03:00
|
|
|
struct crypto_tfm *tfm = crypto_comp_tfm(comp);
|
|
|
|
|
2006-05-16 16:09:29 +04:00
|
|
|
return tfm->__crt_alg->cra_compress.coa_decompress(tfm, src, slen, dst,
|
2005-04-17 02:20:36 +04:00
|
|
|
dlen);
|
|
|
|
}
|
2019-12-03 00:42:29 +03:00
|
|
|
EXPORT_SYMBOL_GPL(crypto_comp_decompress);
|