Back to academic signature homepage
Troubleshooting compiling Academic
Signature in (x/l/k) ubuntu17.10
A workaround is
already in place in the current source code packages since nov
8, 2017.
This page is about a flaw that apparently occurred in close
coincidence with the rollout of ubuntu Artful Aardvark.
It only occurs in the 64 bit version of the compiler g++, the
32bit version is not affected.
As of November 2017 g++ (Ubuntu
7.2.0-8ubuntu3) 7.2.0 (64 bit version only)
will produce faulty object files, if optimization -O2
or -O3 are turned on.
And it does so in Academic Signature's module helpersxx.cpp,
affects the function "bool dbytadd_ay" used in some
pseudorandom functions and would reproducably alter the outcome of pseudo random
functions used in ciphers "flightx", "chimera" and in a key
derivation function.
(No, this is not about ambiguous, poorly
defined code or illegal type punning. It is about a plain and simple pointer access with calculated offset.)
I can fix the flaw by either introducing an additional dummy function parameter to convince g++ that it cannot
assume it would know
the memory content of a particular byte (that might have been altered in the mean time)
and optimizes a second access away or else I can just put in
a g++ compiler pragma blocking optimization in that function. Since the first solution would marginally slow down
execution I pick the latter solution. Those users who have the alternative compiler clang on their Linux (or Mingw on a Windows) may just use clang,
which optimizes flawlessly for all optimization levels as far as I can see.
I have noted a very rude conversation about an alleged compiler flaw between a developer and the innocent user trying to
report the bug. Thus I figured they don't want user interaction, refrained from contacting them about the bug and possibly spared me a shitstorm...