Closed guidovranken closed 2 years ago
Hi Guido,
I’ll reply in English so that I can CC some other folks.
Thanks for taking the time to test SymCrypt. We really appreciate the effort that goes into that.
Although we are working on the Linux port, this has not been finished yet, and we currently do not support SymCrypt on Linux 32 bits. Trying to track down a bug like this is really hard without porting and running the SymCrypt unit test; it could be a bug anywhere in the big-integer arithmetic, and we have lots of test for that. I’ve been out for a few months, so I don’t know the exact current status. Mitch, can you tell us what the SymCrypt-on-linux status is? We also might have to do another drop to Github with our latest changes soon.
Cheers!
Niels
This has been fixed internally; our next public release will include the changes. For anyone looking for a workaround in the meantime, the problem is this macro:
#if SYMCRYPT_MS_VC
#define SYMCRYPT_MUL32x32TO64( _a, _b ) UInt32x32To64( (_a), (_b) )
#elif SYMCRYPT_GNUC
#define SYMCRYPT_MUL32x32TO64( _a, _b ) ( (unsigned long)(_a)*(unsigned long)(_b) )
#else
#error Unknown compiler
#endif
The SYMCRYPT_GNUC
implementation should instead be ( (UINT64)(_a)*(UINT64)(_b) )
Reproducer:
First, compile SymCrypt like this:
Then compile and run the reproducer:
But it should print: