summaryrefslogtreecommitdiff
path: root/src/ext/csiphash.c
AgeCommit message (Collapse)Author
2020-05-06Use __attribute__((fallthrough)) rather than magic GCC comments.Nick Mathewson
GCC added an implicit-fallthrough warning a while back, where it would complain if you had a nontrivial "case:" block that didn't end with break, return, or something like that. Clang recently added the same thing. GCC, however, would let you annotate a fall-through as intended by any of various magic "/* fall through */" comments. Clang, however, only seems to like "__attribute__((fallthrough))". Fortunately, GCC accepts that too. A previous commit in this branch defined a FALLTHROUGH macro to do the right thing if GNUC is defined; here we replace all of our "fall through" comments with uses of that macro. This is an automated commit, made with the following perl one-liner: #!/usr/bin/perl -i -p s#/\* *falls? ?thr.*?\*/#FALLTHROUGH;#i; (In order to avoid conflicts, I'm applying this script separately to each maint branch. This is the 0.4.3 version.)
2019-06-28Coverity: different implementation for csiphashNick Mathewson
Coverity has had trouble figuring out our csiphash implementation, and has given spurious warnings about its behavior. This patch changes the csiphash implementation when coverity is in use, so that coverity can figure out that we are not about to read beyond the provided input. Closes ticket 31025.
2018-11-14Make "ext" participate in may_include.Nick Mathewson
Also, resolve a circular dependency involving the use of lib/log by csiphash.c.
2018-06-29Remove non-windows system includes from compat.h and util.hNick Mathewson
2018-06-21Rectify include paths (automated)Nick Mathewson
2018-06-20Run rectify_include_paths.pyNick Mathewson
2018-01-11On shutdown, mark openssl as uninitialized.Nick Mathewson
This causes openssl to get completely reinitialized on startup, which is probably a good idea.
2017-05-30Fix GCC 7 -Wimplicit-fallthrough warningsAndreas Stieger
Add magic comments recognized by default -Wimplicit-fallthrough=3 or break, as required.
2017-03-14Improve keccak-tiny performance by 15% on LE intelNick Mathewson
The 64-bit load and store code was generating pretty bad output with my compiler, so I extracted the code from csiphash and used that instead. Close ticket 21737
2017-02-03Use the standard OpenBSD preprocessor definitioncypherpunks
2015-11-05Fix SipHash-2-4 performance for non multiple of 8 buffers.Yawning Angel
Code cribbed from Andrew Moon's Public Domain SipHash-2-4 implementation (which IMO is also cleaner). Fixes bug 17544.
2015-03-23Merge remote-tracking branch 'public/bug15436_025' into maint-0.2.6Nick Mathewson
2015-03-23Fix unaligned access in SipHash-2-4.Yawning Angel
The compiler is allowed to assume that a "uint64_t *" is aligned correctly, and will inline a version of memcpy that acts as such. Use "uint8_t *", so the compiler does the right thing.
2014-10-28Add another year to our copyright dates.Nick Mathewson
Because in 95 years, we or our successors will surely care about enforcing the BSD license terms on this code. Right?
2014-04-07Make csiphash use the proper endian-converter on solarisNick Mathewson
fixes bug 11426; bugfix on 0.2.5.3-alpha, where csiphash was introduced.
2014-03-18csiphash: don't attempt unaligned accessNick Mathewson
In digestmap_set/get benchmarks, doing unaligned access on x86 doesn't save more than a percent or so in the fast case. In the slow case (where we cross a cache line), it could be pretty expensive. It also makes ubsan unhappy.
2014-02-17Appropriately condition the _le64toh macro definition for OpenBSD.dana koch
This corrects a linker error on OpenBSD, where the function is called letoh64. See also http://git.kernel.org/cgit/docs/man-pages/man-pages.git/tree/man3/endian.3#n84.
2014-02-12Randomize the global siphash key at startupNick Mathewson
This completes our conversion to using siphash for our hash functions.
2014-02-12csiphash: Add functions to take a global key.Nick Mathewson
2014-02-12csiphash: avoid unaligned access on non-x86Nick Mathewson
2014-02-12Get csiphash better integrated with our build systemNick Mathewson
2014-02-12Raw import of Marek Majkowski's cisphash.cNick Mathewson
siphash is a hash function designed for producing hard-to-predict 64-bit outputs from short inputs and a 128-bit key. It's chosen for security and speed. See https://131002.net/siphash/ for more information on siphash. Source: https://github.com/majek/csiphash/