projects
/
u
/
mdw
/
catacomb
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
tests/gdsa: Test from P1363.
[u/mdw/catacomb]
/
tests
/
tea-test.c
diff --git
a/tests/tea-test.c
b/tests/tea-test.c
index
be91e16
..
5c78db4
100644
(file)
--- a/
tests/tea-test.c
+++ b/
tests/tea-test.c
@@
-6,14
+6,14
@@
* Almost. I changed the types from long to unsigned long.
*/
* 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 */
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 */
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)
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]);
}
code(p, k);
printf("%08lx%08lx;\n", p[0], p[1]);
}
-
+
return (0);
}
return (0);
}