1/* $NetBSD: sha1.h,v 1.13 2005/12/26 18:41:36 perry Exp $ */ 2 3/* 4 * SHA-1 in C 5 * By Steve Reid <steve@edmweb.com> 6 * 100% Public Domain 7 */ 8 9#ifndef _SYS_SHA1_H_ 10#define _SYS_SHA1_H_ 11 12#include <sys/types.h> 13#include <stdint.h> 14 15#ifdef USE_MINGW 16typedef unsigned char u_char; 17typedef unsigned int uint32_t; 18typedef unsigned int u_int32_t; 19typedef unsigned int u_int; 20 21#define __BEGIN_DECLS 22#define __END_DECLS 23#else 24#include <sys/cdefs.h> 25#endif 26 27#define SHA1_DIGEST_LENGTH 20 28#define SHA1_DIGEST_STRING_LENGTH 41 29 30typedef struct { 31 uint32_t state[5]; 32 uint32_t count[2]; 33 u_char buffer[64]; 34} SHA1_CTX; 35 36__BEGIN_DECLS 37void SHA1Transform(uint32_t[5], const u_char[64]); 38void SHA1Init(SHA1_CTX *); 39void SHA1Update(SHA1_CTX *, const u_char *, u_int); 40void SHA1Final(u_char[SHA1_DIGEST_LENGTH], SHA1_CTX *); 41__END_DECLS 42 43#endif /* _SYS_SHA1_H_ */ 44