SWE-350 TOTP Generator
Milestone 5
The DE-10 board has six 7-segment displays, this can be used to display and generate a time based one-time pin (TOTP).
Loading...
Searching...
No Matches
sha1.h
Go to the documentation of this file.
1
#include <inttypes.h>
2
3
#define HASH_LENGTH 20
4
#define BLOCK_LENGTH 64
5
6
union
_buffer
{
7
uint8_t
b
[
BLOCK_LENGTH
];
8
uint32_t
w
[
BLOCK_LENGTH
/4];
9
}
buffer
;
10
union
_state
{
11
uint8_t
b
[
HASH_LENGTH
];
12
uint32_t
w
[
HASH_LENGTH
/4];
13
}
state
;
14
15
uint8_t
bufferOffset
;
16
uint32_t
byteCount
;
17
uint8_t
keyBuffer
[
BLOCK_LENGTH
];
18
uint8_t
innerHash
[
HASH_LENGTH
];
19
20
void
init
(
void
);
21
void
initHmac
(
const
uint8_t* secret, uint8_t secretLength);
22
uint8_t*
result
(
void
);
23
uint8_t*
resultHmac
(
void
);
24
void
write
(uint8_t);
25
void
writeArray
(uint8_t *
buffer
, uint8_t size);
BLOCK_LENGTH
#define BLOCK_LENGTH
Definition
sha1.h:4
init
void init(void)
Definition
sha1.c:17
state
union _state state
writeArray
void writeArray(uint8_t *buffer, uint8_t size)
Definition
sha1.c:80
HASH_LENGTH
#define HASH_LENGTH
Definition
sha1.h:3
write
void write(uint8_t)
Definition
sha1.c:73
result
uint8_t * result(void)
Definition
sha1.c:104
innerHash
uint8_t innerHash[HASH_LENGTH]
Definition
sha1.h:18
byteCount
uint32_t byteCount
Definition
sha1.h:16
buffer
union _buffer buffer
keyBuffer
uint8_t keyBuffer[BLOCK_LENGTH]
Definition
sha1.h:17
initHmac
void initHmac(const uint8_t *secret, uint8_t secretLength)
Definition
sha1.c:127
resultHmac
uint8_t * resultHmac(void)
Definition
sha1.c:146
bufferOffset
uint8_t bufferOffset
Definition
sha1.h:15
_buffer
Definition
sha1.h:6
_buffer::w
uint32_t w[BLOCK_LENGTH/4]
Definition
sha1.h:8
_buffer::b
uint8_t b[BLOCK_LENGTH]
Definition
sha1.h:7
_state
Definition
sha1.h:10
_state::w
uint32_t w[HASH_LENGTH/4]
Definition
sha1.h:12
_state::b
uint8_t b[HASH_LENGTH]
Definition
sha1.h:11
TOTP-MCU-master
sha1.h
Generated by
1.12.0