summaryrefslogtreecommitdiffstats
path: root/movement/lib/TOTP/TOTP.h
blob: 4b5897eb91d8ed3b81b45c4df3a9a3b5fa2695ea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#ifndef TOTP_H_
#define TOTP_H_

#include <inttypes.h>
#include "time.h"

typedef enum {
    SHA1,
    SHA224,
    SHA256,
    SHA384,
    SHA512
} hmac_alg;

void TOTP(uint8_t* hmacKey, uint8_t keyLength, uint32_t timeStep, hmac_alg algorithm);
void setTimezone(uint8_t timezone);
uint32_t getCodeFromTimestamp(uint32_t timeStamp);
uint32_t getCodeFromTimeStruct(struct tm time);
uint32_t getCodeFromSteps(uint32_t steps);

#endif // TOTP_H_