Skip to content

Commit 88b48aa

Browse files
author
tom zhou
committed
clean vn function codes
1 parent 2800f41 commit 88b48aa

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

src/com/iwebpp/crypto/TweetNacl.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
import java.util.Random;
88
import java.util.concurrent.atomic.AtomicLong;
99

10-
import com.iwebpp.crypto.TweetNaclFast.Signature.KeyPair;
11-
1210

1311
/*
1412
* @description
@@ -826,7 +824,7 @@ private static int vn(
826824
int n)
827825
{
828826
int i,d = 0;
829-
for (i = 0; i < n; i ++) d |= (x[i+xoff]&0xff) ^ (y[i+yoff]&0xff);
827+
for (i = 0; i < n; i ++) d |= (x[i+xoff]^y[i+yoff]) & 0xff;
830828
return (1 & ((d - 1) >>> 8)) - 1;
831829
}
832830

@@ -923,7 +921,6 @@ public static int crypto_core_hsalsa20(byte [] out, byte [] in, byte [] k, byte
923921
try {
924922
sigma = "expand 32-byte k".getBytes("utf-8");
925923
} catch (UnsupportedEncodingException e) {
926-
// TODO Auto-generated catch block
927924
e.printStackTrace();
928925
}
929926
}*/

src/com/iwebpp/crypto/TweetNaclFast.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,7 @@ private static int vn(
840840
int n)
841841
{
842842
int i,d = 0;
843-
for (i = 0; i < n; i ++) d |= (x[i+xoff]&0xff) ^ (y[i+yoff]&0xff);
843+
for (i = 0; i < n; i ++) d |= (x[i+xoff]^y[i+yoff]) & 0xff;
844844
return (1 & ((d - 1) >>> 8)) - 1;
845845
}
846846

@@ -1238,7 +1238,6 @@ public static int crypto_core_hsalsa20(byte [] out, byte [] in, byte [] k, byte
12381238
try {
12391239
sigma = "expand 32-byte k".getBytes("utf-8");
12401240
} catch (UnsupportedEncodingException e) {
1241-
// TODO Auto-generated catch block
12421241
e.printStackTrace();
12431242
}
12441243
}*/

0 commit comments

Comments
 (0)