<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:Courier;
panose-1:0 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:"Andale Mono";
panose-1:2 11 5 9 0 0 0 0 0 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
p.p1, li.p1, div.p1
{mso-style-name:p1;
margin:0in;
background:black;
font-size:10.5pt;
font-family:"Andale Mono";
color:#2FFF12;}
span.s1
{mso-style-name:s1;}
span.apple-converted-space
{mso-style-name:apple-converted-space;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style></head><body lang=EN-US link=blue vlink=purple style='word-wrap:break-word'><div class=WordSection1><div><p class=MsoNormal style='margin-left:.5in'>I tried to reproduce it on goldbolt with clang 12.0.0 and 12.0.1 but things seem fine when I run it there: <a href="https://godbolt.org/z/vrq8j6Kj7">https://godbolt.org/z/vrq8j6Kj7</a>.<br>Can you share your exact clang invocation? Does it only reproduce in some specific environment?<o:p></o:p></p><p class=MsoNormal><span style='font-size:12.0pt'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt;color:#0070C0'>Save the source I posted before into “sha3-reproducer.cxx” file. Let me know if you want it re-posted here.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt;color:#0070C0'><o:p> </o:p></span></p><p class=p1><span class=s1>$ clang++-mp-12 -v</span><o:p></o:p></p><p class=p1><span class=s1>clang version 12.0.1</span><o:p></o:p></p><p class=p1><span class=s1>Target: x86_64-apple-darwin20.6.0</span><o:p></o:p></p><p class=p1><span class=s1>Thread model: posix</span><o:p></o:p></p><p class=p1><span class=s1>InstalledDir: /opt/local/libexec/llvm-12/bin</span><o:p></o:p></p><p class=p1><span class=s1>$ clang++-mp-12 -o s -O3 sha3-reproducer.cxx</span><o:p></o:p></p><p class=p1><span class=s1>$ ./s</span><o:p></o:p></p><p class=p1><span class=s1>Assertion failed: (T[0] == 16394434931424703552u), function main, file sha3-reproducer.cxx, line 103.</span><o:p></o:p></p><p class=p1><span class=s1>Abort trap: 6</span><o:p></o:p></p><p class=p1><span class=s1>$ clang++-mp-12 -o s -O2 sha3-reproducer.cxx</span><o:p></o:p></p><p class=p1><span class=s1>$ ./s</span><o:p></o:p></p><p class=p1><span class=s1>Assertion failed: (T[0] == 16394434931424703552u), function main, file sha3-reproducer.cxx, line 103.</span><o:p></o:p></p><p class=p1><span class=s1>Abort trap: 6</span><o:p></o:p></p><p class=p1><span class=s1>$ clang++-mp-12 -o s -O1 sha3-reproducer.cxx</span><o:p></o:p></p><p class=p1><span class=s1>$ ./s</span><o:p></o:p></p><p class=p1><span class=s1>$</span><span class=apple-converted-space> </span><o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'><span style='font-size:12.0pt;color:#0070C0'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt;color:#0070C0'>Clang-12 is installed via Macports, which is why we invoke the executable as clang++-mp-12.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt;color:#0070C0'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt;color:#0070C0'>The same problem manifests in exactly the same way in the Xcode-13 version of Clang (presumably based on LLVM Clang-12). <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt;color:#0070C0'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt;color:#0070C0'>I’ll be happy to provide more of specific details, if you let me know what you need.<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><br><br>Also, it generally helps to reduce code bug reports as much as possible; creduce can help with that: <a href="https://embed.cs.utah.edu/creduce/using/">https://embed.cs.utah.edu/creduce/using/</a>.<o:p></o:p></p><p class=MsoNormal><span style='font-size:12.0pt'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt;color:#0070C0'>Understood. Unfortunately, the above reproducer is the best we could come up with. An alternative is trying to build the Botan package itself <a href="https://github.com/randombit/botan.git">https://github.com/randombit/botan.git</a>.<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><br><br><br><o:p></o:p></p></div><p class=MsoNormal style='margin-left:.5in'><o:p> </o:p></p><div><div><p class=MsoNormal style='margin-left:.5in'>On Thu, Sep 23, 2021 at 10:14 PM Blumenthal, Uri - 0553 - MITLL via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<o:p></o:p></p></div><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in'><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt'>I’m not sure if this is the correct list, so please direct me to the right one if this bug report shouldn’t go here.</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt'>The problem is: invoking clang (v12) with -O2 or better optimization flags generates wrong object code for the following C++. Compiling it with -O1 generates working binary.</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt'>=================</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'>#include <cstdint></span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'>#include <cassert></span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'>template<size_t ROT, typename T></span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'>inline constexpr T rotl(T input)</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> {</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> static_assert(ROT > 0 && ROT < 8*sizeof(T), "Invalid rotation constant");</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> return static_cast<T>((input << ROT) | (input >> (8*sizeof(T) - ROT)));</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> }</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'>inline void SHA3_round(uint64_t T[25], const uint64_t A[25], uint64_t RC)</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> {</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> const uint64_t C0 = A[0] ^ A[5] ^ A[10] ^ A[15] ^ A[20];</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> const uint64_t C1 = A[1] ^ A[6] ^ A[11] ^ A[16] ^ A[21];</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> // the calculation of C2 fails for -O3 or -O2 with clang 12</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> // FWIW: it would produce a value that doesn't fit into a _signed_ 64-bit int</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> const uint64_t C2 = A[2] ^ A[7] ^ A[12] ^ A[17] ^ A[22];</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> const uint64_t C3 = A[3] ^ A[8] ^ A[13] ^ A[18] ^ A[23];</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> const uint64_t C4 = A[4] ^ A[9] ^ A[14] ^ A[19] ^ A[24];</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> const uint64_t D0 = rotl<1>(C0) ^ C3;</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> const uint64_t D1 = rotl<1>(C1) ^ C4;</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> const uint64_t D2 = rotl<1>(C2) ^ C0;</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> const uint64_t D3 = rotl<1>(C3) ^ C1;</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> const uint64_t D4 = rotl<1>(C4) ^ C2;</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> const uint64_t B00 = A[ 0] ^ D1;</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> const uint64_t B01 = rotl<44>(A[ 6] ^ D2);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> const uint64_t B02 = rotl<43>(A[12] ^ D3);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> const uint64_t B03 = rotl<21>(A[18] ^ D4);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> const uint64_t B04 = rotl<14>(A[24] ^ D0);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> T[ 0] = B00 ^ (~B01 & B02) ^ RC;</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> T[ 1] = B01 ^ (~B02 & B03);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> T[ 2] = B02 ^ (~B03 & B04);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> T[ 3] = B03 ^ (~B04 & B00);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> T[ 4] = B04 ^ (~B00 & B01);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> const uint64_t B05 = rotl<28>(A[ 3] ^ D4);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> const uint64_t B06 = rotl<20>(A[ 9] ^ D0);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> const uint64_t B07 = rotl< 3>(A[10] ^ D1);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> const uint64_t B08 = rotl<45>(A[16] ^ D2);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> const uint64_t B09 = rotl<61>(A[22] ^ D3);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> T[ 5] = B05 ^ (~B06 & B07);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> T[ 6] = B06 ^ (~B07 & B08);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> T[ 7] = B07 ^ (~B08 & B09);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> T[ 8] = B08 ^ (~B09 & B05);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> T[ 9] = B09 ^ (~B05 & B06);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> // --- instructions starting from here can be removed</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> // and the -O3 dicrepancy is still triggered</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> const uint64_t B10 = rotl< 1>(A[ 1] ^ D2);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> const uint64_t B11 = rotl< 6>(A[ 7] ^ D3);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> const uint64_t B12 = rotl<25>(A[13] ^ D4);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> const uint64_t B13 = rotl< 8>(A[19] ^ D0);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> const uint64_t B14 = rotl<18>(A[20] ^ D1);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> T[10] = B10 ^ (~B11 & B12);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> T[11] = B11 ^ (~B12 & B13);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> T[12] = B12 ^ (~B13 & B14);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> T[13] = B13 ^ (~B14 & B10);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> T[14] = B14 ^ (~B10 & B11);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> const uint64_t B15 = rotl<27>(A[ 4] ^ D0);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> const uint64_t B16 = rotl<36>(A[ 5] ^ D1);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> const uint64_t B17 = rotl<10>(A[11] ^ D2);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> const uint64_t B18 = rotl<15>(A[17] ^ D3);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> const uint64_t B19 = rotl<56>(A[23] ^ D4);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> T[15] = B15 ^ (~B16 & B17);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> T[16] = B16 ^ (~B17 & B18);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> T[17] = B17 ^ (~B18 & B19);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> T[18] = B18 ^ (~B19 & B15);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> T[19] = B19 ^ (~B15 & B16);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> const uint64_t B20 = rotl<62>(A[ 2] ^ D3);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> const uint64_t B21 = rotl<55>(A[ 8] ^ D4);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> const uint64_t B22 = rotl<39>(A[14] ^ D0);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> const uint64_t B23 = rotl<41>(A[15] ^ D1);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> const uint64_t B24 = rotl< 2>(A[21] ^ D2);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> T[20] = B20 ^ (~B21 & B22);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> T[21] = B21 ^ (~B22 & B23);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> T[22] = B22 ^ (~B23 & B24);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> T[23] = B23 ^ (~B24 & B20);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> T[24] = B24 ^ (~B20 & B21);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> }</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'>int main()</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'>{</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> uint64_t T[25];</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> uint64_t A[25] = {</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> 15515230172486u, 9751542238472685244u, 220181482233372672u,</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> 2303197730119u, 9537012007446913720u, 0u, 14782389640143539577u,</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> 2305843009213693952u, 1056340403235818873u, 16396894922196123648u,</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> 13438274300558u, 3440198220943040u, 0u, 3435902021559310u, 64u,</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> 14313837075027532897u, 32768u, 6880396441885696u, 14320469711924527201u,</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> 0u, 9814829303127743595u, 18014398509481984u, 14444556046857390455u,</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> 4611686018427387904u, 18041275058083100u };</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> SHA3_round(T, A, 0x0000000000008082);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> assert(T[0] == 16394434931424703552u);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> assert(T[1] == 10202638136074191489u);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> assert(T[2] == 6432602484395933614u);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> assert(T[3] == 10616058301262943899u);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> assert(T[4] == 14391824303596635982u);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> assert(T[5] == 5673590995284149638u);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> assert(T[6] == 15681872423764765508u);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> assert(T[7] == 11470206704342013341u);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> assert(T[8] == 8508807405493883168u);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> assert(T[9] == 9461805213344568570u);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> assert(T[10] == 8792313850970105187u);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> assert(T[11] == 13508586629627657374u);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> assert(T[12] == 5157283382205130943u);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> assert(T[13] == 375019647457809685u);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> assert(T[14] == 9294608398083155963u);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> assert(T[15] == 16923121173371064314u);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> assert(T[16] == 4737739424553008030u);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> assert(T[17] == 5823987023293412593u);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> assert(T[18] == 13908063749137376267u);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> assert(T[19] == 13781177305593198238u);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> assert(T[20] == 9673833001659673401u);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> assert(T[21] == 17282395057630454440u);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> assert(T[22] == 12906624984756985556u);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> assert(T[23] == 3081478361927354234u);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> assert(T[24] == 93297594635310132u);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'> return 0;</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt;font-family:Courier'>}</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt'>=================</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:12.0pt'>Your help debugging and fixing this problem is appreciated!</span><o:p></o:p></p><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='color:black'>--</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:10.0pt;font-family:"Andale Mono";color:black'>Regards,</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:10.0pt;font-family:"Andale Mono";color:black'>Uri Blumenthal Voice: (781) 981-1638 </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:10.0pt;font-family:"Andale Mono";color:black'>Secure Resilient Systems and Technologies Cell: (339) 223-5363</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:10.0pt;font-family:"Andale Mono";color:black'>MIT Lincoln Laboratory </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:10.0pt;font-family:"Andale Mono";color:black'>244 <a href="https://www.google.com/maps/search/Wood+Street,+Lexington,+MA+02420-9108?entry=gmail&source=g">Wood Street, Lexington, MA</a> <a href="https://www.google.com/maps/search/Wood+Street,+Lexington,+MA+02420-9108?entry=gmail&source=g">02420-9108</a> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:10.0pt;font-family:"Andale Mono";color:black'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:10.0pt;font-family:"Andale Mono";color:black'>Web: <a href="https://www.ll.mit.edu/biographies/uri-blumenthal" target="_blank" title="https://www.ll.mit.edu/biographies/uri-blumenthal"><span style='color:#713C56'>https://www.ll.mit.edu/biographies/uri-blumenthal</span></a></span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:10.0pt;font-family:"Andale Mono";color:black'>Root CA: <a href="https://www.ll.mit.edu/llrca2.pem" target="_blank" title="https://www.ll.mit.edu/llrca2.pem"><span style='color:#713C56'>https://www.ll.mit.edu/llrca2.pem</span></a></span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='color:black'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><i><span style='color:black'>There are two ways to design a system. One is to make is so simple there are obviously no deficiencies.</span></i><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><i><span style='color:black'>The other is to make it so complex there are no obvious deficiencies.</span></i><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><i><span style='color:black'> - C. A. R. Hoare</span></i><o:p></o:p></p></div></div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'> <o:p></o:p></p></div></div><p class=MsoNormal style='margin-left:.5in'>_______________________________________________<br>LLVM Developers mailing list<br><a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br><a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><o:p></o:p></p></blockquote></div><p class=MsoNormal style='margin-left:.5in'><br clear=all><o:p></o:p></p><div><p class=MsoNormal style='margin-left:.5in'><o:p> </o:p></p></div><p class=MsoNormal style='margin-left:.5in'>-- <o:p></o:p></p><div><div><p class=MsoNormal style='margin-left:.5in'>Jakub Kuderski<o:p></o:p></p></div></div></div></body></html>