libhasha 2.2.2
|
Header file for the MD5 cryptographic hash function. More...
#include "internal/internal.h"
Go to the source code of this file.
Classes | |
struct | ha_md5_context |
Context structure for MD5 hashing. More... |
Macros | |
#define | HA_MD5_BLOCK_SIZE 64 |
Block size (in bytes) for the MD5 algorithm. | |
#define | HA_MD5_DIGEST_SIZE ha_bB(128) |
Digest size (in bytes) for the MD5 algorithm (128 bits). |
Typedefs | |
typedef struct ha_md5_context | ha_md5_context |
Functions | |
HA_PUBFUN void | ha_md5_init (ha_md5_context *ctx) |
Initializes the MD5 context. | |
HA_PUBFUN void | ha_md5_update (ha_md5_context *ctx, ha_inbuf_t data, size_t len) |
Updates the MD5 context with new data. | |
HA_PUBFUN void | ha_md5_final (ha_md5_context *ctx, ha_digest_t digest) |
Finalizes the MD5 computation and produces the hash digest. | |
HA_PUBFUN void | ha_md5_hash (ha_inbuf_t data, size_t len, ha_digest_t digest) |
Computes the MD5 hash in a one-shot operation. |
Header file for the MD5 cryptographic hash function.
This header file defines the interface for computing the MD5 hash, a widely-used cryptographic hash algorithm that produces a 128-bit (16-byte) digest. The MD5 algorithm processes data in 512-bit blocks and is commonly used for checksum calculations and data integrity verification.
Definition in file md5.h.
#define HA_MD5_BLOCK_SIZE 64 |
#define HA_MD5_DIGEST_SIZE ha_bB(128) |
typedef struct ha_md5_context ha_md5_context |
HA_PUBFUN void ha_md5_final | ( | ha_md5_context * | ctx, |
ha_digest_t | digest ) |
Finalizes the MD5 computation and produces the hash digest.
This function finals the MD5 hash calculation and outputs the resulting digest into the provided buffer.
ctx | Pointer to the MD5 context structure. |
digest | Pointer to the output buffer to store the final MD5 digest (16 bytes). |
HA_PUBFUN void ha_md5_hash | ( | ha_inbuf_t | data, |
size_t | len, | ||
ha_digest_t | digest ) |
Computes the MD5 hash in a one-shot operation.
This function computes the MD5 hash of the provided data in a single call. It initializes, updates, and finals the MD5 computation internally.
data | Pointer to the input data to process. |
len | Length of the input data in bytes. |
digest | Pointer to the output buffer to store the final MD5 digest (16 bytes). |
HA_PUBFUN void ha_md5_init | ( | ha_md5_context * | ctx | ) |
Initializes the MD5 context.
This function initializes the MD5 context to start a new hash computation.
ctx | Pointer to the MD5 context structure to initialize. |
HA_PUBFUN void ha_md5_update | ( | ha_md5_context * | ctx, |
ha_inbuf_t | data, | ||
size_t | len ) |
Updates the MD5 context with new data.
This function processes the provided data and updates the MD5 context state.
ctx | Pointer to the MD5 context structure. |
data | Pointer to the input data to process. |
len | Length of the input data in bytes. |