Hi Markku,
Thank you for this report.
We are fixing two bugs, one in the field element comparison in
the compression code, and another one when casting the final
result in the constant-time comparison used during decapsulation.
We are also adding tests to make sure we catch changes in the
ciphertext (i.e., to make sure the CCA mechanism works). All these
changes are now available in the SIDH library:
https://github.com/microsoft/PQCrypto-SIDH/
My colleague noticed that there's a patch for it in Microsoft code base for it from last night; r is still 8 bit and the bug is not fixed: https://github.com/microsoft/PQCrypto-SIDH/commit/23cb2260a0196e4921cd2586be16df7e9163ff0b
One of the consequences of doing development is the open is that
everyone can see what we're doing. Notwithstanding this openness,
we will be sure to announce changes on this list.
Above flaw is not a timing attack. It should be noted that memcmp() is used throughout in the compressed implementations; "dlog.c", "ec_isogeny.c", "sidh_compressed.c", "torsion_basis.c". So these compressed implementations are not constant time (the specification seems to suggest that the optimized implementations would be).
The SIKE spec specifically addresses this issue already, in
Section 1.5, on page 19: "Note that, since all of the operations
in both algorithms are performed on public data, side-channel
countermeasures (e.g., constant-time routines) are irrelevant
except for the last step of the decompression algorithm in which
we compute the last kernel generator using Ladder3pt (Algorithm
8)."
I believe that when someone claims that the implementation of an algorithm is constant-time, it implicitly means that the private data processing is constant-time, which is where it is really required. We are not claiming that every function is constant time everywhere, even when it is not needed. In case our meaning was ambiguous, this paragraph hereby clarifies our intended meaning.
-David