Skip to content

Commit

Permalink
Expand array size to 1276+ZERO_BYTES_LENGTH
Browse files Browse the repository at this point in the history
  • Loading branch information
devoxin committed Apr 15, 2024
1 parent 9c25ac8 commit 6f2c5c4
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 6f2c5c4

Please sign in to comment.