blob: af436b328d8b4389564bcbe05f0298e398c4f2db (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
/*
* sha1.h - SHA1 Secure Hash Algorithm used for CHAP authentication.
* copied from the Linux kernel's Cryptographic API and slightly adjusted to
* fit IET's needs
*
* This file is (c) 2004 Xiranet Communications GmbH <arne.redlich@xiranet.com>
* and licensed under the GPL.
*/
#ifndef SHA1_H
#define SHA1_H
#include <sys/types.h>
#include <string.h>
#include "types.h"
struct sha1_ctx {
uint64_t count;
uint32_t state[5];
uint8_t buffer[64];
};
void sha1_init(void *ctx);
void sha1_update(void *ctx, const uint8_t *data, unsigned int len);
void sha1_final(void* ctx, uint8_t *out);
#endif
|