Hello,

I've recently encountered some kind of undefined behaviour and tried to ask 
a question 
<http://stackoverflow.com/questions/39251961/cryptography-bizzare-behaviour-in-release-mode>
 
on Stackoverflow. The answers were kind of expected...
I have a few programs in one solution and have another library using 
CryptoPP classes and adding functionality.
After days of debugging and checking out various possible causes, I've came 
to the conclusion that either something is wrong in the "UncheckedSetKey" 
function or I am still clueless.
Debugging simultaneously with two Visual Studios (2015 - SP3) through the 
same solution with different programs it showed that the values show a 
first difference at this line:

while (true)
{
    rk[keylen/4] = rk[0] ^ _mm_extract_epi32(_mm_aeskeygenassist_si128(temp, 
0), 3) ^ *(rc++); //<--- Here


While this loop is being run quite a few times, it appears to be that the 
array/pointer to array "rc" is out of bounds. The array itself is declared 
and initialized with 10 values.

static const word32 rcLE[] = {
    0x01, 0x02, 0x04, 0x08,
    0x10, 0x20, 0x40, 0x80,
    0x1B, 0x36, /* for 128-bit blocks, Rijndael never uses more than 10 
rcon values */
};
const word32 *rc = rcLE;


Obviously it appears that some random memory area is being accessed.
I cannot spot any kind of error or misuse of CryptoPP in the "faulty" 
program.
Strange enough, the other programs do not seem to have any issues.
This behaviour is the same in 32 AND 64-bit.
Do I see this right ? Or are there by chance some wrong settings / compiler 
flags causing this ?

Regards,
Florian

-- 
-- 
You received this message because you are subscribed to the "Crypto++ Users" 
Google Group.
To unsubscribe, send an email to cryptopp-users-unsubscr...@googlegroups.com.
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 cryptopp-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to