[botan-devel] Botan 1.11.7 released

Uri Blumenthal uri at MIT.EDU
Sun Jan 26 08:34:23 EST 2014


This is my configuration input:

python configure.py --prefix=/opt/local --with-boost --with-zlib --with-bzip2 --with-lzma --with-gnump --with-openssl --with-boost-python --with-python-version=2.7

Unfortunately I’ve already done some fixes with vi, so can’t list the small issues any more. One that I remember - it did not figure “-L/opt/local/lib” where boost and most of the other libraries reside.

One big deal - certain flags are not being added to the compiler invocation. This may leaves AESNI and similar instructions disabled/unavailable (I’ve had that problem in the past). The flags are: “-maes -mpclmul -msse2 -mssse3 -msse4.2”.

Using gcc (gcc-mp-4.8 installed by MacPorts) creates library mismatch and fails to link “botan”. See attached (compressed).

-------------- next part --------------
A non-text attachment was scrubbed...
Name: botan-build.out.bz2
Type: application/x-bzip2
Size: 12568 bytes
Desc: not available
URL: <http://lists.randombit.net/pipermail/botan-devel/attachments/20140126/010e2cce/attachment-0001.bz2>
-------------- next part --------------


This seems to be the offending line:

g++  -m64 -pthread -L/opt/local/lib build/obj/app/asn1.o build/obj/app/base64.o build/obj/app/bcrypt.o build/obj/app/bzip.o build/obj/app/ca.o build/obj/app/cert_verify.o build/obj/app/dsa_sign.o build/obj/app/dsa_ver.o build/obj/app/factor.o build/obj/app/fpe.o build/obj/app/hash.o build/obj/app/keygen.o build/obj/app/main.o build/obj/app/ocsp.o build/obj/app/pkcs10.o build/obj/app/read_ssh.o build/obj/app/self_sig.o build/obj/app/tls_client.o build/obj/app/tls_server.o build/obj/app/tls_server_asio.o build/obj/app/x509print.o build/obj/app/speed_pk_bench.o build/obj/app/speed.o build/obj/app/speed_timer.o -L. -lbotan-1.11 -lboost_filesystem -lboost_system -lbz2 -lcrypto -lgmp -llzma -lz -o botan

This is what is should look like:

g++  -m64 -pthread build/obj/app/asn1.o build/obj/app/base64.o build/obj/app/bcrypt.o build/obj/app/bzip.o build/obj/app/ca.o build/obj/app/cert_verify.o build/obj/app/dsa_sign.o build/obj/app/dsa_ver.o build/obj/app/factor.o build/obj/app/fpe.o build/obj/app/hash.o build/obj/app/keygen.o build/obj/app/main.o build/obj/app/ocsp.o build/obj/app/pkcs10.o build/obj/app/read_ssh.o build/obj/app/self_sig.o build/obj/app/tls_client.o build/obj/app/tls_server.o build/obj/app/tls_server_asio.o build/obj/app/x509print.o build/obj/app/speed_pk_bench.o build/obj/app/speed.o build/obj/app/speed_timer.o -L. -lbotan-1.11 -L/opt/local/lib -lboost_filesystem -lboost_system -lbz2 -lcrypto -lgmp -llzma -lz -o botan

Similarly for botan-test. The reason is - prior versions of Botan are installed in /opt/local/lib, so it attempts to link to them instead, with predictable consequences.

Regardless, running “botan-test” produces:

$ g++  -m64 -pthread  build/obj/test/nist_x509.o build/obj/test/test_aead.o build/obj/test/test_bigint.o build/obj/test/test_block.o build/obj/test/test_cryptobox.o build/obj/test/test_cvc.o build/obj/test/test_dh.o build/obj/test/test_dlies.o build/obj/test/test_dsa.o build/obj/test/test_ecdsa.o build/obj/test/test_elg.o build/obj/test/test_gost_3410.o build/obj/test/test_hash.o build/obj/test/test_hkdf.o build/obj/test/test_kdf.o build/obj/test/test_keywrap.o build/obj/test/test_mac.o build/obj/test/test_modes.o build/obj/test/test_nr.o build/obj/test/test_ocb.o build/obj/test/test_passhash.o build/obj/test/test_pbkdf.o build/obj/test/test_pubkey.o build/obj/test/test_rng.o build/obj/test/test_rsa.o build/obj/test/test_rw.o build/obj/test/test_stream.o build/obj/test/test_transform.o build/obj/test/test_tss.o build/obj/test/tests.o build/obj/test/unit_ecc.o build/obj/test/unit_ecdh.o build/obj/test/unit_ecdsa.o build/obj/test/unit_tls.o build/obj/test/unit_x509.o -L. -lbotan-1.11 -L/opt/local/lib -lboost_filesystem -lboost_system -lbz2 -lcrypto -lgmp -llzma -lz -lboost_filesystem -o botan-test
$ ./botan-test
Segmentation fault: 11
$  gdb botan-test
…………….
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0xffffffffffffffe8
0x000000010004905f in boost::system::system_error::what ()
(gdb) backtrace
#0  0x000000010004905f in boost::system::system_error::what ()
#1  0x0000000100503fbe in boost::filesystem::filesystem_error::what ()
(gdb)


“botan” itself seems functional:

$ ./botan cpuid
CPUID flags: sse2 ssse3 sse41 sse42 avx2 rdtsc bmi2 clmul aes_ni rdrand
$ ./botan speed AES-128
AES-128 [aes_isa] 4784.17 [openssl] 4713.67 [simd] 335.21 [core] 185.30
$ ./botan speed AES-256
AES-256 [openssl] 3410.39 [aes_isa] 3194.10 [simd] 237.47 [core] 132.74
$

Using clang (clang-mp-3.4 from MacPorts) fails to compile:

clang++  -m64 -stdlib=libstdc++ -pthread -fPIC -fvisibility=hidden -D_REENTRANT -std=c++11 -O3 -Wextra -Wall -Ibuild/include -c src/lib/algo_factory/algo_factory.cpp -o build/obj/lib/algo_factory.o
clang++  -m64 -stdlib=libstdc++ -pthread -fPIC -fvisibility=hidden -D_REENTRANT -std=c++11 -O3 -Wextra -Wall -Ibuild/include -c src/lib/algo_factory/prov_weight.cpp -o build/obj/lib/algo_factory_prov_weight.o
In file included from src/lib/algo_factory/algo_factory.cpp:8:
In file included from build/include/botan/algo_factory.h:11:
build/include/botan/types.h:14:10: fatal error: 'cstdint' file not found
In file included from src/lib/algo_base/scan_name.cpp:8#include <cstdint>:

In file included from build/include/botan/scan_name.h         ^:
11:
build/include/botan/types.h:14:10: fatal error: 'cstdint' file not found
#include <cstdint>
         ^
In file included from src/lib/algo_base/symkey.cpp:8:
In file included from build/include/botan/symkey.h:11:
In file included from build/include/botan/secmem.h:11:
In file included from build/include/botan/mem_ops.h:11:
build/include/botan/types.h:14:10: fatal error: 'cstdint' file not found
#include <cstdint>
         ^
In file included from src/lib/algo_factory/prov_weight.cpp:8:
In file included from build/include/botan/internal/algo_cache.h:11:
build/include/botan/types.h:14:10: fatal error: 'cstdint' file not found
#include <cstdint>
         ^
1 error generated.
make: *** [build/obj/lib/algo_factory_prov_weight.o] Error 1
make: *** Waiting for unfinished jobs....
1 error generated.
make: *** [build/obj/lib/algo_base_scan_name.o] Error 1
1 error generated.
make: *** [build/obj/lib/algo_base_symkey.o] Error 1
1 error generated.
make: *** [build/obj/lib/algo_factory.o] Error 1



On Jan 23, 2014, at 13:37 , Jack Lloyd <lloyd at randombit.net> wrote:

> On Fri, Jan 17, 2014 at 01:16:43PM -0500, Uri Blumenthal wrote:
>> The short comment is: it does not work.
>> 
>> The longer story: significant mucking was required to get 1.11.7 to compile properly (actually I’m not so sure it did).
>> 
>> Include directories and library dirs are not picked up properly by configurator. Situation is exacerbated by the fact that I am compiling with “—prefix=/opt/local”, and that’s where both Boost and Python live. Confuses the hell out of Botan.
> 
> Can you provide your exact inputs and the results you are getting? I'm
> not aware of any setup (that would have worked before) that isn't
> working with the current build.
> 
>> One of the more annoying quirks is that after “make clean” it
>> removes “build/obj” subdir, but does not re-create its hierarchy
>> when “make” is invoked.
> 
> Now fixed, thanks.
> 
>> The result is this:
>> 
>> $ ./botan speed
>> Help!
>> $
> 
> There is no built in list of things to try at the moment, but you can
> use a name printed by botan-test like AES-128.
> 
> Jack
> _______________________________________________
> 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