[botan-devel] strange behavior declaring BigInt on FreeBSD

tiredashell at gmail.com tiredashell at gmail.com
Fri Aug 5 06:37:07 EDT 2011

I'm using the 1.8 release, though I can't recall the exact version
number (is that in a header file somewhere?). The attachment is pretty
much what I was testing with. With TEST defined, the aforementioned
errors result.

On Fri, Aug 5, 2011 at 1:24 AM, Jack Lloyd <lloyd at randombit.net> wrote:
> This certainly seems strange, and may well be a bug in the memory
> containers. Perhaps FreeBSD does something unusual with the memory
> layout such that it just happens to break there and work elsewhere. I
> don't suppose you happen to have a small test case for this? Also,
> which version are you using?
> Thanks,
>  Jack
> On Thu, Aug 04, 2011 at 11:29:42PM -0400, tiredashell at gmail.com wrote:
>> I successfully compiled my program on FreeBSD (8.2-RELEASE amd64) but
>> at runtime, when instantiating an RSA_PrivateKey, Botan would throw
>> either "Invalid private key" or "Blinder: Arguments too small". This
>> was puzzling, because the code ran perfectly fine on OSX and Debian
>> Linux. After several days of debugging, I finally narrowed it down to
>> how I was declaring the BigInts that I fed into the constructor. My
>> code looked like this:
>> Botan::BigInt p_int, q_int, e_int;
>> p_int = Botan::BigInt::decode(p_bytes);
>> q_int = Botan::BigInt::decode(q_bytes);
>> e_int = Botan::BigInt(65537);
>> For some reason, separating declaration from instantiation was the
>> problem. When I rewrote it as below, it no longer complained:
>> Botan::BigInt p_int = Botan::BigInt::decode(p_bytes);
>> Botan::BigInt q_int = Botan::BigInt::decode(q_bytes);
>> Botan::BigInt e_int = Botan::BigInt(65537);
>> I may just be clueless in this regard, but I didn't think there would
>> be any difference between the two. Just thought I'd share.
>> _______________________________________________
>> botan-devel mailing list
>> botan-devel at randombit.net
>> http://lists.randombit.net/mailman/listinfo/botan-devel
> _______________________________________________
> botan-devel mailing list
> botan-devel at randombit.net
> http://lists.randombit.net/mailman/listinfo/botan-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.cpp
Type: text/x-c++src
Size: 579 bytes
Desc: not available
URL: <http://lists.randombit.net/pipermail/botan-devel/attachments/20110805/7914917b/attachment.bin>

More information about the botan-devel mailing list