summaryrefslogtreecommitdiff
path: root/pkgtools/digest/files/sha1.h
diff options
context:
space:
mode:
authoragc <agc>2001-03-06 11:21:04 +0000
committeragc <agc>2001-03-06 11:21:04 +0000
commit8c3b0c82be874918a84ec21893e4878cfc4600cf (patch)
treef7b52e636937755547118c2a9b6cc7912838a38a /pkgtools/digest/files/sha1.h
parent48b9824d25e542fdbaf6a0602451b8ef68c0cb5f (diff)
downloadpkgsrc-8c3b0c82be874918a84ec21893e4878cfc4600cf.tar.gz
Import of a small utility, which calculates message digests, into the
NetBSD packages collection. At the current time, this utility calculates md5, sha1 and rmd160 message digests, but is designed to be extensible, so that other algorithms can be added easily, if and when they appear. The utility outputs digests in the same format as md5(1) in basesrc. It is designed to be small, and to be linked statically.
Diffstat (limited to 'pkgtools/digest/files/sha1.h')
-rw-r--r--pkgtools/digest/files/sha1.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/pkgtools/digest/files/sha1.h b/pkgtools/digest/files/sha1.h
new file mode 100644
index 00000000000..b0ceb5cd83d
--- /dev/null
+++ b/pkgtools/digest/files/sha1.h
@@ -0,0 +1,30 @@
+/* $NetBSD: sha1.h,v 1.1.1.1 2001/03/06 11:21:05 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>
+
+typedef struct {
+ u_int32_t state[5];
+ u_int32_t count[2];
+ u_char buffer[64];
+} SHA1_CTX;
+
+void SHA1Transform __P((u_int32_t state[5], const u_char buffer[64]));
+void SHA1Init __P((SHA1_CTX *context));
+void SHA1Update __P((SHA1_CTX *context, const u_char *data, u_int len));
+void SHA1Final __P((u_char digest[20], SHA1_CTX *context));
+#ifndef _KERNEL
+char *SHA1End __P((SHA1_CTX *, char *));
+char *SHA1File __P((char *, char *));
+char *SHA1Data __P((const u_char *, size_t, char *));
+#endif /* _KERNEL */
+
+#endif /* _SYS_SHA1_H_ */