libhasha 2.2.2
Loading...
Searching...
No Matches
sha1.h
Go to the documentation of this file.
1
22
23#if !defined(__HASHA_SHA1_H)
24#define __HASHA_SHA1_H
25
26#include "internal/internal.h"
27
32#define HA_SHA1_BLOCK_SIZE 64
33
38#define HA_SHA1_DIGEST_SIZE ha_bB(160)
39
41
51typedef struct ha_sha1_context
52{
53 uint32_t state[5];
54 uint64_t bit_count;
58
69 const uint8_t *block);
70
81
94 size_t len);
95
109
123HA_PUBFUN void ha_sha1_hash(ha_inbuf_t data, size_t len,
124 ha_digest_t digest);
125
127
128#endif // __HASHA_SHA1_H
#define HA_PUBFUN
Definition hadefs.h:34
#define HA_EXTERN_C_END
Definition hadefs.h:78
#define HA_EXTERN_C_BEG
Definition hadefs.h:70
#define HA_SHA1_BLOCK_SIZE
The block size used in SHA-1 (in bytes).
Definition sha1.h:32
HA_PUBFUN void ha_sha1_transform(ha_sha1_context *ctx, const uint8_t *block)
Performs the SHA-1 transformation step on a 512-bit data block.
HA_PUBFUN void ha_sha1_update(ha_sha1_context *ctx, ha_inbuf_t data, size_t len)
Updates the SHA-1 context with new data.
HA_PUBFUN void ha_sha1_init(ha_sha1_context *ctx)
Initializes the SHA-1 context for a new hash computation.
HA_PUBFUN void ha_sha1_final(ha_sha1_context *ctx, ha_digest_t digest)
Finalizes the SHA-1 context and produces the resulting hash digest.
HA_PUBFUN void ha_sha1_hash(ha_inbuf_t data, size_t len, ha_digest_t digest)
Computes the SHA-1 hash for the given input data in one-shot mode.
SHA-1 context structure used to store the internal state during hashing.
Definition sha1.h:52
uint8_t buffer[HA_SHA1_BLOCK_SIZE]
Definition sha1.h:55
uint32_t state[5]
Definition sha1.h:53
uint64_t bit_count
Definition sha1.h:54
__ha_out_buf_type ha_digest_t
Definition types.h:15
__ha_in_buf_type ha_inbuf_t
Definition types.h:12