File: sha1.h

package info (click to toggle)
bglibs 2.04%2Bdfsg-8
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 3,468 kB
  • sloc: ansic: 15,821; perl: 674; sh: 63; makefile: 29
file content (33 lines) | stat: -rw-r--r-- 762 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
/*
 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