Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
8220732: setSeed(long) java api doc is missing warning about provided…
… seed quality

Reviewed-by: wetmore
  • Loading branch information
driverkt authored and wangweij committed Jun 15, 2022
1 parent 6d59561 commit 1855e9d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/java.base/share/classes/java/security/SecureRandom.java
Expand Up @@ -725,6 +725,11 @@ public void setSeed(byte[] seed) {
* in the given {@code long seed}. The given seed supplements,
* rather than replaces, the existing seed. Thus, repeated calls
* are guaranteed never to reduce randomness.
* <p>
* A PRNG {@code SecureRandom} will not seed itself automatically if
* {@code setSeed} is called before any {@code nextBytes} or {@code reseed}
* calls. The caller should make sure that the {@code seed} argument
* contains enough entropy for the security of this {@code SecureRandom}.
*
* <p>This method is defined for compatibility with
* {@code java.util.Random}.
Expand Down

0 comments on commit 1855e9d

Please sign in to comment.