Make the functions specific to libradius, so they don't conflict
[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 SHA1_CTX                librad_SHA1_CTX
9 #define SHA1Transform           librad_SHA1Transform
10 #define SHA1Init                librad_SHA1Init
11 #define SHA1Update              librad_SHA1Update
12 #define SHA1Final               librad_SHA1Final
13
14 typedef struct {
15     unsigned long state[5];
16     unsigned long count[2];
17     unsigned char buffer[64];
18 } SHA1_CTX;
19
20 void SHA1Transform(unsigned long state[5], const unsigned char buffer[64]);
21 void SHA1Init(SHA1_CTX* context);
22 void SHA1Update(SHA1_CTX* context, const unsigned char* data, unsigned int len);
23 void SHA1Final(unsigned char digest[20], SHA1_CTX* context);
24
25 #endif /* _LRAD_SHA1_H */