aboutsummaryrefslogtreecommitdiffstats
path: root/src/crypto/sha256_i.h
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2011-11-27 21:00:59 +0200
committerJouni Malinen <j@w1.fi>2011-11-27 21:10:06 +0200
commitdcff088df74e242f1cea4ecc6f1a5e7178669a48 (patch)
tree2e262f096b04f615cec5e025238ed734d63c3e4a /src/crypto/sha256_i.h
parentb32a8d1dfe1c0e39b9a73da099136ff863f26e73 (diff)
downloadexternal_wpa_supplicant_8_ti-dcff088df74e242f1cea4ecc6f1a5e7178669a48.zip
external_wpa_supplicant_8_ti-dcff088df74e242f1cea4ecc6f1a5e7178669a48.tar.gz
external_wpa_supplicant_8_ti-dcff088df74e242f1cea4ecc6f1a5e7178669a48.tar.bz2
Add SHA256-hash functions to generic crypto_hash_* functions
Signed-hostap: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'src/crypto/sha256_i.h')
-rw-r--r--src/crypto/sha256_i.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/crypto/sha256_i.h b/src/crypto/sha256_i.h
new file mode 100644
index 0000000..20ae488
--- /dev/null
+++ b/src/crypto/sha256_i.h
@@ -0,0 +1,31 @@
+/*
+ * SHA-256 internal definitions
+ * Copyright (c) 2003-2011, Jouni Malinen <j@w1.fi>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Alternatively, this software may be distributed under the terms of BSD
+ * license.
+ *
+ * See README and COPYING for more details.
+ */
+
+#ifndef SHA256_I_H
+#define SHA256_I_H
+
+#define SHA256_BLOCK_SIZE 64
+
+struct sha256_state {
+ u64 length;
+ u32 state[8], curlen;
+ u8 buf[SHA256_BLOCK_SIZE];
+};
+
+void sha256_init(struct sha256_state *md);
+int sha256_process(struct sha256_state *md, const unsigned char *in,
+ unsigned long inlen);
+int sha256_done(struct sha256_state *md, unsigned char *out);
+
+#endif /* SHA256_I_H */