dRonin
adbada4
dRonin firmware
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
File List
Globals
•
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Groups
Pages
sha1.h
Go to the documentation of this file.
1
/*********************************************************************
2
* Filename: sha1.h
3
* Author: Brad Conte (brad AT bradconte.com)
4
* Copyright:
5
* Disclaimer: This code is presented "as is" without any guarantees.
6
* Details: Defines the API for the corresponding SHA1 implementation.
7
*********************************************************************/
8
9
#ifndef SHA1_H
10
#define SHA1_H
11
12
/*************************** HEADER FILES ***************************/
13
#include <stddef.h>
14
#include <stdint.h>
15
16
/****************************** MACROS ******************************/
17
#define SHA1_BLOCK_SIZE 20 // SHA1 outputs a 20 byte digest
18
19
/**************************** DATA TYPES ****************************/
20
typedef
struct
{
21
uint8_t
data
[64];
22
uint32_t
datalen
;
23
uint64_t
bitlen
;
24
uint32_t
state
[5];
25
uint32_t k[4];
26
}
SHA1_CTX
;
27
28
/*********************** FUNCTION DECLARATIONS **********************/
29
void
sha1_init
(
SHA1_CTX
*ctx);
30
void
sha1_update
(
SHA1_CTX
*ctx,
const
uint8_t
data
[],
size_t
len);
31
void
sha1_final
(
SHA1_CTX
*ctx, uint8_t hash[]);
32
33
#endif // SHA1_H
data
uint8_t data[XFER_BYTES_PER_PACKET]
Definition:
bl_messages.h:129
sha1_final
void sha1_final(SHA1_CTX *ctx, uint8_t hash[])
Definition:
sha1.c:108
sha1_init
void sha1_init(SHA1_CTX *ctx)
Definition:
sha1.c:78
SHA1_CTX::datalen
uint32_t datalen
Definition:
sha1.h:22
SHA1_CTX
Definition:
sha1.h:20
SHA1_CTX::bitlen
uint64_t bitlen
Definition:
sha1.h:23
sha1_update
void sha1_update(SHA1_CTX *ctx, const uint8_t data[], size_t len)
Definition:
sha1.c:93
state
enum arena_state state
Definition:
pios_flashfs_logfs.c:73
flight
Libraries
crypto
sha1.h
Generated by
1.8.6