summaryrefslogtreecommitdiffstats
path: root/tools/hmac-sha1.h
diff options
context:
space:
mode:
authorMaurus Cuelenaere <mcuelenaere@gmail.com>2008-04-09 11:53:28 +0000
committerMaurus Cuelenaere <mcuelenaere@gmail.com>2008-04-09 11:53:28 +0000
commite810721e72d0d70d87b02603299d50809b794470 (patch)
tree19cc6a608e064abd6361493bb5cfa7589c531bba /tools/hmac-sha1.h
parent5a3651bf940001693153ab52a67c9cd87e7d41c7 (diff)
downloadrockbox-e810721e72d0d70d87b02603299d50809b794470.tar.gz
rockbox-e810721e72d0d70d87b02603299d50809b794470.tar.bz2
rockbox-e810721e72d0d70d87b02603299d50809b794470.zip
First commit:
* add Creative (ZVM, 60GB, ZV, ZVW, ZENV) support to scramble * update configure to the correct values git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17042 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'tools/hmac-sha1.h')
-rw-r--r--tools/hmac-sha1.h84
1 files changed, 84 insertions, 0 deletions
diff --git a/tools/hmac-sha1.h b/tools/hmac-sha1.h
new file mode 100644
index 0000000000..149b5bac46
--- /dev/null
+++ b/tools/hmac-sha1.h
@@ -0,0 +1,84 @@
+/*
+ * sha1.h
+ *
+ * Description:
+ * This is the header file for code which implements the Secure
+ * Hashing Algorithm 1 as defined in FIPS PUB 180-1 published
+ * April 17, 1995.
+ *
+ * Many of the variable names in this code, especially the
+ * single character names, were used because those were the names
+ * used in the publication.
+ *
+ * Please read the file sha1.c for more information.
+ *
+ */
+
+#ifndef _SHA1_H_
+#define _SHA1_H_
+
+#include <stdint.h>
+/*
+ * If you do not have the ISO standard stdint.h header file, then you
+ * must typdef the following:
+ * name meaning
+ * uint32_t unsigned 32 bit integer
+ * uint8_t unsigned 8 bit integer (i.e., unsigned char)
+ * int_least16_t integer of >= 16 bits
+ *
+ */
+
+#ifndef _SHA_enum_
+#define _SHA_enum_
+enum
+{
+ shaSuccess = 0,
+ shaNull, /* Null pointer parameter */
+ shaInputTooLong, /* input data too long */
+ shaStateError /* called Input after Result */
+};
+#endif
+#define SHA1HashSize 20
+
+/*
+ * This structure will hold context information for the SHA-1
+ * hashing operation
+ */
+typedef struct SHA1Context
+{
+ uint32_t Intermediate_Hash[SHA1HashSize/4]; /* Message Digest */
+
+ uint32_t Length_Low; /* Message length in bits */
+ uint32_t Length_High; /* Message length in bits */
+
+ /* Index into message block array */
+ int_least16_t Message_Block_Index;
+ uint8_t Message_Block[64]; /* 512-bit message blocks */
+
+ int Computed; /* Is the digest computed? */
+ int Corrupted; /* Is the message digest corrupted? */
+} SHA1Context;
+
+/*
+ * Function Prototypes
+ */
+
+int SHA1Reset( SHA1Context *);
+int SHA1Input( SHA1Context *,
+ const uint8_t *,
+ unsigned int);
+int SHA1Result( SHA1Context *,
+ uint8_t Message_Digest[SHA1HashSize]);
+
+void
+hmac_sha
+(
+ char* k,
+ int lk,
+ char* d,
+ int ld,
+ char* out,
+ int t
+);
+
+#endif