URL
https://opencores.org/ocsvn/csa/csa/trunk
[/] [csa/] [trunk/] [sw_sim/] [csa.c] - Diff between revs 43 and 49
Show entire file |
Details |
Blame |
View Log
Rev 43 |
Rev 49 |
Line 390... |
Line 390... |
|
|
if (j != N) {
|
if (j != N) {
|
stream_cypher(0, ck, NULL, stream);
|
stream_cypher(0, ck, NULL, stream);
|
|
|
/* xor sb x stream */
|
/* xor sb x stream */
|
DEBUG_OUTPUT_ARR(&encrypted[offset+8*j+0],8);
|
|
DEBUG_OUTPUT_ARR(stream,8);
|
|
for(i=0; i<8; i++)
|
for(i=0; i<8; i++)
|
ib[i] = encrypted[offset+8*j+i] ^ stream[i];
|
ib[i] = encrypted[offset+8*j+i] ^ stream[i];
|
}
|
}
|
else {
|
else {
|
/* last block - sb[N+1] = IV(initialisation vetor)(=0) */
|
/* last block - sb[N+1] = IV(initialisation vetor)(=0) */
|
Line 407... |
Line 405... |
DEBUG_OUTPUT_ARR(ib,8);
|
DEBUG_OUTPUT_ARR(ib,8);
|
DEBUG_OUTPUT_ARR(block,8);
|
DEBUG_OUTPUT_ARR(block,8);
|
#endif
|
#endif
|
|
|
/* xor ib x block */
|
/* xor ib x block */
|
DEBUG_OUTPUT_ARR(block,8);
|
|
for(i=0; i<8; i++)
|
for(i=0; i<8; i++)
|
decrypted[offset+8*(j-1)+i] = ib[i] ^ block[i];
|
decrypted[offset+8*(j-1)+i] = ib[i] ^ block[i];
|
DEBUG_OUTPUT_ARR(&decrypted[offset+8*(j-1)+0],8);
|
|
} /* for(j=1; j<(N+1); j++) */
|
} /* for(j=1; j<(N+1); j++) */
|
|
|
if (residue) {
|
if (residue) {
|
stream_cypher(0, ck, NULL, stream);
|
stream_cypher(0, ck, NULL, stream);
|
for (i=0;i<residue;i++)
|
for (i=0;i<residue;i++)
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.