|
|
@ -3,7 +3,7 @@ package net.consensys.pantheon.crypto; |
|
|
|
import java.security.SecureRandom; |
|
|
|
import java.security.SecureRandom; |
|
|
|
|
|
|
|
|
|
|
|
public class SecureRandomProvider { |
|
|
|
public class SecureRandomProvider { |
|
|
|
private static final SecureRandom publicSecureRandom = new PRNGSecureRandom(); |
|
|
|
private static final SecureRandom publicSecureRandom = secureRandom(); |
|
|
|
|
|
|
|
|
|
|
|
// Returns a shared instance of secure random intended to be used where the value is used publicly
|
|
|
|
// Returns a shared instance of secure random intended to be used where the value is used publicly
|
|
|
|
public static SecureRandom publicSecureRandom() { |
|
|
|
public static SecureRandom publicSecureRandom() { |
|
|
@ -11,6 +11,11 @@ public class SecureRandomProvider { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static SecureRandom createSecureRandom() { |
|
|
|
public static SecureRandom createSecureRandom() { |
|
|
|
return new PRNGSecureRandom(); |
|
|
|
return secureRandom(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@SuppressWarnings("DoNotCreateSecureRandomDirectly") |
|
|
|
|
|
|
|
private static SecureRandom secureRandom() { |
|
|
|
|
|
|
|
return new SecureRandom(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|