1 /*
2  * Copyright (C) the libgit2 contributors. All rights reserved.
3  *
4  * This file is part of libgit2, distributed under the GNU GPL v2 with
5  * a Linking Exception. For full terms see the included COPYING file.
6  */
7 
8 #ifndef INCLUDE_hash_sha1_h__
9 #define INCLUDE_hash_sha1_h__
10 
11 #include "common.h"
12 
13 typedef struct git_hash_sha1_ctx git_hash_sha1_ctx;
14 
15 #if defined(GIT_SHA1_COLLISIONDETECT)
16 # include "sha1/collisiondetect.h"
17 #elif defined(GIT_SHA1_COMMON_CRYPTO)
18 # include "sha1/common_crypto.h"
19 #elif defined(GIT_SHA1_OPENSSL)
20 # include "sha1/openssl.h"
21 #elif defined(GIT_SHA1_WIN32)
22 # include "sha1/win32.h"
23 #elif defined(GIT_SHA1_MBEDTLS)
24 # include "sha1/mbedtls.h"
25 #else
26 # include "sha1/generic.h"
27 #endif
28 
29 int git_hash_sha1_global_init(void);
30 
31 int git_hash_sha1_ctx_init(git_hash_sha1_ctx *ctx);
32 void git_hash_sha1_ctx_cleanup(git_hash_sha1_ctx *ctx);
33 
34 int git_hash_sha1_init(git_hash_sha1_ctx *c);
35 int git_hash_sha1_update(git_hash_sha1_ctx *c, const void *data, size_t len);
36 int git_hash_sha1_final(git_oid *out, git_hash_sha1_ctx *c);
37 
38 #endif
39