bglibs
sha1.h
1 /*
2  SHA-1 in C
3 
4  By Steve Reid <steve@edmweb.com>, with small changes to make it
5  fit by Bruce Guenter <bruce@untroubled.org>
6 
7 */
8 
9 #ifndef _SHA1_H
10 # define _SHA1_H
11 
12 #include "sysdeps.h"
13 
14 #define SHA1_DIGEST_LENGTH 20
15 #define SHA1_BLOCK_LENGTH 64
16 
17 typedef struct {
18  uint32 state[5];
19  uint64 bytes;
20  unsigned char buffer[SHA1_BLOCK_LENGTH];
21 } SHA1_CTX;
22 
23 void SHA1Transform(uint32 state[5], const unsigned char buffer[SHA1_BLOCK_LENGTH]);
24 void SHA1Init(SHA1_CTX* context);
25 void SHA1Update(SHA1_CTX* context, const unsigned char* data, uint32 len);
26 void SHA1Final(SHA1_CTX* context, unsigned char digest[SHA1_DIGEST_LENGTH]);
27 
28 # define SHA1_Transform SHA1Transform
29 # define SHA1_Init SHA1Init
30 # define SHA1_Update SHA1Update
31 # define SHA1_Final SHA1Final
32 
33 #endif
ipv6addr
Definition: ipv6.h:11
obuf_putXw
int obuf_putXw(obuf *out, unsigned long data, unsigned width, char pad)
Definition: obuf_putunumw.c:41
SHA1_CTX
Definition: sha1.h:17
socket_sendfd
int socket_sendfd(int sock, int fd)
Definition: sendfd.c:25
socket_send4
int socket_send4(int sock, const char *buffer, unsigned buflen, const ipv4addr *ip, ipv4port port)
Definition: send4.c:26
ipv4addr::addr
uint8 addr[4]
Definition: ipv4.h:13
ipv4addr
Definition: ipv4.h:11
ipv4port
uint16 ipv4port
Definition: ipv4.h:16
ipv6addr::addr
uint8 addr[16]
Definition: ipv6.h:13
ipv6port
uint16 ipv6port
Definition: ipv6.h:16
outbuf
obuf outbuf
Definition: obuf_stdout.c:7
socket_send6
int socket_send6(int sock, const char *buffer, unsigned buflen, const ipv6addr *ip, ipv6port port)
Definition: send6.c:27
socket_sendu
int socket_sendu(int sock, const char *buffer, unsigned buflen)
Definition: sendu.c:24