Botan News

1.9.3: Adding AES-NI and format preserving encryption

Botan 1.9.3 was released this evening.

A new engine, aes_isa_eng, adds hooks for CPU-specific implementations of AES. Currently supported is an implementation for Intel's AES-NI; while no currently shipping CPU has support for AES-NI yet, the code was tested using Intel's SDE. The engine may be extended in the future to support VIA's PadLock instructions or other similar extensions.

An implementation of format-preserving encryption (FPE) was added. FPE allows for encrypting data in such a way that format constraints are retained. An example which uses this to encrypt credit card numbers with valid Luhn checksums to other credit card numbers with valid checksums is available.

An interface change in how X.509 certificates and PKCS #10 certificate requests are created now allows for using arbitrary hash functions; previously the use of SHA-1 was hardcoded, which is particularly undesirable given the currently known attacks on that algorithm.

The implementations of MARS, Skipjack, and AES were optimized to varying degrees.

The previous release added support for AltiVec but it was not enabled unless a macro was set by hand. Now it is set by default if the build is configured for a G4, G5, POWER6 or POWER7 processor (all of which include AltiVec in all known configurations). A similar mechanism sets macros indicating support for SSE2 and SSSE3 (though SSSE3 is not currently used in the codebase), and for AES-NI. Support for a particular ISA extension can also be enabled at build time by using the new --with-isa-extension option to configure.py.

The default build for Windows is now a DLL, mostly due to the much smaller size of the resulting binary. This is particularly important because this release also adds support for packaging botan using the InnoSetup Windows installer program. This should definitely be considered experimental, but seems to work. You can download an installer for 1.9.3 right now. Comments on the quality of the Windows installer or ways it could be improved would be heartily welcomed.

Posted 2009/11/19 in releases; 5 comments

< Botan 1.8.8 and 1.9.2 | 1.9.4 adds SSL/TLS, GOST 34.10, XSalsa20, fault countermeasures, SIMD optimizations >

Posted by Robert at Thu Dec 3 14:44:34 2009
I'm trying the experimental setup you put together with VC 2008 Express. When I try to compile it finds the includes correctly, but the linking fails with a strange "6 unresolved externals" for the LibraryInitializer. I've double-checked my library path.

Since I'm presently waiting for approval on the mailing list, what do you suggest that I do?
Posted by Dipish at Mon Jan 18 06:03:06 2010
Please provide compiled with mingw binaries! i am having trouble compiling Botan with MinGW on Windows XP!

G:\Src\Botan-1.9.3>python configure.py -cc=gcc
Usage: configure.py [options]

configure.py: error: no such option: -c

G:\Src\Botan-1.9.3>python configure.py --cc=gcc
  INFO: Guessing target processor is a ia32/i686
  INFO: Target is gcc-windows-ia32-i686
  INFO: Setting -fpermissive to work around gcc bug
  INFO: Skipping mod because CPU incompatible - aes_intel asm_amd64 monty_amd64
mp_amd64 mp_asm64 mulop_amd64 sha1_amd64 sha1_sse2
  INFO: Skipping mod because OS incompatible - alloc_mmap beos_stats dev_random
egd fd_unix gettimeofday md4_ia32 md5_ia32 mulop_ia32 posix_rt proc_walk pthrea
ds serpent_ia32 sha1_ia32 unix_procs
  INFO: Skipping mod because compiler incompatible - mp_ia32_msvc
  INFO: Skipping mod because loaded on request only - bzip2 gnump openssl qt_mu
tex zlib
  INFO: Skipping mod because loaded only if needed by dependency - aes_isa_eng
amd64_eng asm_ia32 ia32_eng mp_generic
  INFO: Assuming unaligned memory access works
  INFO: Botan 1.9.3 build setup is complete

G:\Src\Botan-1.9.3>mingw32-make
g++ -Ibuild\include -O3 -finline-functions -march=i686 -momit-leaf-frame-pointer
-D_REENTRANT -ansi -Wno-long-long -fpermissive -W -Wall -fPIC -c src\algo_facto
ry\algo_factory.cpp -o build\lib\algo_factory.obj
src\algo_factory\algo_factory.cpp:1: warning: -fPIC ignored for target (all code
is position independent)
In file included from build/include/botan/curve_gfp.h:13,
  from build/include/botan/point_gfp.h:13,
  from build/include/botan/ec_dompar.h:13,
  from build/include/botan/ecdsa_op.h:12,
  from build/include/botan/engine.h:43,
  from src\algo_factory\algo_factory.cpp:11:
build/include/botan/gfp_element.h:17:24: tr1/memory: No such file or directory
In file included from build/include/botan/curve_gfp.h:13,
  from build/include/botan/point_gfp.h:13,
  from build/include/botan/ec_dompar.h:13,
  from build/include/botan/ecdsa_op.h:12,
  from build/include/botan/engine.h:43,
  from src\algo_factory\algo_factory.cpp:11:
build/include/botan/gfp_element.h:62: error: `std::tr1' has not been declared
build/include/botan/gfp_element.h:62: error: expected `)' before '<' token
build/include/botan/gfp_element.h:173: error: `std::tr1' has not been declared
build/include/botan/gfp_element.h:173: warning: ISO C++ forbids declaration of `
shared_ptr' with no type
build/include/botan/gfp_element.h:173: error: `shared_ptr' declared as an `inlin
e' field
build/include/botan/gfp_element.h:173: error: expected `;' before '<' token
build/include/botan/gfp_element.h:186: error: expected `;' before "void"
build/include/botan/gfp_element.h:186: error: `std::tr1' has not been declared
build/include/botan/gfp_element.h:186: error: `shared_ptr' has not been declared

build/include/botan/gfp_element.h:186: error: expected `,' or `...' before '<' t
oken
build/include/botan/gfp_element.h:186: warning: ISO C++ forbids declaration of `
parameter' with no type
build/include/botan/gfp_element.h:248: error: `std::tr1' has not been declared
build/include/botan/gfp_element.h:248: warning: ISO C++ forbids declaration of `
shared_ptr' with no type
build/include/botan/gfp_element.h:248: error: expected `;' before '<' token
In file included from build/include/botan/point_gfp.h:13,
  from build/include/botan/ec_dompar.h:13,
  from build/include/botan/ecdsa_op.h:12,
  from build/include/botan/engine.h:43,
  from src\algo_factory\algo_factory.cpp:11:
build/include/botan/curve_gfp.h:55: error: `std::tr1' has not been declared
build/include/botan/curve_gfp.h:55: error: expected `,' or `...' before '<' toke
n
build/include/botan/curve_gfp.h:55: warning: ISO C++ forbids declaration of `sha
red_ptr' with no type
build/include/botan/curve_gfp.h:97: error: `std::tr1' has not been declared
build/include/botan/curve_gfp.h:97: warning: ISO C++ forbids declaration of `sha
red_ptr' with no type
build/include/botan/curve_gfp.h:97: error: expected `;' before '<' token
build/include/botan/curve_gfp.h:118: error: `std::tr1' has not been declared
build/include/botan/curve_gfp.h:118: warning: ISO C++ forbids declaration of `sh
ared_ptr' with no type
build/include/botan/curve_gfp.h:118: error: `shared_ptr' declared as an `inline'
field
build/include/botan/curve_gfp.h:118: error: expected `;' before '<' token
build/include/botan/curve_gfp.h:127: error: expected `;' before "void"
build/include/botan/curve_gfp.h:130: error: `std::tr1' has not been declared
build/include/botan/curve_gfp.h:130: warning: ISO C++ forbids declaration of `sh
ared_ptr' with no type
build/include/botan/curve_gfp.h:130: error: expected `;' before '<' token
build/include/botan/curve_gfp.h:133: error: `std::tr1' has not been declared
build/include/botan/curve_gfp.h:133: warning: ISO C++ forbids declaration of `sh
ared_ptr' with no type
build/include/botan/curve_gfp.h:133: error: expected `;' before '<' token
build/include/botan/curve_gfp.h:134: error: `std::tr1' has not been declared
build/include/botan/curve_gfp.h:134: warning: ISO C++ forbids declaration of `sh
ared_ptr' with no type
build/include/botan/curve_gfp.h:134: error: expected `;' before '<' token
build/include/botan/curve_gfp.h:135: error: `std::tr1' has not been declared
build/include/botan/curve_gfp.h:135: warning: ISO C++ forbids declaration of `sh
ared_ptr' with no type
build/include/botan/curve_gfp.h:135: error: expected `;' before '<' token
In file included from build/include/botan/ec_dompar.h:13,
  from build/include/botan/ecdsa_op.h:12,
  from build/include/botan/engine.h:43,
  from src\algo_factory\algo_factory.cpp:11:
build/include/botan/point_gfp.h:235: error: `std::tr1' has not been declared
build/include/botan/point_gfp.h:235: error: `shared_ptr' has not been declared
build/include/botan/point_gfp.h:235: error: expected `,' or `...' before '<' tok
en
build/include/botan/point_gfp.h:235: warning: ISO C++ forbids declaration of `pa
rameter' with no type
build/include/botan/point_gfp.h:243: error: `std::tr1' has not been declared
build/include/botan/point_gfp.h:243: warning: ISO C++ forbids declaration of `sh
ared_ptr' with no type
build/include/botan/point_gfp.h:243: error: `shared_ptr' declared as an `inline'
field
build/include/botan/point_gfp.h:243: error: expected `;' before '<' token
build/include/botan/point_gfp.h:258: error: `std::tr1' has not been declared
build/include/botan/point_gfp.h:258: warning: ISO C++ forbids declaration of `sh
ared_ptr' with no type
build/include/botan/point_gfp.h:258: error: expected `;' before '<' token
mingw32-make: *** [build\lib\algo_factory.obj] Error 1
Posted by Jack Lloyd at Mon Jan 18 10:45:58 2010
Dipish,

The GCC included with MinGW is quite ancient, I believe, and does not include TR1. You'll want to pass --with-tr1=none to configure.py to get a build.
Posted by Goldenscale at Sat Feb 27 07:56:57 2010
How can I Change the default build for Windows to static lib?
Posted by Jack Lloyd at Wed Mar 3 15:31:08 2010
Goldenscale,

Normally that is handled with --disable-shared, which will cause VC to generate only a static import lib. However this behavior is broken in 1.9.3.

Name:


E-mail:


URL:


Comment: