aboutsummaryrefslogtreecommitdiff
path: root/c/sha1/sha1.h
blob: a01d116652ad6d6b1bf7a3ecb655132e7afba58b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#ifndef SHA1_SHA1_H
#define SHA1_SHA1_H

#include <stddef.h>
#include <stdint.h>

#define SHA1DGSTSZ 20
#define SHA1BLKSZ  64

typedef struct {
	uint32_t dgst[5];
	uint64_t msgsz;
	uint8_t buf[64];
	size_t bufsz;
} sha1_t;

void sha1init(sha1_t *);
int sha1hash(sha1_t *, const uint8_t *, size_t);
void sha1end(sha1_t *, uint8_t[SHA1DGSTSZ]);

#endif /* !SHA1_SHA1_H */