Skip to content

Commit ace1dc4

Browse files
committed
Partial patch application of [CODEC-148] More tests and minor things. Remove FindBugs' "vacuous" ops with 0xffffffff.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/codec/trunk@1379785 13f79535-47bb-0310-9956-ffa450edef68
1 parent fc393f7 commit ace1dc4

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

src/main/java/org/apache/commons/codec/digest/UnixCrypt.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -338,8 +338,6 @@ private static int[] body(int schedule[], int eSwap0, int eSwap1) {
338338
t = right;
339339
right = left >>> 1 | left << 31;
340340
left = t >>> 1 | t << 31;
341-
left &= 0xffffffff;
342-
right &= 0xffffffff;
343341
int results[] = new int[2];
344342
permOp(right, left, 1, 0x55555555, results);
345343
right = results[0];
@@ -414,10 +412,10 @@ private static int[] desSetKey(byte key[]) {
414412
d &= 0xfffffff;
415413
int s = SKB[0][c & 0x3f] | SKB[1][c >>> 6 & 0x3 | c >>> 7 & 0x3c] | SKB[2][c >>> 13 & 0xf | c >>> 14 & 0x30] | SKB[3][c >>> 20 & 0x1 | c >>> 21 & 0x6 | c >>> 22 & 0x38];
416414
int t = SKB[4][d & 0x3f] | SKB[5][d >>> 7 & 0x3 | d >>> 8 & 0x3c] | SKB[6][d >>> 15 & 0x3f] | SKB[7][d >>> 21 & 0xf | d >>> 22 & 0x30];
417-
schedule[j++] = (t << 16 | s & 0xffff) & 0xffffffff;
415+
schedule[j++] = (t << 16 | s & 0xffff);
418416
s = s >>> 16 | t & 0xffff0000;
419417
s = s << 4 | s >>> 28;
420-
schedule[j++] = s & 0xffffffff;
418+
schedule[j++] = s;
421419
}
422420

423421
return schedule;

0 commit comments

Comments
 (0)