Recently I have been trying to implant Crypto++ into Python using
boost::python. After ironing few things about dynamic CRT & static
linkage I was able to build the thing. The only other thing I had to
also do was changing alignment configuration in Crypto++ by adding

#define CRYPTOPP_ALIGN_DATA(x)
#define CRYPTOPP_DISABLE_X86ASM 1

into config.h just before

#ifndef CRYPTOPP_ALIGN_DATA
...

If I did not do that I observed following error when compiling my
boost::python-ed module:

------ Rebuild All started: Project: CryptoPP_DLL, Configuration:
Release Win32 ------
Deleting intermediate and output files for project 'CryptoPP_DLL',
configuration 'Release|Win32'
Compiling...
stdafx.cpp
Compiling...
CryptoPP_DLL.cpp
E:\boost\include\boost-1_45\boost/python/converter/
as_to_python_function.hpp(21) : error C2719: 'unnamed-parameter':
formal parameter with __declspec(align('8')) won't be aligned
        E:\boost\include\boost-1_45\boost/python/
to_python_converter.hpp(88) : see reference to class template
instantiation
'boost::python::converter::as_to_python_function<T,ToPython>' being
compiled
        with
        [
            T=DES_CFB_ENC,
 
ToPython=boost::python::objects::class_cref_wrapper<DES_CFB_ENC,boost::python::objects::make_instance<DES_CFB_ENC,boost::python::objects::value_holder<DES_CFB_ENC>>>
        ]

-------

this is just beginnig of the build log which is quite windy going on
on next 4500 lines complaining about a lot of things, but I believe
the culprit is here.

I am not at all familiar with boost::python internals or Crypto++
internals to be able to judge whether the issue is cause by the one or
the other, but I hope someone maybe would be able to shed some light
on implications of alignment configuration and the change I did.

I also found out (by trial and error) that I need to disable x86 asm,
which originally I had expected to work with alignment being disabled
(maybe just taking some penalty form un-aligned access.).

Versions used:

boost 1.45 (dynamic linkage with dynamic runtime)
Crypto++ 5.6.1 (static linkage with dynamic runtime)
Python 2.7.1
Microsof Visual C++ Express 2008 SP1

Richard

-- 
You received this message because you are subscribed to the "Crypto++ Users" 
Google Group.
To unsubscribe, send an email to [email protected].
More information about Crypto++ and this group is available at 
http://www.cryptopp.com.

Reply via email to