| 1 |
/* { dg-require-effective-target int32plus } */ |
| 2 |
/* { dg-options "-Os -fgraphite-identity" } */ |
| 3 |
|
| 4 |
static void b2w(unsigned int *out, const unsigned char *in, unsigned int len) |
| 5 |
{ |
| 6 |
const unsigned char *bpend = in + len; |
| 7 |
for (; in != bpend; in += 4, ++out) |
| 8 |
{ |
| 9 |
*out = (unsigned int) (in[0] ) | |
| 10 |
(unsigned int) (in[3] << 24); |
| 11 |
} |
| 12 |
} |
| 13 |
static void md4step(unsigned int state[4], const unsigned char *data) |
| 14 |
{ |
| 15 |
unsigned int A, X[16]; |
| 16 |
b2w(X, data, 64); |
| 17 |
state[0] += A; |
| 18 |
} |
| 19 |
void md4sum(void) |
| 20 |
{ |
| 21 |
unsigned char final[128]; |
| 22 |
unsigned int state[4]; |
| 23 |
md4step(state, final); |
| 24 |
md4step(state, final + 64); |
| 25 |
} |