X-Git-Url: https://git.distorted.org.uk/u/mdw/catacomb/blobdiff_plain/fe6657c961b01ec72e9f35f4c3d96b11b31cf09c..45c0fd363937c6e9b05da04a9167e9912c05ca0c:/tests/tea-test.c diff --git a/tests/tea-test.c b/tests/tea-test.c index be91e16..5c78db4 100644 --- a/tests/tea-test.c +++ b/tests/tea-test.c @@ -6,14 +6,14 @@ * Almost. I changed the types from long to unsigned long. */ -void code(unsigned long* v, unsigned long* k) { +void code(unsigned long* v, unsigned long* k) { unsigned long y=v[0],z=v[1], sum=0, /* set up */ - delta=0x9e3779b9, n=32 ; /* a key schedule constant */ -while (n-->0) { /* basic cycle start */ + delta=0x9e3779b9, n=32 ; /* a key schedule constant */ +while (n-->0) { /* basic cycle start */ sum += delta ; y += (z<<4)+k[0] ^ z+sum ^ (z>>5)+k[1] ; z += (y<<4)+k[2] ^ y+sum ^ (y>>5)+k[3] ; /* end cycle */ - } + } v[0]=y ; v[1]=z ; } int main(void) @@ -42,6 +42,6 @@ int main(void) code(p, k); printf("%08lx%08lx;\n", p[0], p[1]); } - + return (0); }