public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
From: "csm at gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: java-prs@gcc.gnu.org
Subject: [Bug classpath/24481] SecureRandom.setSeed has no impact
Date: Wed, 12 Apr 2006 04:46:00 -0000	[thread overview]
Message-ID: <20060412044616.7717.qmail@sourceware.org> (raw)
In-Reply-To: <bug-24481-11561@http.gcc.gnu.org/bugzilla/>



------- Comment #9 from csm at gnu dot org  2006-04-12 04:46 -------
Created an attachment (id=11246)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=11246&action=view)
SecureRandom setSeed test

I'm testing a patch for this.

Note that the attached test case will repeatedly output the same bytes.
However, if you change the byte array size to 20 or more, the output is
different per call to `nextBytes'. SHA1 is 20 bytes long, so I suspect that we
were keeping a buffer in our secure random the size of the hash function, and
when we add a seed to it, we are resetting the index into this buffer.


-- 


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


  parent reply	other threads:[~2006-04-12  4:46 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-22  0:52 [Bug java/24481] New: " jrandom-gcc at i2p dot net
2005-10-22  2:28 ` [Bug classpath/24481] " pinskia at gcc dot gnu dot org
2005-10-22  2:36 ` pinskia at gcc dot gnu dot org
2005-10-24 18:47 ` tromey at gcc dot gnu dot org
2006-04-07 11:07 ` david at jpackage dot org
2006-04-11  4:21 ` csm at gnu dot org
2006-04-11  4:34 ` david at jpackage dot org
2006-04-11 20:58 ` csm at gnu dot org
2006-04-12  0:11 ` david at jpackage dot org
2006-04-12  4:46 ` csm at gnu dot org [this message]
2006-04-12 16:39 ` cvs-commit at developer dot classpath dot org
2006-04-12 18:19 ` csm at gnu dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060412044616.7717.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=java-prs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).