Commit Graph

175 Commits

Author SHA1 Message Date
Yann Collet
4254f6e46d
Revert "solaris restrict keyword fix" 2021-02-22 14:57:36 -08:00
Travers
c865e556c9 fix to solaris restrict keyword with c++ 2021-02-22 09:41:20 -08:00
Travers
01fc2e6294 solaris restrict keyword fix 2021-02-20 17:29:41 -08:00
Yann Collet
a470f2ef95 update default memory access for armv6
Now uses `memcpy()` (method 0) by default
fix #490
2021-02-02 06:40:22 -08:00
Thomas Waldmann
91759f7e01 fix typos (work done by Andrea Gelmini) 2021-01-07 18:55:54 +01:00
Yann Collet
6b44373c2f check that bufferedSize remains within bounds
to detect situations like #482
2020-12-09 15:44:00 -08:00
Yann Collet
b23f2e19e5 simplify XXH3 reset
single function XXH3_reset_internal()
2020-12-09 15:40:03 -08:00
Tim Gates
3e8cc41d2a
docs: fix simple typo, minumum -> minimum
There is a small typo in xxh_x86dispatch.c, xxhash.h.

Should read `minimum` rather than `minumum`.
2020-11-20 08:52:07 +11:00
jonsykkel
967060b1d1
fixed CRITICAL typo in comment 2020-11-13 06:15:08 +01:00
easyaspi314 (Devin)
81e11d991b Disable disabled dispatch paths in xxhash.h
Now, when `XXH_DISPATCH_AVX*` is zero, the codepaths will be properly
disabled, preventing any issues from old compilers.

Fixes #464 (again).
2020-10-19 10:25:03 -04:00
easyaspi314 (Devin)
f9a4ab5123 Add missing XXH3 implementation group 2020-10-16 15:47:45 -04:00
easyaspi314 (Devin)
960709597b Finish XXH32 internal documentation. 2020-10-16 15:44:35 -04:00
easyaspi314 (Devin)
7179055461 Fix comment typos 2020-10-15 20:14:44 -04:00
easyaspi314 (Devin)
e1784dda98 [WIP] Doxygenize and redocument some funcs
XXH32's API, XXH*_state_s, the config macros, and some other things are
documented in Doxygen format, basic Doxyfile added.

Some functions were also redocumented in detail.

Still need to work on structuring the main page (set it to README.md?).

How to view docs for now:

 $ sudo apt install doxygen
 $ npm install -g http-server # or you can use LLVM's scan-view
 $ doxygen && hs doxygen/html -s -c-1 -o
2020-10-15 18:33:27 -04:00
Yann Collet
d83cce5b91 fix prefetching for x86 32-bit target on MSVC 2020-09-30 15:56:07 -07:00
Yann Collet
7ee691763b refactor xxh3 presentation in code comments
hopefully clarifying #449
2020-09-15 11:21:58 -07:00
Niklas Hambüchen
9481f42a62 xxhash.h: Update "still in development" comments
v0.8.0 marked XXH3 as stable.
2020-08-13 18:39:35 +02:00
Yann Collet
cd59de7b58 fix altivec.h redefinition issue
fix #426
2020-07-23 16:37:57 -07:00
Yann Collet
b1c22850f4 move validated XXH3 prototypes into stable 2020-07-23 14:14:59 -07:00
Yann Collet
2c992d0cc7 merge xxh3 implementation within xxhash.h
xxh3.h is no longer necessary
but remains available,
in case some programs do #include "xxh3.h" directly.

Also : bumped version number to v0.8.0
2020-07-23 10:24:51 -07:00
Yann Collet
662b223eef slightly improved streaming speed on small
by reducing memset() even more

note : required re-organizing members order
2020-07-10 23:34:17 -07:00
Yann Collet
18f0991cef do not regenerate secret from seed
when state was already used with the same `seed` previously.
This skips secret generation when `seed` remains constant.

Also : improves streaming speed on small data
thanks to lighter memset() during reset().
2020-07-10 22:11:45 -07:00
Yann Collet
f41dc60ff1 updated comments on _withSecret() variants
re-inforce the need for a high entropy source for `secret`.
2020-06-24 17:03:00 -07:00
Yann Collet
972ae45bf5 Merge branch 'dev' into x86dispatch_table 2020-06-11 17:52:14 -07:00
Yann Collet
27e33ac174
Merge pull request #386 from Cyan4973/kdf
Key Derivation function
2020-06-11 17:50:51 -07:00
Yann Collet
8dff3b89ee moved XXH3_generateSecret() into experimental section
so that its outcome remain non-binding
even after XXH3 / XXH128 get stabilized.
2020-06-11 17:22:58 -07:00
Yann Collet
35fad7a3de shortened a few names
handle unused function warning
2020-06-09 21:15:50 -07:00
Yann Collet
c546d08ff3 kdf v3
Following comments from @koraa :
- fix endianess issue, by using canonical representation
- all segments are derived from first one, in order to reduce dependency chain
- all derived segments use a seed, which is a combination raw custom seed content and segNb
- updated documentation

This variant breaks the possibility for an actor
to derive the entire secret from the knowledge of one of its segments
since it requires the seed, which is derived from original custom seed,
which is not present anywhere, condensed in the scrambling operation.
2020-06-05 16:46:55 -07:00
Yann Collet
58922a773b secret generator v2
update 128-bit scrambler at each 16-bytes round.
ensure there is no delta-correlation possible between segments,
even when the initial custom seed is poor (<= 16 bytes, or full of `\0` characters).
2020-06-05 00:37:56 -07:00
Yann Collet
37a68f29df remove alignment check on aarch64
as this architecture offers decent performance for unaligned memory accesses (like x86/x64).

This circumvent the problem described in #383,
as the direct read path using `const xxh_u32*` will not be generated by default.

Note however that this does not go at the root of the problem,
which is a possibility of strict-aliasing issue
when using the direct read path _and_ inlining xxh32.
This issue however is more difficult to solve without a reproduction case.

I also used this opportunity to fix or reinforce documentation.
2020-06-04 00:05:24 -07:00
Yann Collet
4d0ec6e6ed first version of kdf 2020-06-02 22:41:24 -07:00
Yann Collet
e3ad2c907f support for secretSize > 4 GB in streaming mode
fix #368
2020-05-20 19:21:25 -07:00
Yann Collet
6af67b92b7 Merge branch 'dev' into moveXXH3state 2020-05-20 14:31:11 -07:00
easyaspi314 (Devin)
da20cf1156 Fix minor formatting issue 2020-05-20 16:41:53 -04:00
easyaspi314 (Devin)
3eb1a010a0 Clean up namespace
- Every symbol, typedef, and macro is prefixed with XXH or xxh.
 - For compatibility with legacy code that messes with the internals,
   XXH_OLD_NAMES can be defined to wrap the old names in macros. This
   also brings back U32 and friends.
2020-05-20 16:36:24 -04:00
Yann Collet
a97e8a88a2 make XXH3_state_t movable
also fix XXH3_copyState()
when copying a state initialized with a seed.

fix #365
2020-05-20 10:45:27 -07:00
James Z.M. Gao
4b12376862 add optimized implementation for AVX512 targets 2020-04-06 15:58:26 +08:00
easyaspi314 (Devin)
7ea2940fd6 Fix a few warnings
- Trailing comma in enum in xxhsum.c
 - Extra semicolon
 - Non-constant brace list initializers
2020-03-16 12:29:49 -04:00
Yann Collet
77294d27ae updated version number
in order to distinguish users of the release from potential users of the development version
2020-03-12 14:45:51 -07:00
Yann Collet
1dc959b74d
Merge pull request #332 from easyaspi314/documentation-v2
More documentation and cleanup
2020-03-09 15:16:40 -07:00
Yann Collet
3f06265869
Merge pull request #330 from easyaspi314/align-malloc
[HOTFIX] Align malloc, use createState/freeState in sanity check
2020-03-08 23:28:38 -07:00
easyaspi314 (Devin)
f7280a3dcb Don't over-allocate XXH32/XXH64, don't hardcode
Restored XXH_malloc, renamed new XXH_malloc to XXH_alignedMalloc

XXH32_state_t and XXH64_state_t are no longer overaligned.

XXH_alignedMalloc takes any power of 2 alignment between 8 and 128.
Granted, we always call it with 64...
2020-03-09 01:31:20 -04:00
easyaspi314 (Devin)
2ac339ce2f Shill XXH3 in XXH32/XXH64 comments
Also change "usable" to "competitive" - more positive, and contrasts
with XXH64 which can be deemed as "usable" on 32-bit.
2020-03-08 23:13:38 -04:00
easyaspi314 (Devin)
b9b880eadd Add release candidate status to XXH3 comment
To match README.md.
2020-03-08 23:09:11 -04:00
easyaspi314 (Devin)
3d81905230 Explain the reason for 64 byte alignment and the bug
Also further explain not using memalign functions
2020-03-08 22:55:25 -04:00
easyaspi314 (Devin)
988be85844 Fix -Wconversion on older GCC versions
Understandable false positive.
2020-03-08 21:36:03 -04:00
easyaspi314 (Devin)
c994f5c9ef Fix copyright years
- Replace '-present' with '-2020' (fixes #329)
 - Use correct format: Copyright (C) <year> <name of author>
 - Fix some obviously incorrect years from copy/paste i.e. avoid time travel
2020-03-08 21:28:43 -04:00
easyaspi314 (Devin)
37e33e43dd Fix typo
It helps if you press Ctrl+S.
2020-03-08 21:05:32 -04:00
easyaspi314 (Devin)
c224e5836b Improve comments for XXH_malloc 2020-03-08 21:03:06 -04:00
easyaspi314 (Devin)
a0b7df7c03 [BUGFIX] Manually align XXH_malloc to 64 bytes.
Thanks to @RedSpah for finding this bug!

XXH3_state_t is manually 64-byte aligned on the stack, but not manually
aligned when dynamically allocated.

This caused an issue with where the state was assumed to be aligned
and it caused a segmentation fault.

Now, instead of somewhat pointlessly wrapping malloc and free, we write
a portable routine that overallocates and manually aligns the pointer
to 64 bytes.

There is no point in using posix_memalign or _mm_malloc when our
portability requirements would require this fallback anyways.
2020-03-08 20:37:35 -04:00