public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug libgcj/24642]  New: Failure to produce random values.
@ 2005-11-02 19:38 smythe70 at hotmail dot com
  2005-11-02 19:43 ` [Bug classpath/24642] " pinskia at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: smythe70 at hotmail dot com @ 2005-11-02 19:38 UTC (permalink / raw)
  To: java-prs

The following code should produce random numbers between 0..2^5-1:

import java.math.BigInteger;
import java.security.SecureRandom;

class RndTest {
   public static void main(String[] args) {
      SecureRandom rnd = new SecureRandom();
      for (int i = 0; i < 10; i++)
         System.out.print(new BigInteger(5,rnd) + " ");
   }
}

[ben@localhost junit]$ java -version
java version "1.4.2"
gij (GNU libgcj) version 4.0.0 20050519 (Red Hat 4.0.0-8)
[ben@localhost src]$ java RndTest
0 31 12 21 21 16 8 24 15 20
[ben@localhost src]$ java RndTest
0 31 12 21 21 16 8 24 15 20
[ben@localhost src]$ java -Djava.security.egd=file:/dev/random RndTest
0 31 12 21 21 16 8 24 15 20


[brh@jupiter ~]$ java -version
java version "1.4.2"
gij (GNU libgcj) version 4.0.1 20050727 (Red Hat 4.0.1-5)

Copyright (C) 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
[brh@jupiter ~]$ java RndTest
0 31 12 21 21 16 8 24 15 20
[brh@jupiter ~]$ java RndTest
0 31 12 21 21 16 8 24 15 20 



In addition the following fails (one would expect an 8):
import java.math.BigInteger;
import java.security.SecureRandom;

public class BigIntTest {
   public static void main(String[] args) {
      System.out.println(BigInteger.probablePrime(8,new
SecureRandom()).bitLength());
   }
}

[ben@localhost junit]$ java -version
java version "1.4.2"
gij (GNU libgcj) version 4.0.0 20050519 (Red Hat 4.0.0-8)
[ben@localhost ~]$ java BigIntTest
2
[ben@localhost ~]$ java BigIntTest
2



See also: http://forums.java.sun.com/thread.jspa?messageID=3960085


-- 
           Summary: Failure to produce random values.
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libgcj
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: smythe70 at hotmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24642


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug classpath/24642] Failure to produce random values.
  2005-11-02 19:38 [Bug libgcj/24642] New: Failure to produce random values smythe70 at hotmail dot com
@ 2005-11-02 19:43 ` pinskia at gcc dot gnu dot org
  2006-01-12 17:49 ` audriusa at bluewin dot ch
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-11-02 19:43 UTC (permalink / raw)
  To: java-prs



------- Comment #1 from pinskia at gcc dot gnu dot org  2005-11-02 19:43 -------
This is related to PR 24481.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  BugsThisDependsOn|                            |24481


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24642


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug classpath/24642] Failure to produce random values.
  2005-11-02 19:38 [Bug libgcj/24642] New: Failure to produce random values smythe70 at hotmail dot com
  2005-11-02 19:43 ` [Bug classpath/24642] " pinskia at gcc dot gnu dot org
@ 2006-01-12 17:49 ` audriusa at bluewin dot ch
  2006-04-12 20:18 ` csm at gnu dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: audriusa at bluewin dot ch @ 2006-01-12 17:49 UTC (permalink / raw)
  To: java-prs



------- Comment #2 from audriusa at bluewin dot ch  2006-01-12 17:49 -------
Confirmed for the GNU Classpath CVS version as of Thu Jan 12 18:47:25 CET 2006.
On each start, we print the same sequence of numbers, when Sun's jre each time
prints the different sequence of numbers.


-- 

audriusa at bluewin dot ch changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2006-01-12 17:49:14
               date|                            |
            Version|0.16                        |0.20


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24642


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug classpath/24642] Failure to produce random values.
  2005-11-02 19:38 [Bug libgcj/24642] New: Failure to produce random values smythe70 at hotmail dot com
                   ` (2 preceding siblings ...)
  2006-04-12 20:18 ` csm at gnu dot org
@ 2006-04-12 20:18 ` csm at gnu dot org
  2006-04-14 18:34 ` cvs-commit at developer dot classpath dot org
  2006-04-14 20:01 ` csm at gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: csm at gnu dot org @ 2006-04-12 20:18 UTC (permalink / raw)
  To: java-prs



------- Comment #4 from csm at gnu dot org  2006-04-12 20:18 -------
Testing a patch.


-- 

csm at gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |csm at gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24642


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug classpath/24642] Failure to produce random values.
  2005-11-02 19:38 [Bug libgcj/24642] New: Failure to produce random values smythe70 at hotmail dot com
  2005-11-02 19:43 ` [Bug classpath/24642] " pinskia at gcc dot gnu dot org
  2006-01-12 17:49 ` audriusa at bluewin dot ch
@ 2006-04-12 20:18 ` csm at gnu dot org
  2006-04-12 20:18 ` csm at gnu dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: csm at gnu dot org @ 2006-04-12 20:18 UTC (permalink / raw)
  To: java-prs



------- Comment #3 from csm at gnu dot org  2006-04-12 20:17 -------
*** Bug 27111 has been marked as a duplicate of this bug. ***


-- 

csm at gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |csm at gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24642


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug classpath/24642] Failure to produce random values.
  2005-11-02 19:38 [Bug libgcj/24642] New: Failure to produce random values smythe70 at hotmail dot com
                   ` (3 preceding siblings ...)
  2006-04-12 20:18 ` csm at gnu dot org
@ 2006-04-14 18:34 ` cvs-commit at developer dot classpath dot org
  2006-04-14 20:01 ` csm at gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at developer dot classpath dot org @ 2006-04-14 18:34 UTC (permalink / raw)
  To: java-prs



------- Comment #5 from cvs-commit at developer dot classpath dot org  2006-04-14 18:34 -------
Subject: Bug 24642

CVSROOT:        /cvsroot/classpath
Module name:    classpath
Branch:         
Changes by:     Casey Marshall <rsdio@savannah.gnu.org> 06/04/14 18:33:43

Modified files:
        .              : ChangeLog NEWS 
        java/security  : SecureRandom.java 
Added files:
        vm/reference/java/security: VMSecureRandom.java 

Log message:
        2006-04-14  Casey Marshall  <csm@gnu.org>

        Fixes PR classpath/24642
        * NEWS: add note about SecureRandom changes, and addition of
        VMSecureRandom.
        * java/security/SecureRandom.java (isSeeded): new field.
        (setSeed, setSeed): set `isSeeded' to `true.'
        (nextBytes): seed this instance if `isSeeded' is false.
        (getSeed): call `generateSeed.'
        (SECURERANDOM_SOURCE, JAVA_SECURITY_EGD, logger): new constants.
        (generateSeed, generateSeed): new methods.
        * vm/reference/java/security/VMSecureRandom.java: new file.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/classpath/classpath/ChangeLog.diff?tr1=1.7110&tr2=1.7111&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/classpath/classpath/NEWS.diff?tr1=1.131&tr2=1.132&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/classpath/classpath/java/security/SecureRandom.java.diff?tr1=1.21&tr2=1.22&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/classpath/classpath/vm/reference/java/security/VMSecureRandom.java?rev=1.1


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24642


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug classpath/24642] Failure to produce random values.
  2005-11-02 19:38 [Bug libgcj/24642] New: Failure to produce random values smythe70 at hotmail dot com
                   ` (4 preceding siblings ...)
  2006-04-14 18:34 ` cvs-commit at developer dot classpath dot org
@ 2006-04-14 20:01 ` csm at gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: csm at gnu dot org @ 2006-04-14 20:01 UTC (permalink / raw)
  To: java-prs



------- Comment #6 from csm at gnu dot org  2006-04-14 20:01 -------
Fixed in CVS.


-- 

csm at gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |0.91


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24642


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2006-04-14 20:01 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-02 19:38 [Bug libgcj/24642] New: Failure to produce random values smythe70 at hotmail dot com
2005-11-02 19:43 ` [Bug classpath/24642] " pinskia at gcc dot gnu dot org
2006-01-12 17:49 ` audriusa at bluewin dot ch
2006-04-12 20:18 ` csm at gnu dot org
2006-04-12 20:18 ` csm at gnu dot org
2006-04-14 18:34 ` cvs-commit at developer dot classpath dot org
2006-04-14 20:01 ` csm at gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).