src/hash


Log

Author Commit Date CI Message
Edward Thomson f673e232 2018-12-27T13:47:34 git_error: use new names in internal APIs and usage Move to the `git_error` name in the internal API for error-related functions.
Patrick Steinhardt 03dc6480 2019-01-02T09:27:44 hash: convert `global_init` macros to real function The `git_hash_global_init` function is simply defined as a macro to zero for most of the different hash implementations. This makes it impossible to treat it like a function pointer, which is required for a later commit where we want to improve the way global initialization works. Fix the issue by converting all no-op macros to an inline function returning zero. There's a small gotcha here, though: as most hash implementations only have a header file, but not a corresponding implementation file, we cannot declare the function as non-static. But declaring it as `static inline` fails, too, as there is a previous declaration as non-static. So we have to move the function declaration after the include that brings in the function definition, as it is allowed to have a non-static declaration after a static definition, but not the other way round.
Etienne Samson 6c6be3ce 2018-03-29T22:13:59 mbedtls: use libmbedcrypto for hashing
bgermann c9e5ba09 2018-03-28T17:37:39 sha1dc: update to fix errors with endianess This updates the version of SHA1DC to c3e1304ea3.
Patrick Steinhardt 178fda8a 2018-02-09T17:55:18 hash: win32: fix missing comma in `giterr_set`
Edward Thomson 9985edb5 2018-02-01T06:32:55 hash: set error messages on failure
Edward Thomson abb04caa 2018-02-01T15:55:48 consistent header guards use consistent names for the #include / #define header guard pattern.
Edward Thomson a223bae5 2018-01-03T14:57:25 Merge pull request #4437 from pks-t/pks/openssl-hash-errors hash: openssl: check return values of SHA1_* functions
Patrick Steinhardt 75e1737a 2017-12-08T10:10:19 hash: openssl: check return values of SHA1_* functions The OpenSSL functions `SHA1_Init`, `SHA1_Update` and `SHA1_Final` all return 1 for success and 0 otherwise, but we never check their return values. Do so.
Edward Thomson bdb54214 2017-12-11T16:46:05 hash: commoncrypto hash should support large files Teach the CommonCrypto hash mechanisms to support large files. The hash primitives take a `CC_LONG` (aka `uint32_t`) at a time. So loop to give the hash function at most an unsigned 32 bit's worth of bytes until we have hashed the entire file.
Edward Thomson a89560d5 2017-12-10T17:26:43 hash: win32 hash mechanism should support large files Teach the win32 hash mechanisms to support large files. The hash primitives take at most `ULONG_MAX` bytes at a time. Loop, giving the hash function the maximum supported number of bytes, until we have hashed the entire file.
Patrick Steinhardt 0c7f49dd 2017-06-30T13:39:01 Make sure to always include "common.h" first Next to including several files, our "common.h" header also declares various macros which are then used throughout the project. As such, we have to make sure to always include this file first in all implementation files. Otherwise, we might encounter problems or even silent behavioural differences due to macros or defines not being defined as they should be. So in fact, our header and implementation files should make sure to always include "common.h" first. This commit does so by establishing a common include pattern. Header files inside of "src" will now always include "common.h" as its first other file, separated by a newline from all the other includes to make it stand out as special. There are two cases for the implementation files. If they do have a matching header file, they will always include this one first, leading to "common.h" being transitively included as first file. If they do not have a matching header file, they instead include "common.h" as first file themselves. This fixes the outlined problems and will become our standard practice for header and source files inside of the "src/" from now on.
Patrick Steinhardt 63d86c27 2017-06-07T14:50:16 sha1dc: update to fix errors with endianess and unaligned access This updates our version of SHA1DC to e139984 (Merge pull request #35 from lidl/master, 2017-05-30).
Edward Thomson d6729635 2017-03-23T17:25:11 sha1dc: `SHA1DCUpdate` now takes a `size_t`
Edward Thomson c9efa995 2017-03-23T09:16:24 sha1dc: perf improvements from upstream Update SHA-1 collision detection code (cr-marcstevens/sha1collisiondetection) to master to include performance improvements.
Edward Thomson 2dfd1294 2017-02-24T13:34:01 hash: include sha1collisiondetection Include the SHA1 collision attack detection library from https://github.com/cr-marcstevens/sha1collisiondetection
Edward Thomson a2e4593e 2015-02-03T18:41:40 hash_generic: __extension__ keyword for pedantry
Carlos Martín Nieto 799e22ea 2014-10-23T17:34:41 Rename git_threads_ to git_libgit2_ This describes their purpose better, as we now initialize ssl and some other global stuff in there. Calling the init function is not something which has been optional for a while now.
Carlos Martín Nieto d9c0dbb0 2014-10-24T13:29:11 hash: use CommonCrypto on OSX for SHA-1 OSX has its own cryptographic library, let's make use of it instead of calling out to OpenSSL.
Russell Belfer a3aa5f4d 2013-09-11T12:45:20 Add simple global shutdown hooks Increasingly there are a number of components that want to do some cleanup at global shutdown time (at least if there are not going to be memory leaks). This creates a very simple system of shutdown hooks that will be invoked by git_threads_shutdown. Right now, the maximum number of hooks is hardcoded, but since adding a hook is not a public API, it should be fine and I thought it was better to start off with really simple code.
Vicent Martí dbecec37 2013-08-28T09:38:14 Merge pull request #1805 from libgit2/threading-packed-load Thread safety for the refdb_fs
Edward Thomson 1ff3a094 2013-08-27T19:41:44 Improve win32 version check, no ipv6 tests on XP
Russell Belfer 43095341 2013-08-26T14:56:31 Load SRWLock APIs at runtime This loads SRWLock APIs at runtime and in their absence (i.e. on Windows before Vista) falls back on a regular CRITICAL_SECTION that will not permit concurrent readers.
Linquize 0cb16fe9 2013-05-15T20:26:55 Unify whitespaces to tabs
Michael Schubert 8005c6d4 2013-02-26T01:03:56 Revert "hash: remove git_hash_init from internal api" This reverts commit efe7fad6c96a3d6197a218aeaa561ec676794499, except for the indentation fixes.
Michael Schubert efe7fad6 2013-02-26T00:05:28 hash: remove git_hash_init from internal api Along with that, fix indentation in tests-clar/object/raw/hash.c
Edward Thomson 359fc2d2 2013-01-08T17:07:25 update copyrights
Edward Thomson 8f09f464 2013-01-08T16:54:44 remove ppc sha1 asm
Russell Belfer a8122b5d 2012-11-21T15:39:03 Fix warnings on Win64 build
Edward Thomson a8527429 2012-11-13T14:48:10 unload dll / destroy hash ctxs at shutdown
Edward Thomson 603bee07 2012-11-12T19:22:49 Remove git_hash_ctx_new - callers now _ctx_init()
Edward Thomson d6fb0924 2012-11-05T12:37:15 Win32 CryptoAPI and CNG support for SHA1
Edward Thomson 7ebefd22 2012-11-13T10:10:40 move hash library func ptrs to global global