\r
package estreamj.ciphers.trivium;\r
\r
-import estreamj.framework.*;\r
+import estreamj.framework.ESJException;\r
+import estreamj.framework.Engine;\r
+import estreamj.framework.ICipher;\r
+import estreamj.framework.ICipherMaker;\r
+import estreamj.framework.Utils;\r
\r
public class Trivium implements ICipher \r
{\r
// NOTE: could save some code memory by merging the two blocks, but that\r
// would decrease the speed because of additional conditional jumps...\r
outEnd = outOfs + (len & 3);\r
- if (0 < outEnd)\r
+ //if (0 < outEnd)\r
+ if (outOfs < outEnd) // Peli: Apr 3, 2009: BUGFIX\r
{\r
int t1, t2, t3, reg;\r
\r
int offset = 0;\r
int numRead = 0;\r
while ((numRead = is.read(bytesIn, 0, bytesLen)) >= 0) {\r
- if ((numRead | 3) != 0) {\r
- Log.d(TAG, "Bytes read is inappropriate number: " + numRead);\r
+ if ((numRead & 3) != 0) {\r
+ Log.d(TAG, "Bytes read is inappropriate number: " + numRead + " : " + (numRead | 3));\r
}\r
\r
tri.process(bytesIn, 0,\r
int offset = 0;\r
numRead = 0;\r
while ((numRead = is.read(bytesIn, 0, bytesLen)) >= 0) {\r
- if ((numRead | 3) != 0) {\r
+ if ((numRead & 3) != 0) {\r
Log.d(TAG, "Bytes read is inappropriate number: " + numRead);\r
}\r
\r