dRonin  adbada4
dRonin firmware
 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
uint8_t data[XFER_BYTES_PER_PACKET]
Definition: bl_messages.h:129
void sha1_final(SHA1_CTX *ctx, uint8_t hash[])
Definition: sha1.c:108
void sha1_init(SHA1_CTX *ctx)
Definition: sha1.c:78
uint32_t datalen
Definition: sha1.h:22
Definition: sha1.h:20
uint64_t bitlen
Definition: sha1.h:23
void sha1_update(SHA1_CTX *ctx, const uint8_t data[], size_t len)
Definition: sha1.c:93
enum arena_state state