File: sha1.h

package info (click to toggle)
bglibs 1.106-1
  • links: PTS
  • area: main
  • in suites: squeeze, wheezy
  • size: 4,788 kB
  • ctags: 4,145
  • sloc: ansic: 14,028; perl: 625; makefile: 121; sh: 64
file content (34 lines) | stat: -rw-r--r-- 763 bytes parent folder | download | duplicates (4)
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
/*
 SHA-1 in C

 By Steve Reid <steve@edmweb.com>, with small changes to make it
 fit by Bruce Guenter <bruce@untroubled.org>

*/

#ifndef _SHA1_H
# define _SHA1_H

#include <sysdeps.h>

#define SHA1_DIGEST_LENGTH 20
#define SHA1_BLOCK_LENGTH 64

typedef struct {
  uint32 state[5];
  uint64 bytes;
  unsigned char buffer[SHA1_BLOCK_LENGTH];
} SHA1_CTX;

void SHA1Transform(uint32 state[5], const unsigned char buffer[SHA1_BLOCK_LENGTH]);
void SHA1Init(SHA1_CTX* context);
void SHA1Update(SHA1_CTX* context, const unsigned char* data, uint32 len);
void SHA1Final(SHA1_CTX* context, unsigned char digest[SHA1_DIGEST_LENGTH]);

# define SHA1_Transform SHA1Transform
# define SHA1_Init SHA1Init
# define SHA1_Update SHA1Update
# define SHA1_Final SHA1Final

#endif