pkgsrc/security/netpgpverify/files/sha1.h
agc e1bb19e1e5 Update netpgpverify to 20150901
+ rename all the symbols I could fine which could conflict with those
  in libcrypto.  requested by joerg
2015-09-01 19:38:42 +00:00

48 lines
1.1 KiB
C

/* $NetBSD: sha1.h,v 1.3 2015/09/01 19:38:42 agc 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 <inttypes.h>
#define SHA1_DIGEST_LENGTH 20
#define SHA1_DIGEST_STRING_LENGTH 41
#ifndef __BEGIN_DECLS
# if defined(__cplusplus)
# define __BEGIN_DECLS extern "C" {
# define __END_DECLS }
# else
# define __BEGIN_DECLS
# define __END_DECLS
# endif
#endif
typedef struct {
uint32_t state[5];
uint32_t count[2];
uint8_t buffer[64];
} NETPGPV_SHA1_CTX;
__BEGIN_DECLS
void netpgpv_SHA1Transform(uint32_t[5], const uint8_t[64]);
void netpgpv_SHA1Init(NETPGPV_SHA1_CTX *);
void netpgpv_SHA1Update(NETPGPV_SHA1_CTX *, const uint8_t *, unsigned int);
void netpgpv_SHA1Final(uint8_t[SHA1_DIGEST_LENGTH], NETPGPV_SHA1_CTX *);
#ifndef _KERNEL
char *netpgpv_SHA1End(NETPGPV_SHA1_CTX *, char *);
char *netpgpv_SHA1FileChunk(const char *, char *, off_t, off_t);
char *netpgpv_SHA1File(const char *, char *);
char *netpgpv_SHA1Data(const uint8_t *, size_t, char *);
#endif /* _KERNEL */
__END_DECLS
#endif /* _SYS_SHA1_H_ */