27#include "librsync_export.h"
29LIBRSYNC_EXPORT
const int RS_MD4_SUM_LENGTH = 16;
30LIBRSYNC_EXPORT
const int RS_BLAKE2_SUM_LENGTH = 32;
33rs_weak_sum_t rs_calc_weak_sum(
weaksum_kind_t kind,
void const *buf,
size_t len)
35 if (kind == RS_ROLLSUM) {
38 RollsumUpdate(&sum, buf, len);
39 return RollsumDigest(&sum);
43 rabinkarp_update(&sum, buf, len);
44 return rabinkarp_digest(&sum);
62 rs_mdfour((
unsigned char *)sum, buf, len);
65 blake2b_init(&ctx, RS_MAX_STRONG_SUM_LENGTH);
66 blake2b_update(&ctx, (
const uint8_t *)buf, len);
67 blake2b_final(&ctx, (uint8_t *)sum, RS_MAX_STRONG_SUM_LENGTH);
Abstract wrappers around different weaksum and strongsum implementations.
strongsum_kind_t
Strongsum implementations.
weaksum_kind_t
Weaksum implementations.
The rabinkarp_t state type.
The rs_mdfour state type.