On Tuesday, September 6, 2016 at 9:56:32 AM UTC-4, jean-pierre.muench wrote:
>
> OK, I've investigated further now and poor man's debugging (e.g. printing
> the occuring values) showed that in the DiscardBytes() function of RDRAND,
> the n values all over the place jumps, from 10000 (as correctly
> initialized) to 4280436152 in the second iteration to 4265895008 in the
> third one and so on, instead of the expected decrease by 64 every round
> (the count variable is set correctly).
>
> This of course results in an infinite loop and thus in the test program
> not finishing.
>
> I don't know how to fix this though, because I don't understand why it
> does this in the first place.
>
I was able to look at this under VS2013. VS2013 is an IDE build for me.
RDRAND is OK, RDSEED was untested because my 4th gen Core i5 does not have
it.
I was also able to look at it under VS2015 Build Tools. VS2015 Build Tools
does _not_ use the IDE. Instead, it uses cryptest.nmake from the command
line to build the library. Again, RDRAND is OK, RDSEED was untested because
my 4th gen Core i5 does not have it.
What you describe sounds like a wild write, but I can't duplicate it.
RDRAND and RDSEED are effectively the same ASM code - it was copied/pasted
and only the ASM opcode changed. Even though I can't run the RDSEED path, I
was able to disassemble it and verify the object code.
Maybe you need to perform a thorough cleaning. You can do it like so:
* Exit Visual Studio
* Unzip cryptopp-X.zip from GitHub (If you use command line, skip this
step)
* Unzip vs2010.zip (it includes a file clean-vs.cmd)
* Run clean-vs.cmd (cleans a lot of old artifacts that can
cross-pollinate)
clean-vs.cmd deletes nearly everything that's created, including output
directories like Win32 and x64; and *.suo files. That's the procedure I use
everytime I unpack vs2010 for testing because I don't want any old
artifacts cross-pollinating.
If the thorough cleaning does not resolve it, then I'm not sure what else
can be done. rdrand.asm is always built with debugging symbols, so you can
actually break-point in the source file and the debugger will snap even in
Release builds.
You can verify the rdrand's ASM recipe by inspecting the XML of
http://github.com/weidai11/cryptopp/blob/master/cryptlib.vcproj . Notice
the recipe includes /Zi for all rules.
--
--
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.
---
You received this message because you are subscribed to the Google Groups
"Crypto++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.