ph4r05 / Whitebox-crypto-AES

Whitebox AES implementation in C++. Chow, Karroumi.
https://is.muni.cz/th/325219/fi_m/
337 stars 112 forks source link

Optimization flag lost in migration to CMake #9

Closed doegox closed 8 years ago

doegox commented 8 years ago

Before transition to CMake, the binary was compiled with "-O2".

Please consider re-enabling it in CMakeLists.txt:

-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -std=c++0x")

(BTW I'm using your implementation to try out other attacks, thanks for having shared your code! cf https://github.com/SideChannelMarvels/Deadpool/wiki/Tutorial-%234%3A-DCA-against-Karroumi-2010-challenge for a DPA-like attack, DFA attack will come soon too ;) )

ph4r05 commented 8 years ago

Thanks for trying my repo! It great to see it is of any use for somebody.

Regarding building with optimization flag I would rather leave CMakeLists.txt as it is because CMake handles this for us by choosing the build type.

To build in release mode (-O3 is added):

mkdir Release
cd Release
cmake -DCMAKE_BUILD_TYPE=Release ..
make

To build in debug mode:

mkdir Debug
cd Debug
cmake -DCMAKE_BUILD_TYPE=Debug ..
make

I've added build-debug.sh and build-release.sh scripts. To check the compiler flags you can use ccmake . (console user interface for cmake), pressing t key to show advanced options.

doegox commented 8 years ago

Thanks for the build scripts! I didn't know cmake capabilities