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