From d5ceda559ea6d113b4d2c31d0157dce7b72cca77 Mon Sep 17 00:00:00 2001 From: Moinak Ghosh Date: Sat, 26 Jul 2014 15:28:40 +0530 Subject: [PATCH] Update Licensing notes and build notes. More whitespace fixes. --- INSTALL | 8 ++++++++ README.md | 18 ++++++++++++++++++ allocator.h | 2 +- crypto/crypto_utils.c | 2 +- crypto/crypto_utils.h | 4 ++-- crypto/sha2_utils.h | 2 +- crypto/sha3_utils.c | 4 ++-- crypto/sha3_utils.h | 2 +- filters/delta2/delta2.c | 4 ++-- filters/delta2/delta2.h | 2 +- filters/dispack/dis.cpp | 12 ++++++------ filters/transpose/transpose.h | 2 +- lzfx_compress.c | 2 +- lzma_compress.c | 2 +- main.c | 2 +- none_compress.c | 2 +- pcompress.c | 2 +- ppmd_compress.c | 2 +- utils/cpuid.c | 8 ++++---- zlib_compress.c | 2 +- 20 files changed, 55 insertions(+), 29 deletions(-) diff --git a/INSTALL b/INSTALL index 78d7612..a046167 100644 --- a/INSTALL +++ b/INSTALL @@ -110,6 +110,14 @@ is not the usual GNU Autoconf script. support is used. So a local static libarchive build with most features disabled can be used with this option. +--with-external-libbsc= + Enable building with exernal libbsc sources. In the LGPL licensed + sources a fork of the previous LGPL licensed libbsc source tree is + already included in the Pcompress repo. The same is not true for the + MPLv2 licensed sources. So libbsc has to be downloaded separately + from: http://libbsc.com/ and linked into Pcompress using this option. + The current libbsc sources are licensed with ASLv2. + --no-sse-detect Do not try to detect the CPU's SSE capability. This mode will simply use SSE2 as the fallback default. Using SSE4 and later improves performance significantly. diff --git a/README.md b/README.md index 866850f..cf1a162 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,16 @@ Pcompress also supports encryption via AES, Salsa20 and uses Scrypt from Tarsnap for Password Based Key generation. A unique key is generated per session even if the same password is used and HMAC is used to do authentication. +LICENSING +========= + +Pcompress is dual licensed with LGPLv3 and MPLv2 sources. The main git +repository is LGPL licensed. A separate tarball of the sources with +MPLv2 license is made available as a download. This is updated +periodically. Since Pcompress also integrates a bunch of third-party +software a few features may be missing in the MPLv2 licensed version +because of the upstream software being LGPL licensed originally. + Links of Interest ================= @@ -198,6 +208,12 @@ Compression Algorithms However in a few cases this can produce slightly lesser compression gain. + libbsc - This is a new block-sorting compressor having much better effectiveness + and performance over a variety of data types as compared to Bzip2. + NOTE: In the LGPL licensed version libbsc is an integral part of Pcompress. + When building MPLv2 licensed sources, the libbsc sources must be + downloaded separately and linked in. This is described in the INSTALL file. + PPMD - Slow. Extreme compression for Text, average compression for binary. In addition PPMD decompression time is also high for large chunks. This requires lots of RAM similar to LZMA. PPMd requires @@ -232,6 +248,8 @@ Enabled features based on Compression Level 10 - 14 - Global Dedup block size 2KB, Adaptive Delta Encoding with extra rounds, Dispack, LZP Preprocessing, PackJPG filter for Jpegs. + NOTE: - LZP Preprocessing and PackJPG are not available in the MPLv2 licensed version. + Encryption ========== Pcompress supports encryption and authentication in both archive and single-file diff --git a/allocator.h b/allocator.h index 933d419..84b9ef8 100644 --- a/allocator.h +++ b/allocator.h @@ -20,7 +20,7 @@ * If not, see . * * moinakg@belenix.org, http://moinakg.wordpress.com/ - * + * */ #ifndef __ALLOCATOR_H__ diff --git a/crypto/crypto_utils.c b/crypto/crypto_utils.c index 5df3f19..b2b257e 100644 --- a/crypto/crypto_utils.c +++ b/crypto/crypto_utils.c @@ -20,7 +20,7 @@ * If not, see . * * moinakg@belenix.org, http://moinakg.wordpress.com/ - * + * */ #include diff --git a/crypto/crypto_utils.h b/crypto/crypto_utils.h index 4f8f7ba..cbf18a9 100644 --- a/crypto/crypto_utils.h +++ b/crypto/crypto_utils.h @@ -20,7 +20,7 @@ * If not, see . * * moinakg@belenix.org, http://moinakg.wordpress.com/ - * + * */ #ifndef _CRYPTO_UTILS_H @@ -113,4 +113,4 @@ int hmac_cleanup(mac_ctx_t *mctx); } #endif -#endif +#endif diff --git a/crypto/sha2_utils.h b/crypto/sha2_utils.h index 35f7004..48c8b24 100644 --- a/crypto/sha2_utils.h +++ b/crypto/sha2_utils.h @@ -20,7 +20,7 @@ * If not, see . * * moinakg@belenix.org, http://moinakg.wordpress.com/ - * + * */ #ifndef _SHA2_UTILS_H_ diff --git a/crypto/sha3_utils.c b/crypto/sha3_utils.c index 9c1e677..8ca9596 100644 --- a/crypto/sha3_utils.c +++ b/crypto/sha3_utils.c @@ -40,12 +40,12 @@ * Helper functions for single-call SHA3 (Keccak) hashing. Both serial * and parallel versions are provided. Parallel versions use 2-stage * Merkle Tree hashing. - * + * * At the leaf level data is split into BLKSZ blocks and 4 threads * compute 4 hashes of interleaved block streams. At 2nd level two * new hashes are generated from hashing the 2 pairs of hash values. * In the final stage the 2 hash values are hashed to the final digest. - * + * * References: * http://eprint.iacr.org/2012/476.pdf * http://gva.noekeon.org/papers/bdpv09tree.html diff --git a/crypto/sha3_utils.h b/crypto/sha3_utils.h index c874257..10e81f7 100644 --- a/crypto/sha3_utils.h +++ b/crypto/sha3_utils.h @@ -20,7 +20,7 @@ * If not, see . * * moinakg@belenix.org, http://moinakg.wordpress.com/ - * + * */ #ifndef _SHA3_UTILS_H_ diff --git a/filters/delta2/delta2.c b/filters/delta2/delta2.c index b158c0f..5ea572d 100644 --- a/filters/delta2/delta2.c +++ b/filters/delta2/delta2.c @@ -47,7 +47,7 @@ * 64-bit encoded value is of the following format * Most Significant Byte = Stride length * Remaining Bytes = Number of bytes in the span - * + * * We optimize for little-endian, so values are stored and interpreted * in little-endian order. */ @@ -142,7 +142,7 @@ delta2_encode(uchar_t *src, uint64_t srclen, uchar_t *dst, uint64_t *dstlen, int uint64_t slen, sz, dsz, pending; int rem, lenc, hdr_ovr; DEBUG_STAT_EN(double strt, en); - + srcpos = src; dstpos = dst; dstend = dst + *dstlen; diff --git a/filters/delta2/delta2.h b/filters/delta2/delta2.h index 0674403..9288caf 100644 --- a/filters/delta2/delta2.h +++ b/filters/delta2/delta2.h @@ -48,4 +48,4 @@ int delta2_decode(uchar_t *src, uint64_t srclen, uchar_t *dst, uint64_t *dstlen) } #endif -#endif +#endif diff --git a/filters/dispack/dis.cpp b/filters/dispack/dis.cpp index 609d01e..34e7f23 100644 --- a/filters/dispack/dis.cpp +++ b/filters/dispack/dis.cpp @@ -155,7 +155,7 @@ using namespace std; #define NORMAL_HDR (1 + 2) #define EXTENDED_HDR (1 + 2 + 2) // Dispack min reduction should be 8%, otherwise we abort -#define DIS_MIN_REDUCE (2622) +#define DIS_MIN_REDUCE (2622) #define MAXINSTR 15 // maximum size of a single instruction in bytes (actually, decodeable ones are shorter) @@ -223,7 +223,7 @@ enum Streams ST_JUMP32, // 32-bit jump target ST_MAX, - + // these components of the instruction stream are also identified // seperately, but stored together with another stream since there's // high correlation between them (or just because one streams provides @@ -641,7 +641,7 @@ static sU8 * DisFilter(DisFilterCtx &ctx, sU8 *src, sU32 size, sU32 origin, sU8 *dst, sU32 &outputSize) { // DisFilterCtx ctx(origin,origin+size); - + // main loop: handle everything but the last few bytes sU32 pos = 0; while(pos < size - MAXINSTR) @@ -713,7 +713,7 @@ DisUnFilter(sU8 *source,sU32 sourceSize,sU8 *dest,sU32 destSize,sU32 memStart) sU8 *stream[ST_MAX]; sU8 *streamEnd[ST_MAX]; sU32 funcTable[256]; - + // read header (list of stream sizes) if(sourceSize < ST_MAX*4) return sFALSE; @@ -735,7 +735,7 @@ DisUnFilter(sU8 *source,sU32 sourceSize,sU8 *dest,sU32 destSize,sU32 memStart) funcTable[i] = 0; sBool nextIsFunc = sTRUE; - + sU8 *destStart = dest; sU8 *destEnd = destStart + destSize; @@ -749,7 +749,7 @@ DisUnFilter(sU8 *source,sU32 sourceSize,sU8 *dest,sU32 destSize,sU32 memStart) { CheckSrc(ST_JUMPTBL_COUNT,1); sInt count = Fetch8(stream[ST_JUMPTBL_COUNT]) + 1; - + for(sInt i=0;i. * * moinakg@belenix.org, http://moinakg.wordpress.com/ - * + * */ #include diff --git a/lzma_compress.c b/lzma_compress.c index 52c168a..e7fefb3 100644 --- a/lzma_compress.c +++ b/lzma_compress.c @@ -20,7 +20,7 @@ * If not, see . * * moinakg@belenix.org, http://moinakg.wordpress.com/ - * + * */ #include diff --git a/main.c b/main.c index 6f19692..5f62960 100644 --- a/main.c +++ b/main.c @@ -20,7 +20,7 @@ * If not, see . * * moinakg@belenix.org, http://moinakg.wordpress.com/ - * + * */ /* diff --git a/none_compress.c b/none_compress.c index 8948c64..59ea608 100644 --- a/none_compress.c +++ b/none_compress.c @@ -20,7 +20,7 @@ * If not, see . * * moinakg@belenix.org, http://moinakg.wordpress.com/ - * + * */ #include diff --git a/pcompress.c b/pcompress.c index 6a9d397..419351c 100644 --- a/pcompress.c +++ b/pcompress.c @@ -20,7 +20,7 @@ * If not, see . * * moinakg@belenix.org, http://moinakg.wordpress.com/ - * + * */ /* diff --git a/ppmd_compress.c b/ppmd_compress.c index 46c638e..73892d3 100644 --- a/ppmd_compress.c +++ b/ppmd_compress.c @@ -20,7 +20,7 @@ * If not, see . * * moinakg@belenix.org, http://moinakg.wordpress.com/ - * + * */ #include diff --git a/utils/cpuid.c b/utils/cpuid.c index f0daf13..26ad8ee 100644 --- a/utils/cpuid.c +++ b/utils/cpuid.c @@ -72,16 +72,16 @@ exec_cpuid(uint32_t *regs) " push %%rcx\n" " push %%rdx\n" " push %%rdi\n" - + " mov %0, %%rdi\n" - + " mov (%%rdi), %%eax\n" " mov 4(%%rdi), %%ebx\n" " mov 8(%%rdi), %%ecx\n" " mov 12(%%rdi), %%edx\n" - + " cpuid\n" - + " movl %%eax, (%%rdi)\n" " movl %%ebx, 4(%%rdi)\n" " movl %%ecx, 8(%%rdi)\n" diff --git a/zlib_compress.c b/zlib_compress.c index fddbc07..91b7896 100644 --- a/zlib_compress.c +++ b/zlib_compress.c @@ -20,7 +20,7 @@ * If not, see . * * moinakg@belenix.org, http://moinakg.wordpress.com/ - * + * */ #include