From 2c3c1048746a4622d8c89a29670120dc8fab93c4 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 20:49:45 +0200 Subject: Adding upstream version 6.1.76. Signed-off-by: Daniel Baumann --- crypto/compress.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 crypto/compress.c (limited to 'crypto/compress.c') diff --git a/crypto/compress.c b/crypto/compress.c new file mode 100644 index 000000000..9048fe390 --- /dev/null +++ b/crypto/compress.c @@ -0,0 +1,32 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Cryptographic API. + * + * Compression operations. + * + * Copyright (c) 2002 James Morris + */ +#include +#include "internal.h" + +int crypto_comp_compress(struct crypto_comp *comp, + const u8 *src, unsigned int slen, + u8 *dst, unsigned int *dlen) +{ + struct crypto_tfm *tfm = crypto_comp_tfm(comp); + + return tfm->__crt_alg->cra_compress.coa_compress(tfm, src, slen, dst, + dlen); +} +EXPORT_SYMBOL_GPL(crypto_comp_compress); + +int crypto_comp_decompress(struct crypto_comp *comp, + const u8 *src, unsigned int slen, + u8 *dst, unsigned int *dlen) +{ + struct crypto_tfm *tfm = crypto_comp_tfm(comp); + + return tfm->__crt_alg->cra_compress.coa_decompress(tfm, src, slen, dst, + dlen); +} +EXPORT_SYMBOL_GPL(crypto_comp_decompress); -- cgit v1.2.3