diff options
Diffstat (limited to 'movement/lib/TOTP-MCU/sha1.h')
m--------- | movement/lib/TOTP-MCU | 0 | ||||
-rw-r--r-- | movement/lib/TOTP-MCU/sha1.h | 25 |
2 files changed, 25 insertions, 0 deletions
diff --git a/movement/lib/TOTP-MCU b/movement/lib/TOTP-MCU deleted file mode 160000 -Subproject 646474a8757e1fca490792e81082b2ad89b966a diff --git a/movement/lib/TOTP-MCU/sha1.h b/movement/lib/TOTP-MCU/sha1.h new file mode 100644 index 00000000..2257e367 --- /dev/null +++ b/movement/lib/TOTP-MCU/sha1.h @@ -0,0 +1,25 @@ +#include <inttypes.h>
+
+#define HASH_LENGTH 20
+#define BLOCK_LENGTH 64
+
+union _buffer {
+ uint8_t b[BLOCK_LENGTH];
+ uint32_t w[BLOCK_LENGTH/4];
+} buffer;
+union _state {
+ uint8_t b[HASH_LENGTH];
+ uint32_t w[HASH_LENGTH/4];
+} state;
+
+uint8_t bufferOffset;
+uint32_t byteCount;
+uint8_t keyBuffer[BLOCK_LENGTH];
+uint8_t innerHash[HASH_LENGTH];
+
+void init(void);
+void initHmac(const uint8_t* secret, uint8_t secretLength);
+uint8_t* result(void);
+uint8_t* resultHmac(void);
+void write(uint8_t);
+void writeArray(uint8_t *buffer, uint8_t size);
|