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