-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsha.h
More file actions
43 lines (35 loc) · 994 Bytes
/
Copy pathsha.h
File metadata and controls
43 lines (35 loc) · 994 Bytes
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/* SHA.H - header file for SHA.C
*/
#ifndef _SHA_H_
#define _SHA_H_
#include <sys/types.h>
/*
* Define to 1 for FIPS 180.1 version (with extra rotate in prescheduling),
* 0 for FIPS 180 version (with the mysterious "weakness" that the NSA
* isn't talking about).
*/
#define SHA_VERSION 1
#define SHA_BLOCKBYTES 64
#define SHA_BLOCKWORDS 16
#define SHA_HASHBYTES 20
#define SHA_HASHWORDS 5
/* SHA context. */
typedef struct SHAContext {
unsigned int key[SHA_BLOCKWORDS];
u_int32_t iv[SHA_HASHWORDS];
#ifdef __GNUC__
u_int64_t bytes;
#else
u_int32_t bytesHi, bytesLo;
#endif
} SHA_CTX;
#include <sys/cdefs.h>
__BEGIN_DECLS
extern void SHAInit(SHA_CTX *);
extern void SHAUpdate(SHA_CTX *, const unsigned char *, unsigned int);
extern void SHAFinal(unsigned char [SHA_HASHBYTES], SHA_CTX *);
extern char * SHAEnd(SHA_CTX *, char *);
extern char * SHAFile(const char *, char *);
extern char * SHAData(const unsigned char *, unsigned int, char *);
__END_DECLS
#endif /* _SHA_H_ */