]> git.proxmox.com Git - libgit2.git/blame - src/hash/sha1.h
New upstream version 1.4.3+dfsg.1
[libgit2.git] / src / hash / sha1.h
CommitLineData
22a2d3d5
UG
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
13typedef 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
e579e0f7
MB
29#define GIT_HASH_SHA1_SIZE 20
30
22a2d3d5
UG
31int git_hash_sha1_global_init(void);
32
33int git_hash_sha1_ctx_init(git_hash_sha1_ctx *ctx);
34void git_hash_sha1_ctx_cleanup(git_hash_sha1_ctx *ctx);
35
36int git_hash_sha1_init(git_hash_sha1_ctx *c);
37int git_hash_sha1_update(git_hash_sha1_ctx *c, const void *data, size_t len);
e579e0f7 38int git_hash_sha1_final(unsigned char *out, git_hash_sha1_ctx *c);
22a2d3d5
UG
39
40#endif