summaryrefslogtreecommitdiff
path: root/libjava/gnu/gcj/io/shs.h
diff options
context:
space:
mode:
authorupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
committerupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
commit554fd8c5195424bdbcabf5de30fdc183aba391bd (patch)
tree976dc5ab7fddf506dadce60ae936f43f58787092 /libjava/gnu/gcj/io/shs.h
downloadcbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.bz2
cbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.xz
obtained gcc-4.6.4.tar.bz2 from upstream website;upstream
verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository.
Diffstat (limited to 'libjava/gnu/gcj/io/shs.h')
-rw-r--r--libjava/gnu/gcj/io/shs.h67
1 files changed, 67 insertions, 0 deletions
diff --git a/libjava/gnu/gcj/io/shs.h b/libjava/gnu/gcj/io/shs.h
new file mode 100644
index 000000000..c4b2d5a30
--- /dev/null
+++ b/libjava/gnu/gcj/io/shs.h
@@ -0,0 +1,67 @@
+/* --------------------------------- SHS.H ------------------------------- */
+
+/*
+ * NIST proposed Secure Hash Standard.
+ *
+ * Written 2 September 1992, Peter C. Gutmann.
+ * This implementation placed in the public domain.
+ *
+ * Comments to pgut1@cs.aukuni.ac.nz
+ */
+
+/* Useful defines/typedefs */
+
+#ifndef SHS_H
+#define SHS_H
+
+#include<config.h>
+#if HAVE_INTTYPES_H
+# include <inttypes.h>
+#else
+# if HAVE_STDINT_H
+# include <stdint.h>
+# else
+typedef unsigned int uint8_t __attribute__((mode(QI)));
+/* This is a blatant hack: on Solaris 2.5, pthread.h defines uint32_t
+ in pthread.h, which we sometimes include. We protect our
+ definition the same way Solaris 2.5 does, to avoid redefining it. */
+# ifndef _UINT32_T
+typedef unsigned int uint32_t __attribute__((mode(SI)));
+# endif
+# endif
+#endif
+
+#define PROTO
+
+/* The SHS block size and message digest sizes, in bytes */
+
+#define SHS_BLOCKSIZE 64
+#define SHS_DIGESTSIZE 20
+
+/* The structure for storing SHS info */
+
+typedef struct {
+ uint32_t digest [5]; /* Message digest */
+ uint32_t countLo, countHi; /* 64-bit bit count */
+ uint32_t data [16]; /* SHS data buffer */
+} SHS_INFO;
+
+/* Turn off prototypes if requested */
+#if (defined(NOPROTO) && defined(PROTO))
+# undef PROTO
+#endif
+
+/* Used to remove arguments in function prototypes for non-ANSI C */
+#ifdef PROTO
+# define OF(a) a
+#else /* !PROTO */
+# define OF(a) ()
+#endif /* ?PROTO */
+
+#define local static
+
+void shsInit OF((SHS_INFO *shsInfo));
+void shsUpdate OF((SHS_INFO *shsInfo, uint8_t *buffer, int count));
+void shsFinal OF((SHS_INFO *shsInfo));
+
+#endif