Skip to content

Commit

Permalink
remove unnecessary checkLength() function
Browse files Browse the repository at this point in the history
  • Loading branch information
muzzammilshahid committed Mar 6, 2024
1 parent e0a1b0d commit 9bf9cf5
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions autobahn/src/main/java/xbr/network/crypto/SecretBox.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import static io.xconn.cryptology.SecretBox.box;
import static io.xconn.cryptology.SecretBox.boxOpen;
import static io.xconn.cryptology.Util.checkLength;
import static io.xconn.cryptology.Util.generateRandomBytesArray;

import static xbr.network.Util.NONCE_SIZE;
Expand Down Expand Up @@ -35,9 +36,4 @@ public byte[] decrypt(byte[] ciphertext) {
byte[] message = Arrays.copyOfRange(ciphertext, NONCE_SIZE, ciphertext.length);
return boxOpen(nonce, message, mKey);
}

private void checkLength(byte[] data, int size) {
if (data == null || data.length != size)
throw new IllegalArgumentException("Invalid size: " + data.length);
}
}

0 comments on commit 9bf9cf5

Please sign in to comment.