Hi Soren,
What does the seedSize argument in AutoSeededRandomPool's
constructor refer to?
Not sure. I did not fire it up under the debugger. I would asssume it
stops buffer overflows (or reading beyond the seed vector).
If you're doing unblocked generation then how do you know when
you can actually use the data?
From osrng.cpp:
void BlockingRng::GenerateBlock(byte *output, unsigned int size)
{
while (size)
{
// on some systems /dev/random will block until all bytes
// are available, on others it will returns immediately
int len = read(m_fd, output, STDMIN(size, (unsigned
int)INT_MAX));
if (len == -1)
throw OS_RNG_Err("read /dev/random");
size -= len;
output += len;
if (size)
sleep(1);
}
}
As an aside, this is also why I think this library should have a
much more extensive documentation. There are so many things
with this library...
I agree
And a couple of corrections (mistakes on my part):
AES is implemented in 128, 192, and 256 bits. I think something cross
fired when I stated 160 bits (possibly a signature scheme).
CRYPTOPP::AES::BLOCKSIZE is 16 [bytes] (IIRC).
Jeff
From validae1.cpp:
bool ValidateRijndael()
{
cout << "\nRijndael validation suite running...\n\n";
FileSource valdata("rijndael.dat", true, new HexDecoder);
bool pass = true;
pass =
BlockTransformationTest(FixedRoundsCipherFactory<RijndaelEncryption,
RijndaelDecryption>(16), valdata, 4) && pass;
pass =
BlockTransformationTest(FixedRoundsCipherFactory<RijndaelEncryption,
RijndaelDecryption>(24), valdata, 3) && pass;
pass =
BlockTransformationTest(FixedRoundsCipherFactory<RijndaelEncryption,
RijndaelDecryption>(32), valdata, 2) && pass;
return pass;
}
On 9/5/06, Søren Dreijer <[EMAIL PROTECTED]> wrote:
Jeff,
> If the OS blocks, it sleeps the thread until the
entire request is
> processed. In Windows, think of a synchronous
versus asynchronous disk
> request. Take a look at Wei's code in osrng.cpp.
That's what I've been assuming so far. I was a bit unsure if it referred to,
like, blocks of data rather than actual execution.
If you're doing unblocked generation then how do you know when you can
actually use the data?
What does the seedSize argument in AutoSeededRandomPool's constructor refer
to?
> Take a look at CryptGenRandom( ) on page 9 of
>
http://csrc.nist.gov/cryptval/140-1/140sp/140sp238.pdf#search=%22microsoft%20cryptographic%20provider%20random%20number%20generator%22.
> This is XP documentation. You'll have to do your
own homework for
> previous NT systems.
I'll have to take a look whether Wei uses that specific function then. If he
does, everything seems to be in order on Windows systems, at least.
> IIRC, GeneratBlock( ) defers to multiple GenerateByte( ) calls.
I bet it does, but in my opinion the first is still cleaner to use if you
need to generate more than a single byte anyway
> * Wei's AES implementation is limited to 160 bits at
this point. 192
> and higher are not implemented.
That I didn't know. So you're saying the maximum symmetric key you can use
with Crypto++ is 160 bits? I really, really wanted 256 bits..
As an aside, this is also why I think this library should have a much more
extensive documentation. There are so many things with this library that you
don't know because there isn't a formal documentation of the basic
algorithms.
Thanks for the replies, Jeff. It's been very long since I received a
constructive reply from this mailing list.
- Soren