summaryrefslogtreecommitdiff
path: root/include/xsha1.h
blob: 60c6a9004bb3c8ea45b4e8d0cd25a5cb29d0f108 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#ifndef XSHA1_H
#define XSHA1_H

/* Initialize SHA1 computation.  Returns NULL on error. */
void *x_sha1_init(void);

/*
 * Add some data to be hashed.  ctx is the value returned by x_sha1_init()
 * Returns 0 on error, 1 on success.
 */
int x_sha1_update(void *ctx, void *data, int size);

/*
 * Place the hash in result, and free ctx.
 * Returns 0 on error, 1 on success.
 */
int x_sha1_final(void *ctx, unsigned char result[20]);

#endif