From: Dan Streetman Subject: [PATCH 03/11] crypto: add software 842 decompression Date: Tue, 7 Apr 2015 13:34:22 -0400 Message-ID: <1428428070-17803-4-git-send-email-ddstreet@ieee.org> References: <1428428070-17803-1-git-send-email-ddstreet@ieee.org> Cc: Seth Jennings , Robert Jennings , Andrew Morton , Greg KH , linux-crypto@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Dan Streetman To: Herbert Xu , "David S. Miller" , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras Return-path: In-Reply-To: <1428428070-17803-1-git-send-email-ddstreet@ieee.org> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-crypto.vger.kernel.org Add an 842-format software decompression function. Update the MAINTAINERS 842 section to include the new files. This decompression function can decompress any standard-format 842 compressed data. The 842 compressed format is explained in the header comments. This general-use decompression function is required by later patches that update the crypto 842 driver to fall back to software 842 decompression if the NX-842 hardware fails and/or returns an error. Signed-off-by: Dan Streetman --- MAINTAINERS | 2 + include/linux/sw842.h | 7 + lib/842/842_decompress.c | 413 +++++++++++++++++++++++++++++++++++++++++++++++ lib/842/Makefile | 1 + lib/Kconfig | 3 + lib/Makefile | 1 + 6 files changed, 427 insertions(+) create mode 100644 include/linux/sw842.h create mode 100644 lib/842/842_decompress.c create mode 100644 lib/842/Makefile diff --git a/MAINTAINERS b/MAINTAINERS index efbcb50..3dc973a 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -4836,6 +4836,8 @@ M: Dan Streetman S: Supported F: drivers/crypto/nx/nx-842.c F: include/linux/nx842.h +F: include/linux/sw842.h +F: lib/842/ IBM Power Linux RAID adapter M: Brian King diff --git a/include/linux/sw842.h b/include/linux/sw842.h new file mode 100644 index 0000000..aa8d86e --- /dev/null +++ b/include/linux/sw842.h @@ -0,0 +1,7 @@ +#ifndef __SW842_H__ +#define __SW842_H__ + +int sw842_decompress(const unsigned char *src, int srclen, + unsigned char *dst, int *destlen); + +#endif diff --git a/lib/842/842_decompress.c b/lib/842/842_decompress.c new file mode 100644 index 0000000..9fc0ffc --- /dev/null +++ b/lib/842/842_decompress.c @@ -0,0 +1,413 @@ +/* + * 842 Decompressor + * + * Copyright (C) 2015 Dan Streetman, IBM Corp + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * The 842 compressed format is made up of multiple blocks, each of + * which have the format: + * + *