We are using Crypto++ 5.6.3 and compiling with g++ on CentOS 6. Is it possible to determine at runtime if our application has linked with a libcryptopp that was built with CRYPTOPP_BOOL_AESNI_INTRINSICS_AVAILABLE
as 1
or 0
?
Thank you
Is it possible to determine at runtime if our application has linked with a libcryptopp that was built with CRYPTOPP_BOOL_AESNI_INTRINSICS_AVAILABLE as 1 or 0?
No, its not. As a matter of fact, you won't even be able to tell if you are using AES-NI or the software implementation.
There's been some talk about stashing CXXFLAGS
away for future use like this (and printing them from the cryptest.exe
program), but its very low priority. So low there's been no bug report on it to stage the work.
EDIT: now open on the Crypto++ mailing list: GNUmakefile and 'make flag' recipe.
The Crypto++ test suite prints a value for the macro. It comes from validat1.cpp, around line 310:
cout << "AESNI_INTRINSICS == " << CRYPTOPP_BOOL_AESNI_INTRINSICS_AVAILABLE << endl;
But as I think you are aware, the library build settings and your build settings could be different.
It also noteworthy that Crypto++ uses a makefile, while distros often build using Autotools. The distros select their own flags, and they may be different from the Crypto++ makefile. When using the distro, you may be able to check a *.pc
file or similar.
Related, we test on CentOS 5 through CentOS 7. CentOS 5 is a nice machine because its got GCC 4.1, and that version of GCC kind of particular about some things. For example, it cannot consume -march=native
.