[botan-devel] strange behavior declaring BigInt on FreeBSD

Jack Lloyd lloyd at randombit.net
Fri Aug 5 01:24:34 EDT 2011


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



More information about the botan-devel mailing list