brintos

brintos / linux-shallow public Read only

0
0
Text · 3.4 KiB · b59ddfc Raw
80 lines · c
1/***********************license start************************************2 * Copyright (c) 2003-2017 Cavium, Inc.3 * All rights reserved.4 *5 * License: one of 'Cavium License' or 'GNU General Public License Version 2'6 *7 * This file is provided under the terms of the Cavium License (see below)8 * or under the terms of GNU General Public License, Version 2, as9 * published by the Free Software Foundation. When using or redistributing10 * this file, you may do so under either license.11 *12 * Cavium License:  Redistribution and use in source and binary forms, with13 * or without modification, are permitted provided that the following14 * conditions are met:15 *16 *  * Redistributions of source code must retain the above copyright17 *    notice, this list of conditions and the following disclaimer.18 *19 *  * Redistributions in binary form must reproduce the above20 *    copyright notice, this list of conditions and the following21 *    disclaimer in the documentation and/or other materials provided22 *    with the distribution.23 *24 *  * Neither the name of Cavium Inc. nor the names of its contributors may be25 *    used to endorse or promote products derived from this software without26 *    specific prior written permission.27 *28 * This Software, including technical data, may be subject to U.S. export29 * control laws, including the U.S. Export Administration Act and its30 * associated regulations, and may be subject to export or import31 * regulations in other countries.32 *33 * TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS"34 * AND WITH ALL FAULTS AND CAVIUM INC. MAKES NO PROMISES, REPRESENTATIONS35 * OR WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH36 * RESPECT TO THE SOFTWARE, INCLUDING ITS CONDITION, ITS CONFORMITY TO ANY37 * REPRESENTATION OR DESCRIPTION, OR THE EXISTENCE OF ANY LATENT OR PATENT38 * DEFECTS, AND CAVIUM SPECIFICALLY DISCLAIMS ALL IMPLIED (IF ANY)39 * WARRANTIES OF TITLE, MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR A40 * PARTICULAR PURPOSE, LACK OF VIRUSES, ACCURACY OR COMPLETENESS, QUIET41 * ENJOYMENT, QUIET POSSESSION OR CORRESPONDENCE TO DESCRIPTION. THE42 * ENTIRE  RISK ARISING OUT OF USE OR PERFORMANCE OF THE SOFTWARE LIES43 * WITH YOU.44 ***********************license end**************************************/45 46#ifndef __ZIP_CRYPTO_H__47#define __ZIP_CRYPTO_H__48 49#include <linux/crypto.h>50#include <crypto/internal/scompress.h>51#include "common.h"52#include "zip_deflate.h"53#include "zip_inflate.h"54 55struct zip_kernel_ctx {56	struct zip_operation zip_comp;57	struct zip_operation zip_decomp;58};59 60int  zip_alloc_comp_ctx_deflate(struct crypto_tfm *tfm);61int  zip_alloc_comp_ctx_lzs(struct crypto_tfm *tfm);62void zip_free_comp_ctx(struct crypto_tfm *tfm);63int  zip_comp_compress(struct crypto_tfm *tfm,64		       const u8 *src, unsigned int slen,65		       u8 *dst, unsigned int *dlen);66int  zip_comp_decompress(struct crypto_tfm *tfm,67			 const u8 *src, unsigned int slen,68			 u8 *dst, unsigned int *dlen);69 70void *zip_alloc_scomp_ctx_deflate(struct crypto_scomp *tfm);71void *zip_alloc_scomp_ctx_lzs(struct crypto_scomp *tfm);72void  zip_free_scomp_ctx(struct crypto_scomp *tfm, void *zip_ctx);73int   zip_scomp_compress(struct crypto_scomp *tfm,74			 const u8 *src, unsigned int slen,75			 u8 *dst, unsigned int *dlen, void *ctx);76int   zip_scomp_decompress(struct crypto_scomp *tfm,77			   const u8 *src, unsigned int slen,78			   u8 *dst, unsigned int *dlen, void *ctx);79#endif80