Skip to content

Commit

Permalink
make HSALSA20_SEED global,static variable
Browse files Browse the repository at this point in the history
  • Loading branch information
muzzammilshahid committed Feb 26, 2024
1 parent 492a7f1 commit 5ec6bda
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion autobahn/src/main/java/xbr/network/crypto/SealedBox.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public class SealedBox {
private static int PUBLICKEY_BYTES = 32;
private static final int SEAL_BYTES = PUBLICKEY_BYTES + MAC_BYTES;

private static final byte[] HSALSA20_SEED = new byte[16];
private byte[] publicKey;
private byte[] privateKey;

Expand Down Expand Up @@ -84,7 +85,6 @@ public byte[] computeSharedSecret(byte[] publicKey, byte[] privateKey) {
X25519.scalarMult(privateKey, 0, publicKey, 0, sharedSecret, 0);
// encrypt the shared secret
byte[] key = new byte[32];
byte[] HSALSA20_SEED = new byte[16];
HSalsa20.hsalsa20(key, HSALSA20_SEED, sharedSecret);
return key;
}
Expand Down

0 comments on commit 5ec6bda

Please sign in to comment.