summaryrefslogtreecommitdiffstats
path: root/movement/lib/TOTP-MCU/sha1.h
diff options
context:
space:
mode:
authorJoey Castillo <joeycastillo@utexas.edu>2021-11-24 12:14:17 -0500
committerJoey Castillo <joeycastillo@utexas.edu>2021-11-24 12:14:17 -0500
commit3a420d5c6cfded6a04f4c78aa98c5d4ae7de8ca1 (patch)
tree1364472d05920d9bda9d8905201cf3e95cef148a /movement/lib/TOTP-MCU/sha1.h
parent4a0ff5577363a1bd315693b41f448e3774de9e34 (diff)
downloadSensor-Watch-3a420d5c6cfded6a04f4c78aa98c5d4ae7de8ca1.tar.gz
Sensor-Watch-3a420d5c6cfded6a04f4c78aa98c5d4ae7de8ca1.tar.bz2
Sensor-Watch-3a420d5c6cfded6a04f4c78aa98c5d4ae7de8ca1.zip
add header guards, move declarations to source file
Diffstat (limited to 'movement/lib/TOTP-MCU/sha1.h')
-rw-r--r--movement/lib/TOTP-MCU/sha1.h19
1 files changed, 5 insertions, 14 deletions
diff --git a/movement/lib/TOTP-MCU/sha1.h b/movement/lib/TOTP-MCU/sha1.h
index 2257e367..2db8fdf8 100644
--- a/movement/lib/TOTP-MCU/sha1.h
+++ b/movement/lib/TOTP-MCU/sha1.h
@@ -1,25 +1,16 @@
+#ifndef SHA1_H_
+#define SHA1_H_
+
#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);
+
+#endif // SHA1_H