[Botan-devel] Botan 1.4.7 VC7 probs... halp? :)

Jack Lloyd lloyd at randombit.net
Mon Oct 3 21:27:40 EDT 2005


Oh, perhaps a better long-term solution. Replace the ByteReader::operator() with:

         byte operator()(u32bit i) { return (X[i/4] >> (8*(3 - (i%4)))); }

which, essentially, manually inlines the call to get_byte. If that works in
VC++ I'll just use that everywhere. It's probably simpler than trying to figure
out why VC is going weird about this, and I really didn't like having those
macros in there.

Thanks,
  Jack

On Mon, Oct 03, 2005 at 09:18:04PM -0400, Jack Lloyd wrote:
> Hi Rachel,
> 
> Apparently, this is what I get for not testing every release on every
> compiler. That error is occuring on some code that is new to 1.4.7,
> and it's simple code, but I must be hitting some interesting bug in
> VC++ with it. I'll make sure to track this down and fix it for 1.4.8,
> but in the meantime, you should be able to get this to work by editing
> cast128.cpp and editing the function key_schedule (at the end of the
> file), like so:
> 
> Remove the definition of the ByteReader class, as well as the declarations
> "ByteReader x(X), z(Z);" Then add the lines
> 
>    #define x(num) get_byte(num%4, X[num/4])
>    #define z(num) get_byte(num%4, Z[num/4])
> 
> where you removed the previous declarations of x and z. And that
> should do the trick.
> 
> That error message is awfully strange - that function certainly
> exists, and it doesn't look like a namespace issue. I wonder what is
> going on with this...
> 
> -Jack
> 
> On Mon, Oct 03, 2005 at 05:46:05PM -0700, Rachel Blackman wrote:
> > So, I have a situation where I need a cryptography library to work 
> > under both Windows and Linux.  Happy day, I stumble across Botan, and 
> > this pleases me greatly: it seems to meet all my needs perfectly, and 
> > even has a comparatively sane API.  (A sadly rare thing these days.)
> > 
> > So I download, and unpack, and it compiles fine on Linux (and also on 
> > the Mac OS X box I use for most UNIX dev).  But... not quite so much on 
> > Windows.  With Visual Studio .NET 2003, I run configure just fine, and 
> > it's building along happily, and runs into:
> > 
> > src\cast128.cpp(131) : error C2326: 'Botan::byte 
> > Botan::CAST_128::key_schedule::ByteReader::operator ()(Botan::u32bit)' 
> > : function cannot access 'Botan::get_byte'
> > 
> > ...and NMAKE (unsurprisingly) coughs up a hairball and dies.  What does 
> > surprise me is that get_byte has been getting used in a number of other 
> > BlockCipher subclasses which compiled just fine before this point in 
> > the make routine.
> > 
> > So, before I crack open too many source files to track down what 
> > happened, I thought I'd toss off a note to see if anyone's familiar 
> > with this one. :)
> > 
> > -- 
> > Rachel 'Sparks' Blackman -- sysadmin, developer, mad scientist
> > "If it is not broken, give me five minutes to redesign it!"
> > 
> > _______________________________________________
> > botan-devel mailing list
> > botan-devel at randombit.net
> > http://www.randombit.net/mailman/listinfo/botan-devel
> _______________________________________________
> botan-devel mailing list
> botan-devel at randombit.net
> http://www.randombit.net/mailman/listinfo/botan-devel



More information about the botan-devel mailing list