More search and replace changes to clean up the code.
[freeradius.git] / src / include / sha1.h
1 #ifndef _LRAD_SHA1_H
2 #define _LRAD_SHA1_H
3
4 /*
5  *  FreeRADIUS defines to ensure globally unique SHA1 function names,
6  *  so that we don't pick up vendor-specific broken SHA1 libraries.
7  */
8 #define fr_SHA1_CTX             fr_SHA1_CTX
9 #define fr_SHA1Transform                fr_SHA1Transform
10 #define fr_SHA1Init             fr_SHA1Init
11 #define fr_SHA1Update           fr_SHA1Update
12 #define fr_SHA1Final            fr_SHA1Final
13
14 typedef struct {
15     uint32_t state[5];
16     uint32_t count[2];
17     uint8_t buffer[64];
18 } fr_SHA1_CTX;
19
20 void fr_SHA1Transform(uint32_t state[5], const uint8_t buffer[64]);
21 void fr_SHA1Init(fr_SHA1_CTX* context);
22 void fr_SHA1Update(fr_SHA1_CTX* context, const uint8_t* data, unsigned int len);
23 void fr_SHA1Final(uint8_t digest[20], fr_SHA1_CTX* context);
24
25 /*
26  * this version implements a raw SHA1 transform, no length is appended,
27  * nor any 128s out to the block size.
28  */
29 void fr_fr_SHA1FinalNoLen(uint8_t digest[20], fr_SHA1_CTX* context);
30
31 /*
32  * FIPS 186-2 PRF based upon SHA1.
33  */
34 extern void fips186_2prf(uint8_t mk[20], uint8_t finalkey[160]);
35
36
37 #endif /* _LRAD_SHA1_H */