summaryrefslogtreecommitdiff
path: root/src/hash.h
Commit message (Collapse)AuthorAgeFilesLines
* hash: convert `global_init` macros to real functionPatrick Steinhardt2019-01-021-1/+2
| | | | | | | | | | | | | | | | | 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.
* mbedtls: use libmbedcrypto for hashingEtienne Samson2018-04-111-0/+2
|
* consistent header guardsethomson/header_guardsEdward Thomson2018-02-011-1/+1
| | | | use consistent names for the #include / #define header guard pattern.
* Make sure to always include "common.h" firstPatrick Steinhardt2017-07-031-0/+2
| | | | | | | | | | | | | | | | | | | | | | 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.
* hash: include sha1collisiondetectionEdward Thomson2017-03-031-1/+3
| | | | | Include the SHA1 collision attack detection library from https://github.com/cr-marcstevens/sha1collisiondetection
* hash: rename implementation selection constantsEdward Thomson2017-03-031-3/+3
|
* hash: use CommonCrypto on OSX for SHA-1cmn/common-cryptoCarlos Martín Nieto2014-10-241-1/+3
| | | | | OSX has its own cryptographic library, let's make use of it instead of calling out to OpenSSL.
* Add simple global shutdown hooksRussell Belfer2013-09-171-2/+0
| | | | | | | | | | 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.
* Revert "hash: remove git_hash_init from internal api"Michael Schubert2013-02-261-0/+1
| | | | | This reverts commit efe7fad6c96a3d6197a218aeaa561ec676794499, except for the indentation fixes.
* hash: remove git_hash_init from internal apiMichael Schubert2013-02-261-1/+0
| | | | Along with that, fix indentation in tests-clar/object/raw/hash.c
* update copyrightsEdward Thomson2013-01-081-1/+1
|
* remove ppc sha1 asmEdward Thomson2013-01-081-2/+0
|
* unload dll / destroy hash ctxs at shutdownEdward Thomson2012-11-131-0/+1
|
* move hash library func ptrs to global globalEdward Thomson2012-11-131-0/+2
|
* Remove git_hash_ctx_new - callers now _ctx_init()Edward Thomson2012-11-131-3/+3
|
* Win32 CryptoAPI and CNG support for SHA1Edward Thomson2012-11-131-7/+18
|
* Update Copyright headerschu2012-02-131-1/+1
| | | | Signed-off-by: schu <schu-github@schulog.org>
* Cleanup legal dataVicent Marti2011-09-191-1/+4
| | | | | | | | | | 1. The license header is technically not valid if it doesn't have a copyright signature. 2. The COPYING file has been updated with the different licenses used in the project. 3. The full GPLv2 header in each file annoys me.
* Change the library include fileVicent Marti2010-12-061-1/+1
| | | | | | | | | | | | Libgit2 is now officially include as #include "<git2.h>" or indidividual files may be included as #include <git2/index.h> Signed-off-by: Vicent Marti <tanoku@gmail.com>
* Add some routines for SHA1 hash computationRamsay Jones2008-12-301-0/+26
[sp: Changed signature for output to use git_oid, and added a test case to verify an allocated git_hash_ctx can be reinitialized and reused.] Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>