kkAyataka / plusaes

Header only C++ AES cipher library
https://kkayataka.github.io/plusaes/doc/index.html
Boost Software License 1.0
188 stars 41 forks source link

Add workaround for clang optimization in 32-bit build via Visual Studio producing incorrect results #44

Closed Sainan closed 9 months ago

Sainan commented 1 year ago

A pragmatic fix for https://github.com/kkAyataka/plusaes/issues/43, simply disabling optimizations if the bad conditions are detected. I'm making this PR because I figure it will be a while until the issue in LLVM is fixed & that fix is deployed, but I don't know this for sure.

Also, I had to move the implementation out because #pragma optimize only works at file scope.

kkAyataka commented 9 months ago

I have confirmed this.