$treeview $search $mathjax $extrastylesheet
librsync
2.3.0
$projectbrief
|
$projectbrief
|
$searchbox |
MD4 message digest algorithm. More...
Go to the source code of this file.
Defines | |
#define | F(X, Y, Z) (((X)&(Y)) | ((~(X))&(Z))) |
#define | G(X, Y, Z) (((X)&(Y)) | ((X)&(Z)) | ((Y)&(Z))) |
#define | H(X, Y, Z) ((X)^(Y)^(Z)) |
#define | lshift(x, s) (((x)<<(s)) | ((x)>>(32-(s)))) |
#define | ROUND1(a, b, c, d, k, s) a = lshift(a + F(b,c,d) + X[k], s) |
#define | ROUND2(a, b, c, d, k, s) a = lshift(a + G(b,c,d) + X[k] + 0x5A827999,s) |
#define | ROUND3(a, b, c, d, k, s) a = lshift(a + H(b,c,d) + X[k] + 0x6ED9EBA1,s) |
Functions | |
static void | rs_mdfour_block (rs_mdfour_t *md, void const *p) |
static void | rs_mdfour64 (rs_mdfour_t *m, const void *p) |
Update an MD4 accumulator from a 64-byte chunk. | |
static void | copy4 (unsigned char *out, uint32_t const x) |
These next routines are necessary because MD4 is specified in terms of little-endian int32s, but we have a byte buffer. | |
void | rs_mdfour_begin (rs_mdfour_t *md) |
static void | rs_mdfour_tail (rs_mdfour_t *m) |
Handle special behaviour for processing the last block of a file when calculating its MD4 checksum. | |
void | rs_mdfour_update (rs_mdfour_t *md, void const *in_void, size_t n) |
Feed some data into the MD4 accumulator. | |
void | rs_mdfour_result (rs_mdfour_t *md, unsigned char *out) |
void | rs_mdfour (unsigned char *out, void const *in, size_t n) |
Variables | |
static unsigned char | PADDING [64] |
padding data used for finalising |
MD4 message digest algorithm.
This was originally written by Andrew Tridgell for use in Samba. It was then modified by;
2002-06-xx: Robert Weber <robert.weber@Colorado.edu> optimisations and fixed >512M support.
2002-06-27: Donovan Baarda <abo@minkirri.apana.org.au> further optimisations and cleanups.
2004-09-09: Simon Law <sfllaw@debian.org> handle little-endian machines that can't do unaligned access (e.g. ia64, pa-risc).
Definition in file mdfour.c.
static void rs_mdfour64 | ( | rs_mdfour_t * | m, | |
const void * | p | |||
) | [static] |
Update an MD4 accumulator from a 64-byte chunk.
This cannot be used for the last chunk of the file, which must be padded and contain the file length. rs_mdfour_tail() is used for that.
*m | An rs_mdfour_t instance to accumulate with. | |
*p | An array of uint32 integers, as read little-endian from the file. |
static void copy4 | ( | unsigned char * | out, | |
uint32_t const | x | |||
) | [inline, static] |
These next routines are necessary because MD4 is specified in terms of little-endian int32s, but we have a byte buffer.
On little-endian platforms, I think we can just use the buffer pointer directly.
There are some nice endianness routines in glib, including assembler variants. If we ever depended on glib, then it could be good to use them instead.
static void rs_mdfour_tail | ( | rs_mdfour_t * | m | ) | [static] |
Handle special behaviour for processing the last block of a file when calculating its MD4 checksum.
This must be called exactly once per file.
Modified by Robert Weber to use uint64 in order that we can sum files > 2^29 = 512 MB. --Robert.Weber@colorado.edu
void rs_mdfour_update | ( | rs_mdfour_t * | md, | |
void const * | in_void, | |||
size_t | n | |||
) |
unsigned char PADDING[64] [static] |