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