Blame src/hash.h

Packit ae9e2a
/*
Packit ae9e2a
 * Copyright (C) the libgit2 contributors. All rights reserved.
Packit ae9e2a
 *
Packit ae9e2a
 * This file is part of libgit2, distributed under the GNU GPL v2 with
Packit ae9e2a
 * a Linking Exception. For full terms see the included COPYING file.
Packit ae9e2a
 */
Packit ae9e2a
#ifndef INCLUDE_hash_h__
Packit ae9e2a
#define INCLUDE_hash_h__
Packit ae9e2a
Packit ae9e2a
#include "git2/oid.h"
Packit ae9e2a
Packit ae9e2a
typedef struct git_hash_prov git_hash_prov;
Packit ae9e2a
typedef struct git_hash_ctx git_hash_ctx;
Packit ae9e2a
Packit ae9e2a
int git_hash_global_init(void);
Packit ae9e2a
int git_hash_ctx_init(git_hash_ctx *ctx);
Packit ae9e2a
void git_hash_ctx_cleanup(git_hash_ctx *ctx);
Packit ae9e2a
Packit ae9e2a
#if defined(GIT_SHA1_COLLISIONDETECT)
Packit ae9e2a
# include "hash/hash_collisiondetect.h"
Packit ae9e2a
#elif defined(GIT_SHA1_COMMON_CRYPTO)
Packit ae9e2a
# include "hash/hash_common_crypto.h"
Packit ae9e2a
#elif defined(GIT_SHA1_OPENSSL)
Packit ae9e2a
# include "hash/hash_openssl.h"
Packit ae9e2a
#elif defined(GIT_SHA1_WIN32)
Packit ae9e2a
# include "hash/hash_win32.h"
Packit ae9e2a
#else
Packit ae9e2a
# include "hash/hash_generic.h"
Packit ae9e2a
#endif
Packit ae9e2a
Packit ae9e2a
typedef struct {
Packit ae9e2a
	void *data;
Packit ae9e2a
	size_t len;
Packit ae9e2a
} git_buf_vec;
Packit ae9e2a
Packit ae9e2a
int git_hash_init(git_hash_ctx *c);
Packit ae9e2a
int git_hash_update(git_hash_ctx *c, const void *data, size_t len);
Packit ae9e2a
int git_hash_final(git_oid *out, git_hash_ctx *c);
Packit ae9e2a
Packit ae9e2a
int git_hash_buf(git_oid *out, const void *data, size_t len);
Packit ae9e2a
int git_hash_vec(git_oid *out, git_buf_vec *vec, size_t n);
Packit ae9e2a
Packit ae9e2a
#endif /* INCLUDE_hash_h__ */