-r--r--r-- 6441 libmceliece-20230612/doc/html/verification.html raw
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type="text/css">
html{overflow-y:scroll}
body{font-family:sans-serif}
p,ul,ol,blockquote,pre{font-size:1.0em;line-height:1.6em}
li p{font-size:1.0em}
blockquote p{font-size:1.0em}
tt{font-size:1.3em}
code{font-size:1.3em}
h1{font-size:1.5em}
h2{font-size:1.3em}
h3{font-size:1.0em}
h1 a{text-decoration:none}
table{border-collapse:collapse}
th,td{border:1px solid black}
table a{text-decoration:none}
table tr{font-size:1.0em;line-height:1.6em}
.links a:hover{text-decoration:underline}
.links a:active{text-decoration:underline}
.links img{width:200px;padding-left:1em}
.links td{border:0px;padding-top:0.5em;padding-bottom:0.5em}
.headline{padding:0;font-weight:bold;font-size:1.5em;vertical-align:top;padding-bottom:0.5em;color:#196069}
.navt{display:inline-block;box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;
min-width:14%;margin:0;padding:0;padding-left:0.5em;padding-right:0.5em;vertical-align:center;
font-weight:bold;font-size:1.1em;text-align:center;border:1px solid black}
.here{border-bottom:0px;background-color:#ffffff}
.away{background-color:#196069;}
.away a{text-decoration:none;display:block;color:#ffffff}
.away a:hover,.away a:active{text-decoration:underline}
.main{margin:0;padding-top:0em;padding-bottom:1%;clear:both}
</style>
<title>
libmceliece: Verification</title>
</head>
<body>
<div class=headline>
libmceliece</div>
<div class=nav>
<div class="navt away"><a href=index.html>Intro</a>
</div><div class="navt away"><a href=download.html>Download</a>
</div><div class="navt away"><a href=install.html>Install</a>
</div><div class="navt away"><a href=api.html>API</a>
</div><div class="navt away"><a href=cli.html>CLI</a>
</div><div class="navt away"><a href=security.html>Security</a>
</div><div class="navt here">Verification
</div><div class="navt away"><a href=internals.html>Internals</a>
</div><div class="navt away"><a href=people.html>People</a>
</div><div class="navt away"><a href=license.html>License</a>
</div></div>
<div class=main>
<p>libmceliece is intended to become a central target for verification of
full functional correctness of implementations of Classic McEliece. This
file tracks what has been verified so far and what has not.</p>
<p>The <a href="https://classic.mceliece.org/spec.html">Classic McEliece specification</a>
is in English and is not currently computer-comprehensible. However,
there is a <a href="https://classic.mceliece.org/spec.html">Sage package</a> that
has been manually checked line by line against the specification. Full
functional correctness of software X means that X computes the same
output as the Sage package for all possible inputs.</p>
<p>Changes in C compilers and in assemblers often change the behavior of
software and might introduce bugs where no bugs existed before. Some
tools address this by verifying correctness at the machine-language
level. It is important to re-run these tools whenever new binaries are
produced.</p>
<p>Changes in CPUs can also introduce bugs where no bugs existed before.
Verification is always relative to a model of CPU behavior, and physical
CPUs often deviate from these models, sometimes in problematic ways.</p>
<p>There is also a risk that current or future versions of Sage do not
correctly compute the documented Sage functions used by the Sage package.
This can interfere with falsifiability: even if the CPU matches the
model, a bug in a Classic McEliece implementation could be hidden by a
bug in Sage.</p>
<p>The <code>supercop-20221025/crypto_kem/mceliece*</code> checksums match the
checksums produced by libmceliece and checksums produced by the Sage
package. These checksums are hashes of outputs for various pseudorandomly
generated inputs (with randomness treated as another input). However,
there could be bugs for other inputs.</p>
<p>Separate tests on the official software have specifically checked bad
public-key padding and bad ciphertext padding (not just the specified
return value rejecting these inputs, but also the documented handling of
output buffers). The SUPERCOP checksum inputs also include bad
ciphertext padding and invalid ciphertexts. However, there could be
other types of inputs triggering bugs.</p>
<p>Various runs under <code>valgrind</code> and <code>asan</code> have not detected any abnormal
use of RAM. However, <code>valgrind</code> will not notice overflows from a C
variable into an adjacent C variable; <code>asan</code> will not notice overflows
in assembly language; and neither tool addresses the risk of bugs for
rare inputs.</p>
<p><a href="https://cr.yp.to/papers.html#goppadecoding">https://cr.yp.to/papers.html#goppadecoding</a>
presents detailed proofs of the correctness of a basic decoding
algorithm for classical binary Goppa codes. However, these proofs have
not yet been computer-verified. Furthermore, the decoding algorithm used
in the official Classic McEliece software includes many speedups beyond
the basic decoding algorithm.</p>
<p><a href="https://cr.yp.to/papers.html#controlbits">https://cr.yp.to/papers.html#controlbits</a>
presents computer-verified HOL Light proofs for the main formulas used
to compute control bits. However, there could be a mismatch between the
software and these formulas.</p>
<p><a href="https://github.com/linesthatinterlace/verif-cb/blob/main/src/verif-cb.lean">https://github.com/linesthatinterlace/verif-cb/blob/main/src/verif-cb.lean</a>
presents computer-verified Lean proofs for the same formulas.</p>
<p><a href="https://sorting.cr.yp.to/verif.html">https://sorting.cr.yp.to/verif.html</a>
presents tools that have been used to computer-verify machine-language
sorting software for all sizes of interest. However, there could be bugs
in these tools.</p>
<p><a href="https://github.com/linesthatinterlace/pqc-verification/tree/main/classic-mceliece/verification">https://github.com/linesthatinterlace/pqc-verification/tree/main/classic-mceliece/verification</a>
presents computer verification, using the SAW tool, that various C
functions match shorter descriptions in the Cryptol language. However,
this verification covers only some C functions, mainly finite-field
arithmetic and root-finding.</p><hr><font size=1><b>Version:</b>
This is version 2023.02.18 of the "Verification" web page.
</font>
</div>
</body>
</html>