mirror of
https://github.com/thunderbrewhq/common.git
synced 2025-12-12 03:02:29 +00:00
feat(sha1): add SHA1 functions
This commit is contained in:
parent
7e2cb5242e
commit
1eb1d281a9
3 changed files with 269 additions and 0 deletions
20
common/SHA1.hpp
Normal file
20
common/SHA1.hpp
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
#ifndef COMMON_SHA1_HPP
|
||||
#define COMMON_SHA1_HPP
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
#define SHA1_DIGEST_SIZE 20
|
||||
|
||||
typedef struct {
|
||||
uint32_t state[5];
|
||||
uint32_t count[2];
|
||||
char buffer[64];
|
||||
} SHA1_CONTEXT;
|
||||
|
||||
void SHA1_Final(uint8_t* const digest, SHA1_CONTEXT* context);
|
||||
|
||||
void SHA1_Init(SHA1_CONTEXT* context);
|
||||
|
||||
void SHA1_Update(SHA1_CONTEXT* context, const uint8_t* data, uint32_t len);
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue