File: sha1.h

package info (click to toggle)
libcanlock 0.0.980924-1
  • links: PTS
  • area: main
  • in suites: slink
  • size: 228 kB
  • ctags: 102
  • sloc: ansic: 1,338; makefile: 63; sh: 34
file content (28 lines) | stat: -rw-r--r-- 659 bytes parent folder | download | duplicates (2)
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
/* 
 * SHA-1 in C
 * By Steve Reid <steve@edmweb.com>
 * 100% Public Domain
 */
#ifndef __SHA1_H__
#define __SHA1_H__

#include "endian.h"

/* #define SHA1HANDSOFF /* Copies data before messing with it. */


#define SHA1_BLOCK	64
#define SHA1_LENGTH	20

typedef struct _SHA1_CTX {
    unsigned long state[5];
    unsigned long count[2];
    unsigned char buffer[SHA1_BLOCK];
} SHA1_CTX;

void SHA1Transform(unsigned long state[5], unsigned char buffer[64]);
void SHA1Init(SHA1_CTX * context);
void SHA1Update(SHA1_CTX * context, unsigned char *data, unsigned int len);
void SHA1Final(unsigned char digest[20], SHA1_CTX * context);

#endif				/* __SHA1_H__ */