diff options
author | EmilienCourt <emilien.court@telecomnancy.net> | 2023-01-14 17:58:03 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-14 11:58:03 -0500 |
commit | 9ebea46300bd1bc4e3ba51b1c7915e3ba42c471a (patch) | |
tree | 013dfc56976b23c31e5501c9cc31f8ca0aa1c2c2 /movement/lib/TOTP-MCU/blink.c | |
parent | 2e618850702bc9a55b1a530c89ab928c2d09501c (diff) | |
download | Sensor-Watch-9ebea46300bd1bc4e3ba51b1c7915e3ba42c471a.tar.gz Sensor-Watch-9ebea46300bd1bc4e3ba51b1c7915e3ba42c471a.tar.bz2 Sensor-Watch-9ebea46300bd1bc4e3ba51b1c7915e3ba42c471a.zip |
totp : rework and add SHA256/512 (#151)
* totp : rework and add SHA256/512
* totp : comment code
* totp : fix SHA224/SHA384 and examples
* totp : fix bug in totp_face_lfs
* totp : init_totp_record to SHA1
* totp : move TOTP-MCU to TOTP, update README and example
* totp : SHAX, use size_t n instead of harcoded 8
* clarify what to put in TOTP face
Co-authored-by: Emilien <Emilien>
Co-authored-by: joeycastillo <joeycastillo@utexas.edu>
Diffstat (limited to 'movement/lib/TOTP-MCU/blink.c')
-rw-r--r-- | movement/lib/TOTP-MCU/blink.c | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/movement/lib/TOTP-MCU/blink.c b/movement/lib/TOTP-MCU/blink.c deleted file mode 100644 index 9ec14ec6..00000000 --- a/movement/lib/TOTP-MCU/blink.c +++ /dev/null @@ -1,39 +0,0 @@ -#include <msp430.h>
-#include <totp.h>
-#include <stdint.h>
-
-/**
- * blink.c
- */
-void main(void)
-{
- WDTCTL = WDTPW | WDTHOLD; // stop watchdog timer
- P1DIR |= 0x01; // configure P1.0 as output
-
- uint8_t hmacKey[] = {0x4d, 0x79, 0x4c, 0x65, 0x67, 0x6f, 0x44, 0x6f, 0x6f, 0x72}; // Secret key
- TOTP(hmacKey, 10, 7200); // Secret key, Key length, Timestep (7200s - 2hours)
-
- setTimezone(9); // Set timezone
- uint32_t newCode = getCodeFromTimestamp(1557414000); // Timestamp Now
-
- ///////////////// For struct tm //////////////////
- // struct tm datetime;
- // datetime.tm_hour = 9;
- // datetime.tm_min = 0;
- // datetime.tm_sec = 0;
- // datetime.tm_mday = 13;
- // datetime.tm_mon = 5;
- // datetime.tm_year = 2019;
- // uint32_t newCode = getCodeFromTimeStruct(datetime);
- ///////////////////////////////////////////////////
-
- volatile unsigned int i; // volatile to prevent optimization
-
- while(1)
- {
- if (newCode == 0){ // 0 = INPUT HERE
- P1OUT ^= 0x01; // toggle P1.0
- }
- for(i=10000; i>0; i--); // delay
- }
-}
|