diff options
| author | 2018-07-27 23:51:12 -0400 | |
|---|---|---|
| committer | 2018-07-27 23:51:12 -0400 | |
| commit | feda8a7db8d1d7c5439aa8f8feef7cc0dd2b59a0 (patch) | |
| tree | 1e50f5f666f419143f510d5ded00fe2006b7bd85 /Plugins/DbSqliteWx/sha1.h | |
| parent | d9aa870e5d509cc7309ab82dd102a937ab58613a (diff) | |
New upstream version 3.2.1+dfsg1upstream/3.2.1+dfsg1
Diffstat (limited to 'Plugins/DbSqliteWx/sha1.h')
| -rw-r--r-- | Plugins/DbSqliteWx/sha1.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/Plugins/DbSqliteWx/sha1.h b/Plugins/DbSqliteWx/sha1.h new file mode 100644 index 0000000..120d0a2 --- /dev/null +++ b/Plugins/DbSqliteWx/sha1.h @@ -0,0 +1,29 @@ +/* public api for steve reid's public domain SHA-1 implementation */ +/* this file is in the public domain */ + +#ifndef SHA1_H_ +#define SHA1_H_ (1) + +/** SHA-1 Context */ +typedef struct { + uint32_t h[5]; + /**< Context state */ + uint32_t count[2]; + /**< Counter */ + uint8_t buffer[64]; /**< SHA-1 buffer */ +} sha1_ctx; + +#define SHA1_BLOCK_SIZE 64 +/** SHA-1 Digest size in bytes */ +#define SHA1_DIGEST_SIZE 20 + +void sha1_init(sha1_ctx *context); + +void sha1_update(sha1_ctx *context, const void *p, size_t len); + +void sha1_final(sha1_ctx *context, uint8_t digest[SHA1_DIGEST_SIZE]); + +void sha1_transform(sha1_ctx *context, const uint8_t buffer[64]); + +#endif /* SHA1_H_ */ + |
