Hello,
i write my own application to test the RC6 cryptographic algorithm and i tried
to compile it on TOSSIM but i get those errors :$ make micaz simmkdir -p
simbuild/micaz placing object files in simbuild/micaz writing XML schema to
app.xml compiling TestRC6 to object file sim.oncc -c -DUSE_DL_IMPORT -fpic -o
simbuild/micaz/sim.o -g -O0 -tossim -fnesc-nido-tosnodes=1000 -fnesc-simulate
-fnesc-nido-motenumber=sim_node\(\) -Wall -Wshadow -Wnesc-all -target=micaz
-fnesc-cfile=simbuild/micaz/app.c -board=micasb -DDEFINED_TOS_AM_GROUP=0x22
--param max-inline-insns-single=100000 -DIDENT_APPNAME=\"TestRC6\"
-DIDENT_USERNAME=\"Administrateur\" -DIDENT_HOSTNAME=\"v8fmk15ebx5la4b\"
-DIDENT_USERHASH=0xf17b64ddL -DIDENT_TIMESTAMP=0x4c0cfbefL
-DIDENT_UIDHASH=0x1d860520L -Wno-nesc-data-race TestRC6.nc
-fnesc-dump=components -fnesc-dump=variables -fnesc-dump=constants
-fnesc-dump=typedefs -fnesc-dump=interfacedefs -fnesc-dump=tags
-fnesc-dumpfile=app.xmlIn file included from
/opt/tinyos-2.x/tos/platforms/mica/sim/MeasureClockC.nc:1, from
/opt/tinyos-2.x/tos/platforms/mica/sim/PlatformC.nc:40, from
/opt/tinyos-2.x/tos/lib/tossim/MainC.nc:44, from
TestRC6.nc:12:/opt/tinyos-2.x/tos/system/scale.h:13: syntax error before `16'In
file included from TestRC6.nc:13:In component
`RC6C':/opt/tinyos-2.x/tos/system/RC6C.nc: In function
`RC6.encrypt':/opt/tinyos-2.x/tos/system/RC6C.nc:55: syntax error before
`32'/opt/tinyos-2.x/tos/system/RC6C.nc:69: invalid lvalue in
assignment/opt/tinyos-2.x/tos/system/RC6C.nc: In function
`RC6.decrypt':/opt/tinyos-2.x/tos/system/RC6C.nc:90: syntax error before
`32'/opt/tinyos-2.x/tos/system/RC6C.nc:110: invalid lvalue in assignmentmake:
*** [sim-exe] Error 1
those are my functions where there is errors:
command void RC6.encrypt(uint8_t *in_block, uint8_t *S, uint8_t *out_block){
uint8_t i,j,x; uint8_t A, B, C, D, t, u; /* range of the
plaintext in four blocks A,B,C and D */ A =
in_block[0]; B = in_block[1]; C = in_block[2];
D = in_block[3]; B = B + S[0]; D = D +
S[1]; for (i = 2; i <= 2 * r; i = i+2) { t =
ROTL(B * (2 * B + 1), lgw); u = ROTL(D * (2 * D + 1), lgw); A =
ROTL(A ^ t, u) + S[i]; C = ROTL(C ^ u, t) + S[i + 1];
x = A; A = B; B = C; C = D; D =
x; } A = A + S[2 * r + 2]; C = C + S[2 * r + 3];
out_block[0] = A; out_block[1] = B; out_block[2] = C;
out_block[3] = D; }
command void RC6.decrypt(uint8_t *in_block, uint8_t *S, uint8_t *out_block){
uint8_t i,j ; uint8_t A, B, C, D, t, u; uint8_t x; /*
range of the Chiphertext in four blocks A,B,C and D */
A = in_block[0]; B = in_block[1];
C = in_block[2]; D = in_block[3]; C = C - S[2 * r
+ 3]; A = A - S[2 * r + 2]; for (i = 2 * r; i >=
2; i =i-2) { x = D; D = C; C = B;
B = A; A = x; u = ROTL(D * (2 * D + 1), lgw);
t = ROTL(B * (2 * B + 1), lgw); C = ROTR(C - S[i + 1], t) ^
u; A = ROTR(A - S[i], u) ^ t; } D = D - S[1]; B =
B - S[0]; out_block[0] = A; out_block[1] = B; out_block[2] = C;
out_block[3] = D; }
of course i defined the boolean operators, ROTL and ROTR functions in a .h
fileCould you please help me??
_________________________________________________________________
Hotmail : une messagerie fiable avec une protection anti-spam performante
https://signup.live.com/signup.aspx?id=60969_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help