blob: 985f1e0929f7988f315af105230955be8fe4f31f [file] [log] [blame]
yuezonghe824eb0c2024-06-27 02:32:26 -07001/* compress.h
2 *
3 * Copyright (C) 2006-2021 wolfSSL Inc.
4 *
5 * This file is part of wolfSSL.
6 *
7 * wolfSSL is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * wolfSSL is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
20 */
21
22/*!
23 \file wolfssl/wolfcrypt/compress.h
24*/
25
26
27#ifndef WOLF_CRYPT_COMPRESS_H
28#define WOLF_CRYPT_COMPRESS_H
29
30#include <wolfssl/wolfcrypt/types.h>
31
32#ifdef HAVE_LIBZ
33
34#ifdef __cplusplus
35 extern "C" {
36#endif
37
38
39#define COMPRESS_FIXED 1
40
41#define LIBZ_WINBITS_GZIP 16
42
43
44WOLFSSL_API int wc_Compress(byte*, word32, const byte*, word32, word32);
45WOLFSSL_API int wc_Compress_ex(byte* out, word32 outSz, const byte* in,
46 word32 inSz, word32 flags, word32 windowBits);
47WOLFSSL_API int wc_DeCompress(byte*, word32, const byte*, word32);
48WOLFSSL_API int wc_DeCompress_ex(byte* out, word32 outSz, const byte* in,
49 word32 inSz, int windowBits);
50WOLFSSL_API int wc_DeCompressDynamic(byte** out, int max, int memoryType,
51 const byte* in, word32 inSz, int windowBits, void* heap);
52
53#ifdef __cplusplus
54 } /* extern "C" */
55#endif
56
57
58#endif /* HAVE_LIBZ */
59#endif /* WOLF_CRYPT_COMPRESS_H */
60