diff options
author | Edward Thomson <ethomson@edwardthomson.com> | 2020-04-30 09:27:45 +0100 |
---|---|---|
committer | Edward Thomson <ethomson@edwardthomson.com> | 2020-04-30 09:27:45 +0100 |
commit | 0fb43f68fe4bbf41238ef1a96e0827eeff769f7c (patch) | |
tree | a6fa2a8a6c58cf2f4b5e4f109bef15813548b49a /util/hash/sha1.h | |
parent | 639df9b189ea489f30a1bb6b0c3d67c575262129 (diff) | |
download | libgit2-ethomson/util_as_a_directory.tar.gz |
util as a directoryethomson/util_as_a_directory
Diffstat (limited to 'util/hash/sha1.h')
-rw-r--r-- | util/hash/sha1.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/util/hash/sha1.h b/util/hash/sha1.h new file mode 100644 index 000000000..608849623 --- /dev/null +++ b/util/hash/sha1.h @@ -0,0 +1,38 @@ +/* + * Copyright (C) the libgit2 contributors. All rights reserved. + * + * This file is part of libgit2, distributed under the GNU GPL v2 with + * a Linking Exception. For full terms see the included COPYING file. + */ + +#ifndef INCLUDE_hash_sha1_h__ +#define INCLUDE_hash_sha1_h__ + +#include "util_common.h" + +typedef struct git_hash_sha1_ctx git_hash_sha1_ctx; + +#if defined(GIT_SHA1_COLLISIONDETECT) +# include "sha1/collisiondetect.h" +#elif defined(GIT_SHA1_COMMON_CRYPTO) +# include "sha1/common_crypto.h" +#elif defined(GIT_SHA1_OPENSSL) +# include "sha1/openssl.h" +#elif defined(GIT_SHA1_WIN32) +# include "sha1/win32.h" +#elif defined(GIT_SHA1_MBEDTLS) +# include "sha1/mbedtls.h" +#else +# include "sha1/generic.h" +#endif + +int git_hash_sha1_global_init(void); + +int git_hash_sha1_ctx_init(git_hash_sha1_ctx *ctx); +void git_hash_sha1_ctx_cleanup(git_hash_sha1_ctx *ctx); + +int git_hash_sha1_init(git_hash_sha1_ctx *c); +int git_hash_sha1_update(git_hash_sha1_ctx *c, const void *data, size_t len); +int git_hash_sha1_final(git_oid *out, git_hash_sha1_ctx *c); + +#endif |