|
libaaruformat 1.0
Aaru Data Preservation Suite - Format Library
|
#include <errno.h>#include <stdint.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include "aaruformat.h"#include "spamsum.h"Go to the source code of this file.
Macros | |
| #define | ROLL_SUM(ctx) |
| #define | SUM_HASH(c, h) |
| #define | SSDEEP_BS(index) |
Functions | |
| spamsum_ctx * | aaruf_spamsum_init (void) |
| int | aaruf_spamsum_update (spamsum_ctx *ctx, const uint8_t *data, const uint32_t len) |
| Updates the spamsum context with new data. | |
| void | aaruf_spamsum_free (spamsum_ctx *ctx) |
| Frees a spamsum (fuzzy hash) context. | |
| void | fuzzy_engine_step (spamsum_ctx *ctx, uint8_t c) |
| void | roll_hash (spamsum_ctx *ctx, uint8_t c) |
| void | fuzzy_try_reduce_blockhash (spamsum_ctx *ctx) |
| void | fuzzy_try_fork_blockhash (spamsum_ctx *ctx) |
| int | aaruf_spamsum_final (spamsum_ctx *ctx, uint8_t *result) |
Variables | |
| static uint8_t | b64 [] |
| #define ROLL_SUM | ( | ctx | ) |
Definition at line 80 of file spamsum.c.
Referenced by aaruf_spamsum_final(), and fuzzy_engine_step().
| #define SSDEEP_BS | ( | index | ) |
Definition at line 82 of file spamsum.c.
Referenced by aaruf_spamsum_final(), fuzzy_engine_step(), and fuzzy_try_reduce_blockhash().
| #define SUM_HASH | ( | c, | |
| h ) |
Definition at line 81 of file spamsum.c.
Referenced by fuzzy_engine_step().
| int aaruf_spamsum_final | ( | spamsum_ctx * | ctx, |
| uint8_t * | result ) |
Definition at line 191 of file spamsum.c.
References AARU_CALL, AARU_EXPORT, b64, spamsum_ctx::bh, spamsum_ctx::bh_end, spamsum_ctx::bh_start, blockhash_ctx::d_len, blockhash_ctx::digest, FUZZY_MAX_RESULT, blockhash_ctx::h, blockhash_ctx::half_digest, blockhash_ctx::half_h, NUM_BLOCKHASHES, ROLL_SUM, SPAMSUM_LENGTH, and SSDEEP_BS.
Referenced by write_checksum_block().
| void aaruf_spamsum_free | ( | spamsum_ctx * | ctx | ) |
Frees a spamsum (fuzzy hash) context.
| ctx | Pointer to the spamsum context to free. |
Definition at line 75 of file spamsum.c.
References AARU_CALL, and AARU_EXPORT.
Referenced by cleanup_failed_create(), and write_checksum_block().
| spamsum_ctx * aaruf_spamsum_init | ( | void | ) |
Definition at line 37 of file spamsum.c.
References AARU_CALL, AARU_EXPORT, spamsum_ctx::bh, spamsum_ctx::bh_end, blockhash_ctx::h, blockhash_ctx::half_h, and HASH_INIT.
Referenced by aaruf_create().
| int aaruf_spamsum_update | ( | spamsum_ctx * | ctx, |
| const uint8_t * | data, | ||
| const uint32_t | len ) |
Updates the spamsum context with new data.
| ctx | Pointer to the spamsum context. |
| data | Pointer to the data to process. |
| len | Length of the data in bytes. |
Definition at line 59 of file spamsum.c.
References AARU_CALL, AARU_EXPORT, fuzzy_engine_step(), and spamsum_ctx::total_size.
Referenced by aaruf_write_sector(), and aaruf_write_sector_long().
|
inline |
Definition at line 84 of file spamsum.c.
References AARU_LOCAL, b64, spamsum_ctx::bh, spamsum_ctx::bh_start, blockhash_ctx::d_len, blockhash_ctx::digest, fuzzy_try_fork_blockhash(), fuzzy_try_reduce_blockhash(), blockhash_ctx::h, blockhash_ctx::half_digest, blockhash_ctx::half_h, HASH_INIT, roll_hash(), ROLL_SUM, SPAMSUM_LENGTH, SSDEEP_BS, and SUM_HASH.
Referenced by aaruf_spamsum_update().
|
inline |
Definition at line 175 of file spamsum.c.
References AARU_LOCAL, spamsum_ctx::bh, spamsum_ctx::bh_end, blockhash_ctx::d_len, blockhash_ctx::digest, blockhash_ctx::h, blockhash_ctx::half_digest, blockhash_ctx::half_h, and NUM_BLOCKHASHES.
Referenced by fuzzy_engine_step().
|
inline |
Definition at line 155 of file spamsum.c.
References AARU_LOCAL, spamsum_ctx::bh, spamsum_ctx::bh_end, spamsum_ctx::bh_start, blockhash_ctx::d_len, SPAMSUM_LENGTH, SSDEEP_BS, and spamsum_ctx::total_size.
Referenced by fuzzy_engine_step().
|
inline |
Definition at line 137 of file spamsum.c.
References AARU_LOCAL, roll_state::h1, roll_state::h2, roll_state::h3, roll_state::n, spamsum_ctx::roll, ROLLING_WINDOW, and roll_state::window.
Referenced by fuzzy_engine_step().
|
static |
Definition at line 32 of file spamsum.c.
Referenced by aaruf_spamsum_final(), and fuzzy_engine_step().