48 return (X & Y) | ((~X) & Z);
54 return (X & Y) | (X & Z) | (Y & Z);
67 return ((x << s) & 0xFFFFFFFF) | (x >> (32 - s));
70#define ROUND1(a,b,c,d,k,s) a = lshift(a + F(b,c,d) + X[k], s)
71#define ROUND2(a,b,c,d,k,s) a = lshift(a + G(b,c,d) + X[k] + (uint32)0x5A827999,s)
72#define ROUND3(a,b,c,d,k,s) a = lshift(a + H(b,c,d) + X[k] + (uint32)0x6ED9EBA1,s)
82 for (j = 0; j < 16; j++)
151 for (j = 0; j < 16; j++)
160 for (i = 0; i < 16; i++)
161 M[i] = (in[i * 4 + 3] << 24) | (in[i * 4 + 2] << 16) |
162 (in[i * 4 + 1] << 8) | (in[i * 4 + 0] << 0);
169 out[1] = (x >> 8) & 0xFF;
170 out[2] = (x >> 16) & 0xFF;
171 out[3] = (x >> 24) & 0xFF;
176mdfour(
unsigned char *out,
unsigned char *in,
int n)
178 unsigned char buf[128];
195 for (i = 0; i < 128; i++)
212 for (i = 0; i < 128; i++)
#define ROUND3(a, b, c, d, k, s)
static void copy4(unsigned char *out, uint32 x)
static uint32 H(uint32 X, uint32 Y, uint32 Z)
static uint32 G(uint32 X, uint32 Y, uint32 Z)
#define ROUND2(a, b, c, d, k, s)
static void mdfour64(uint32 *M)
static void copy64(uint32 *M, unsigned char *in)
#define ROUND1(a, b, c, d, k, s)
static uint32 F(uint32 X, uint32 Y, uint32 Z)
static uint32 lshift(uint32 x, int s)
void mdfour(unsigned char *out, unsigned char *in, int n)