The class derived from RandomNumberGenerator is supposed to override one of 
those functions. You need to figure out why that's not happening.

> Date: Fri, 25 Sep 2009 16:53:35 -0600
> From: [email protected]
> To: [email protected]
> Subject: recursion
> 
> I have a routine that has worked for years on 32-bit systems, using
> crypto++ 5.2.1.
> 
> I just updated to crypto++ 5.6.0, compiled for 32-bits (Linux; g++ 4.2),
> and it seems to work fine.
> 
> I then built the same code on a 64-bit system. crypto++ passes the
> cryptest.exe tests just fine, BUT...
> 
> when I run my routine it seems to enter an infinite recursion and
> eventually segfaults.
> 
> Looking under gdb, the recursion is between two lines in cryptlib.cpp:
> lines 260 and 274.
> 
> The relevant portion of the file is:
> 
> ----
> 
> void RandomNumberGenerator::GenerateBlock(byte *output, size_t size)
> {
>       ArraySink s(output, size);
> *LINE 260 GenerateIntoBufferedTransformation(s, DEFAULT_CHANNEL, size);
> }
> 
> void RandomNumberGenerator::DiscardBytes(size_t n)
> {
>   GenerateIntoBufferedTransformation(TheBitBucket(), DEFAULT_CHANNEL, n);
> }
> 
> void
> RandomNumberGenerator::GenerateIntoBufferedTransformation(BufferedTransformation
> &target, const std::string &channel, lword length)
> {
>       FixedSizeSecBlock<byte, 256> buffer;
>       while (length)
>       {
>               size_t len = UnsignedMin(buffer.size(), length);
> *LINE 274     GenerateBlock(buffer, len);
>               target.ChannelPut(channel, buffer, len);
>               length -= len;
>       }
> }
> 
> ----
> 
> It seems quite clear (I think, although maybe I'm being blind somehow) how,
> once one hits line 260, one can enter a state of infinite recursion,
> flipping between line 260 and line 274.
> 
> My question is: how is this supposed to work without recursing infinitely?
> 
>   Doc
> 
> -- 
> Web:  http://www.sff.net/people/N7DR
> 
                                          
_________________________________________________________________
Hotmail® has ever-growing storage! Don’t worry about storage limits.
http://windowslive.com/Tutorial/Hotmail/Storage?ocid=TXT_TAGLM_WL_HM_Tutorial_Storage_062009
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the "Crypto++ Users" 
Google Group.
To unsubscribe, send an email to [email protected].
More information about Crypto++ and this group is available at 
http://www.cryptopp.com.
-~----------~----~----~----~------~----~------~--~---

Reply via email to