Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Clang 5.0/6.0, CHAM-64/ECB and failed self test at -O1 #677
We are experiencing a failed self test using Clang 5.0/6.0 for CHAM-64/ECB at -O1 on Intel platforms. The Intel platforms engage SSSE3 instructions. Clang at other optimization levels is OK. Other compilers are OK.
Here is how to reproduce with the library. We have not been able to reduce it to a Minimal, Complete, and Verifiable example for Clang. We attempted to clear it two times with no joy. First, Commit 1be58db82868, which avoids some casts that are typically present in SSE code. Second, Commit 810f5c185991, which avoids casting among types.
In the output below, notice the "incorrectly decrypted". That means the encryptor worked fine because encryption is the first test performed on the data. The problem is in the decryptor.
Reducing the rounds/iteration from 8 to 4 cost us about 0.9 cpb. In the big picture 8 rounds performed at around 13.9 and 4 rounds performs at about 14.8 cpb. I don't like to give cycles back but I'm not sure what else we can do.