Skip to content

Commit

Permalink
Merge pull request #24 from lavalink-devs/fix-arrayindexoutofboundsex…
Browse files Browse the repository at this point in the history
…ception
  • Loading branch information
alula authored Apr 19, 2024
2 parents 9c25ac8 + 6f2c5c4 commit 3119a94
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import java.util.List;

public interface EncryptionMode {
int ZERO_BYTES_LENGTH = 32; // For XSalsa20Poly1305

boolean box(ByteBuf opus, int start, ByteBuf output, byte[] secretKey);

String getName();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

public class XSalsa20Poly1305EncryptionMode implements EncryptionMode {
private final byte[] extendedNonce = new byte[24];
private final byte[] m = new byte[984];
private final byte[] c = new byte[984];
private final byte[] m = new byte[1276 + ZERO_BYTES_LENGTH];
private final byte[] c = new byte[1276 + ZERO_BYTES_LENGTH];
private final TweetNaclFastInstanced nacl = new TweetNaclFastInstanced();

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

public class XSalsa20Poly1305LiteEncryptionMode implements EncryptionMode {
private final byte[] extendedNonce = new byte[24];
private final byte[] m = new byte[984];
private final byte[] c = new byte[984];
private final byte[] m = new byte[1276 + ZERO_BYTES_LENGTH];
private final byte[] c = new byte[1276 + ZERO_BYTES_LENGTH];
private final TweetNaclFastInstanced nacl = new TweetNaclFastInstanced();
private int seq = 0x80000000;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

public class XSalsa20Poly1305SuffixEncryptionMode implements EncryptionMode {
private final byte[] extendedNonce = new byte[24];
private final byte[] m = new byte[984];
private final byte[] c = new byte[984];
private final byte[] m = new byte[1276 + ZERO_BYTES_LENGTH];
private final byte[] c = new byte[1276 + ZERO_BYTES_LENGTH];
private final TweetNaclFastInstanced nacl = new TweetNaclFastInstanced();

@Override
Expand Down

0 comments on commit 3119a94

Please sign in to comment.