summaryrefslogtreecommitdiff
path: root/includes/BSHA1.h
diff options
context:
space:
mode:
authorNicolas "Pixel" Noble <pixel@nobis-crew.org>2013-12-25 17:31:09 -0800
committerNicolas "Pixel" Noble <pixel@nobis-crew.org>2013-12-25 17:31:09 -0800
commitd0b856cfbb99b1f1833a18ff556d517a7e3f04d8 (patch)
treec508f82310c51e97a5d489ebfe235f7c07dd8995 /includes/BSHA1.h
parentfb2e7158f66796b98d5f22245d251e460456aed3 (diff)
Making the necessary changes to get libtommath, libtomcrypt and BigInt to compile under MSVC.
Diffstat (limited to 'includes/BSHA1.h')
-rw-r--r--includes/BSHA1.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/includes/BSHA1.h b/includes/BSHA1.h
new file mode 100644
index 0000000..f70f6b7
--- /dev/null
+++ b/includes/BSHA1.h
@@ -0,0 +1,24 @@
+#pragma once
+
+#include <Exceptions.h>
+
+namespace Balau {
+
+class SHA1 {
+ public:
+ SHA1() { reset(); }
+ void reset();
+ void update(const uint8_t* data, const size_t len);
+ void final(uint8_t * digest);
+
+ enum { DIGEST_SIZE = 20 };
+
+ private:
+ void transform(uint32_t state[5], const uint8_t buffer[64]);
+
+ uint32_t m_state[5];
+ uint32_t m_count[2];
+ uint8_t m_buffer[64];
+};
+
+};