X-Git-Url: https://git.sommitrealweird.co.uk/onak.git/blobdiff_plain/aabf2c1bd3e37fb70b674dba243f927069909534..b7a8b5277d37b289361ff0cc881632f527e4d5db:/sha1.h?ds=sidebyside diff --git a/sha1.h b/sha1.h index ea0b4db..487160a 100644 --- a/sha1.h +++ b/sha1.h @@ -9,18 +9,18 @@ #ifndef _SHA1_H # define _SHA1_H +#include #include -typedef struct { - u_int32_t state[5]; - u_int32_t count[2]; +struct sha1_ctx { + uint32_t state[5]; + uint32_t count[2]; unsigned char buffer[64]; -} SHA1_CTX; +}; -void SHA1Transform(u_int32_t state[5], const unsigned char buffer[64]); -void SHA1Init(SHA1_CTX* context); -void SHA1Update(SHA1_CTX* context, const unsigned char* data, u_int32_t len); -void SHA1Final(unsigned char digest[20], SHA1_CTX* context); +void sha1_init(struct sha1_ctx *ctx); +void sha1_update(struct sha1_ctx *ctx, unsigned length, const uint8_t *data); +void sha1_digest(struct sha1_ctx *ctx, unsigned length, uint8_t *digest); # define SHA1_Transform SHA1Transform # define SHA1_Init SHA1Init