2 * Copyright (C) the libgit2 contributors. All rights reserved.
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.
7 #ifndef INCLUDE_hash_h__
8 #define INCLUDE_hash_h__
14 typedef struct git_hash_prov git_hash_prov
;
15 typedef struct git_hash_ctx git_hash_ctx
;
17 int git_hash_ctx_init(git_hash_ctx
*ctx
);
18 void git_hash_ctx_cleanup(git_hash_ctx
*ctx
);
20 #if defined(GIT_SHA1_COLLISIONDETECT)
21 # include "hash/hash_collisiondetect.h"
22 #elif defined(GIT_SHA1_COMMON_CRYPTO)
23 # include "hash/hash_common_crypto.h"
24 #elif defined(GIT_SHA1_OPENSSL)
25 # include "hash/hash_openssl.h"
26 #elif defined(GIT_SHA1_WIN32)
27 # include "hash/hash_win32.h"
28 #elif defined(GIT_SHA1_MBEDTLS)
29 # include "hash/hash_mbedtls.h"
31 # include "hash/hash_generic.h"
34 int git_hash_global_init(void);
41 int git_hash_init(git_hash_ctx
*c
);
42 int git_hash_update(git_hash_ctx
*c
, const void *data
, size_t len
);
43 int git_hash_final(git_oid
*out
, git_hash_ctx
*c
);
45 int git_hash_buf(git_oid
*out
, const void *data
, size_t len
);
46 int git_hash_vec(git_oid
*out
, git_buf_vec
*vec
, size_t n
);