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.c File Reference
#include <string.h>
#include "sha1.h"
Include dependency graph for sha1.c:

Go to the source code of this file.

Macros

#define SHA1_K0   0x5a827999
 
#define SHA1_K20   0x6ed9eba1
 
#define SHA1_K40   0x8f1bbcdc
 
#define SHA1_K60   0xca62c1d6
 
#define HMAC_IPAD   0x36
 
#define HMAC_OPAD   0x5c
 

Functions

void init (void)
 
uint32_t rol32 (uint32_t number, uint8_t bits)
 
void hashBlock ()
 
void addUncounted (uint8_t data)
 
void write (uint8_t data)
 
void writeArray (uint8_t *buffer, uint8_t size)
 
void pad ()
 
uint8_t * result (void)
 
void initHmac (const uint8_t *key, uint8_t keyLength)
 
uint8_t * resultHmac (void)
 

Variables

uint8_t sha1InitState []
 

Macro Definition Documentation

◆ HMAC_IPAD

#define HMAC_IPAD   0x36

Definition at line 124 of file sha1.c.

◆ HMAC_OPAD

#define HMAC_OPAD   0x5c

Definition at line 125 of file sha1.c.

◆ SHA1_K0

#define SHA1_K0   0x5a827999

Definition at line 4 of file sha1.c.

◆ SHA1_K20

#define SHA1_K20   0x6ed9eba1

Definition at line 5 of file sha1.c.

◆ SHA1_K40

#define SHA1_K40   0x8f1bbcdc

Definition at line 6 of file sha1.c.

◆ SHA1_K60

#define SHA1_K60   0xca62c1d6

Definition at line 7 of file sha1.c.

Function Documentation

◆ addUncounted()

void addUncounted ( uint8_t data)

Definition at line 64 of file sha1.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hashBlock()

void hashBlock ( )

Definition at line 27 of file sha1.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ init()

void init ( void )

Definition at line 17 of file sha1.c.

Here is the caller graph for this function:

◆ initHmac()

void initHmac ( const uint8_t * key,
uint8_t keyLength )

Definition at line 127 of file sha1.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pad()

void pad ( )

Definition at line 86 of file sha1.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ result()

uint8_t * result ( void )

Definition at line 104 of file sha1.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ resultHmac()

uint8_t * resultHmac ( void )

Definition at line 146 of file sha1.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rol32()

uint32_t rol32 ( uint32_t number,
uint8_t bits )

Definition at line 23 of file sha1.c.

Here is the caller graph for this function:

◆ write()

void write ( uint8_t data)

Definition at line 73 of file sha1.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeArray()

void writeArray ( uint8_t * buffer,
uint8_t size )

Definition at line 80 of file sha1.c.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ sha1InitState

uint8_t sha1InitState[]
Initial value:
= {
0x01,0x23,0x45,0x67,
0x89,0xab,0xcd,0xef,
0xfe,0xdc,0xba,0x98,
0x76,0x54,0x32,0x10,
0xf0,0xe1,0xd2,0xc3
}

Definition at line 9 of file sha1.c.