An implementation of MD4 designed for use in the samba SMB authentication protocol. More...
#include <string.h>
#include "md4.h"
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 | mdfour64 (uint32_t *M) |
static void | copy64 (uint32_t *M, const unsigned char *in) |
static void | copy4 (unsigned char *out, uint32_t x) |
static void | mdfour_begin (struct mdfour *md) |
static void | mdfour_tail (const unsigned char *in, int n) |
static void | mdfour_update (struct mdfour *md, const unsigned char *in, int n) |
static void | mdfour_result (struct mdfour *md, unsigned char *out) |
static void | mdfour (unsigned char *out, const unsigned char *in, int n) |
unsigned | Com_BlockChecksum (const void *buffer, int length) |
Variables | |
static struct mdfour * | m |
An implementation of MD4 designed for use in the samba SMB authentication protocol.
Definition in file md4.c.
#define G | ( | X, | |||
Y, | |||||
Z | ) | (((X)&(Y)) | ((X)&(Z)) | ((Y)&(Z))) |
Definition at line 38 of file md4.c.
Referenced by atomic(), checkSizes(), close_state(), f_luaopen(), freeobj(), GCTM(), lua_atpanic(), lua_close(), lua_gc(), lua_getallocf(), lua_getmetatable(), lua_pushthread(), lua_setallocf(), lua_setmetatable(), lua_xmove(), luaC_barrierback(), luaC_barrierf(), luaC_callGCTM(), luaC_freeall(), luaC_fullgc(), luaC_link(), luaC_linkupval(), luaC_separateudata(), luaC_step(), luaD_throw(), luaE_newthread(), luaF_close(), luaF_findupval(), luaM_realloc_(), luaS_newlstr(), luaS_newudata(), luaS_resize(), luaT_gettmbyobj(), luaT_init(), luaV_concat(), markroot(), newlstr(), preinit_state(), singlestep(), and sweeplist().
#define ROUND1 | ( | a, | |||
b, | |||||
c, | |||||
d, | |||||
k, | |||||
s | ) | a = lshift(a + F(b,c,d) + X[k], s) |
Definition at line 46 of file md4.c.
Referenced by mdfour64().
#define ROUND2 | ( | a, | |||
b, | |||||
c, | |||||
d, | |||||
k, | |||||
s | ) | a = lshift(a + G(b,c,d) + X[k] + 0x5A827999,s) |
Definition at line 47 of file md4.c.
Referenced by mdfour64().
#define ROUND3 | ( | a, | |||
b, | |||||
c, | |||||
d, | |||||
k, | |||||
s | ) | a = lshift(a + H(b,c,d) + X[k] + 0x6ED9EBA1,s) |
Definition at line 48 of file md4.c.
Referenced by mdfour64().
unsigned Com_BlockChecksum | ( | const void * | buffer, | |
int | length | |||
) |
MD4-based checksum utility functions Copyright (C) 2000 Jeff Teunissen <d2deek@pmail.net> Author: Jeff Teunissen <d2deek@pmail.net> Date: 01 Jan 2000
Definition at line 208 of file md4.c.
References mdfour().
Referenced by CM_AddMapTile(), and Com_GetScriptChecksum().
static void copy4 | ( | unsigned char * | out, | |
uint32_t | x | |||
) | [static] |
Definition at line 112 of file md4.c.
Referenced by mdfour_result(), and mdfour_tail().
static void copy64 | ( | uint32_t * | M, | |
const unsigned char * | in | |||
) | [static] |
Definition at line 104 of file md4.c.
References i.
Referenced by mdfour_tail(), and mdfour_update().
static void mdfour | ( | unsigned char * | out, | |
const unsigned char * | in, | |||
int | n | |||
) | [static] |
Definition at line 193 of file md4.c.
References mdfour_begin(), mdfour_result(), and mdfour_update().
Referenced by Com_BlockChecksum().
static void mdfour64 | ( | uint32_t * | M | ) | [static] |
static void mdfour_begin | ( | struct mdfour * | md | ) | [static] |
static void mdfour_result | ( | struct mdfour * | md, | |
unsigned char * | out | |||
) | [static] |
static void mdfour_tail | ( | const unsigned char * | in, | |
int | n | |||
) | [static] |
Definition at line 130 of file md4.c.
References copy4(), copy64(), M, mdfour64(), and mdfour::totalN.
Referenced by mdfour_update().
static void mdfour_update | ( | struct mdfour * | md, | |
const unsigned char * | in, | |||
int | n | |||
) | [static] |
start of edit by Forest 'LordHavoc' Hale commented out to prevent crashing when length is 0 if (n == 0) mdfour_tail(in, n); end of edit by Forest 'LordHavoc' Hale
Definition at line 158 of file md4.c.
References copy64(), M, mdfour64(), mdfour_tail(), and mdfour::totalN.
Referenced by mdfour().
Definition at line 35 of file md4.c.
Referenced by Check_FindCompositeSides(), CheckNodraws(), CheckPropagateParserContentFlags(), CL_EventAddMail_f(), CL_NationDrawStats(), CL_NationsMaxFunding(), CL_NetReceiveItem(), Com_AddObjectLinks(), G_ReadItem(), Grid_RecalcRouting(), Irc_Proto_Enqueue(), luaH_getn(), luaZ_read(), match(), ParseBrush(), propagateall(), R_CreateSurfaceFlare(), R_Draw3DGlobe(), R_DrawFlareSurfaces(), R_DrawMaterialSurfaces(), R_ImageClearMaterials(), R_LoadMaterials(), R_Trace(), RotatePointAroundVector(), StringToFilter(), SV_FilterPacket(), SV_FitTile(), SV_LinkEdict(), UI_CloseWindowByRef(), UI_GetUIModel(), UI_MaterialEditorNewStage_f(), unbound_search(), UP_GetUnreadMails(), UP_MailClientClick_f(), UP_OpenMail_f(), UP_SetAllMailsRead_f(), and UP_SetMailButtons_f().