Coda Distributed File System
coda_hash.h
Go to the documentation of this file.
1/* BLURB lgpl
2
3 Coda File System
4 Release 6
5
6 Copyright (c) 1987-2003 Carnegie Mellon University
7 Additional copyrights listed below
8
9This code is distributed "AS IS" without warranty of any kind under
10the terms of the GNU Library General Public Licence Version 2, as
11shown in the file LICENSE. The technical and financial contributors to
12Coda are listed in the file CREDITS.
13
14 Additional copyrights
15 none currently
16
17#*/
18
19#ifndef _CODA_HASH_H_
20#define _CODA_HASH_H_ 1
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
26#ifdef HAVE_CONFIG_H
27#include <config.h>
28#endif
29
30#include <sys/types.h>
31#include <stdint.h>
32
33#if defined(HAVE_MD5_H)
34#include <md5.h>
35#else
36
37/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
38rights reserved.
39
40License to copy and use this software is granted provided that it
41is identified as the "RSA Data Security, Inc. MD5 Message-Digest
42Algorithm" in all material mentioning or referencing this software
43or this function.
44
45License is also granted to make and use derivative works provided
46that such works are identified as "derived from the RSA Data
47Security, Inc. MD5 Message-Digest Algorithm" in all material
48mentioning or referencing the derived work.
49
50RSA Data Security, Inc. makes no representations concerning either
51the merchantability of this software or the suitability of this
52software for any particular purpose. It is provided "as is"
53without express or implied warranty of any kind.
54
55These notices must be retained in any copies of any part of this
56documentation and/or software.
57 */
58
59typedef struct MD5Context {
60 uint32_t state[4]; /* state (ABCD) */
61 uint32_t count[2]; /* number of bits, modulo 2^64 (lsb first) */
62 unsigned char buffer[64]; /* input buffer */
64
65void MD5_Init(MD5_CTX *);
66void MD5_Update(MD5_CTX *, const unsigned char *, unsigned int);
67void MD5_Final(unsigned char[16], MD5_CTX *);
68
69#endif
70
71#define SHA_DIGEST_LENGTH 20
72
73typedef struct SHAContext {
76 unsigned char buffer[64];
78
79void SHA1_Init(SHA_CTX *ctx);
80void SHA1_Update(SHA_CTX *ctx, const unsigned char *buf, unsigned int len);
81void SHA1_Final(unsigned char sha[SHA_DIGEST_LENGTH], SHA_CTX *ctx);
82
83#ifdef __cplusplus
84}
85#endif
86
87#endif /* _CODA_HASH_H_ */
unsigned int uint32_t
Definition: coda.h:105
#define SHA_DIGEST_LENGTH
Definition: coda_hash.h:71
void MD5_Final(unsigned char[16], MD5_CTX *)
Definition: md5c.c:183
void MD5_Update(MD5_CTX *, const unsigned char *, unsigned int)
Definition: md5c.c:146
void SHA1_Init(SHA_CTX *ctx)
Definition: sha1.c:110
struct SHAContext SHA_CTX
void MD5_Init(MD5_CTX *)
Definition: md5c.c:128
void SHA1_Update(SHA_CTX *ctx, const unsigned char *buf, unsigned int len)
Definition: sha1.c:121
struct MD5Context MD5_CTX
void SHA1_Final(unsigned char sha[SHA_DIGEST_LENGTH], SHA_CTX *ctx)
Definition: sha1.c:142
Definition: coda_hash.h:59
uint32_t state[4]
Definition: coda_hash.h:60
uint32_t count[2]
Definition: coda_hash.h:61
Definition: coda_hash.h:73
uint32_t count
Definition: coda_hash.h:74
uint32_t state[5]
Definition: coda_hash.h:75
Definition: coda_dir.h:58