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

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

#define SHA1DGSTSZ (20)
#define SHA1BLKSZ  (64)

typedef struct {
	uint32_t dgst[SHA1DGSTSZ / sizeof(uint32_t)];
	uint64_t msgsz;
	uint8_t buf[SHA1BLKSZ];
	size_t bufsz;
} sha1_t;

void sha1init(sha1_t *);
void sha1hash(sha1_t *, const uint8_t *, size_t);
void sha1end(sha1_t *, uint8_t *);

#endif /* !TOTP_SHA1_H */