Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@
* A utility class for constructing expressions.
*/
public class ExpressionImplUtils {
private static final ThreadLocal<SecureRandom> threadLocalSecureRandom =
ThreadLocal.withInitial(SecureRandom::new);
private static final SecureRandom secureRandom = new SecureRandom();

private static final int GCM_IV_LEN = 12;
private static final int GCM_TAG_LEN = 128;
Expand Down Expand Up @@ -153,7 +152,7 @@ private static SecretKeySpec getSecretKeySpec(byte[] key) {

private static byte[] generateIv(CipherMode mode) {
byte[] iv = new byte[mode.ivLength];
threadLocalSecureRandom.get().nextBytes(iv);
secureRandom.nextBytes(iv);
return iv;
}

Expand Down