File: sha1.h

package info (click to toggle)
android-platform-system-extras 7.0.0%2Br33-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 4,136 kB
  • sloc: cpp: 28,180; ansic: 14,543; python: 5,376; sh: 2,441; java: 908; asm: 299; makefile: 19; xml: 12
file content (43 lines) | stat: -rw-r--r-- 845 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
35
36
37
38
39
40
41
42
43
/*	$NetBSD: sha1.h,v 1.13 2005/12/26 18:41:36 perry Exp $	*/

/*
 * SHA-1 in C
 * By Steve Reid <steve@edmweb.com>
 * 100% Public Domain
 */

#ifndef _SYS_SHA1_H_
#define	_SYS_SHA1_H_

#include <sys/types.h>
#include <stdint.h>

#ifdef USE_MINGW
typedef unsigned char u_char;
typedef unsigned int uint32_t;
typedef unsigned int u_int32_t;
typedef unsigned int u_int;

#define __BEGIN_DECLS
#define __END_DECLS
#else
#include <sys/cdefs.h>
#endif

#define SHA1_DIGEST_LENGTH		20
#define SHA1_DIGEST_STRING_LENGTH	41

typedef struct {
	uint32_t state[5];
	uint32_t count[2];
	u_char buffer[64];
} SHA1_CTX;

__BEGIN_DECLS
void	SHA1Transform(uint32_t[5], const u_char[64]);
void	SHA1Init(SHA1_CTX *);
void	SHA1Update(SHA1_CTX *, const u_char *, u_int);
void	SHA1Final(u_char[SHA1_DIGEST_LENGTH], SHA1_CTX *);
__END_DECLS

#endif /* _SYS_SHA1_H_ */