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__
12 typedef struct git_hash_prov git_hash_prov
;
13 typedef struct git_hash_ctx git_hash_ctx
;
15 int git_hash_global_init(void);
16 int git_hash_ctx_init(git_hash_ctx
*ctx
);
17 void git_hash_ctx_cleanup(git_hash_ctx
*ctx
);
19 #if defined(GIT_COMMON_CRYPTO)
20 # include "hash/hash_common_crypto.h"
21 #elif defined(OPENSSL_SHA1)
22 # include "hash/hash_openssl.h"
23 #elif defined(WIN32_SHA1)
24 # include "hash/hash_win32.h"
26 # include "hash/hash_generic.h"
34 int git_hash_init(git_hash_ctx
*c
);
35 int git_hash_update(git_hash_ctx
*c
, const void *data
, size_t len
);
36 int git_hash_final(git_oid
*out
, git_hash_ctx
*c
);
38 int git_hash_buf(git_oid
*out
, const void *data
, size_t len
);
39 int git_hash_vec(git_oid
*out
, git_buf_vec
*vec
, size_t n
);
41 #endif /* INCLUDE_hash_h__ */