Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Benoit Viguier
coqveriftweetnacl
Commits
777396d0
Commit
777396d0
authored
Feb 13, 2018
by
Benoit Viguier
Browse files
move parts
parent
c28bf94f
Changes
2
Hide whitespace changes
Inline
Sidebyside
readings/1_Introduction.tex
View file @
777396d0
...
...
@@ 28,32 +28,3 @@ the TweetNaCl C code. Using the Separation logic\cite{1969Hoare,Reynolds02separ
with (VST) we show that the semantics of the program satisfies a functionnal
specification in Coq. We then prove that this specification represent the scalar
multiplication on Curve25519.
\subsection
{
Meetinthemiddle Approach
}
In order to prove that
\texttt
{
crypto
\_
scalarmult
}
is computing a scalar
multiplication over the xcoordinate of a point P, we need to define multiples
levels of specifications and show equivalence between them (Fig.
\ref
{
tk:ProofStructure
}
).
\begin{enumerate}
\item
Write a high level specification (over a generic field
$
\mathbb
{
F
}$
).
\item
Prove that the high level specification is equivalent to the
computation of a montgomery ladder.
\item
Write a low level specification (e.g. over lists of
$
\mathbb
{
Z
}$
).
\item
Prove that the low level specification represent the operations of
defined C code.
\item
Write a middle level specification over
$
\mathbb
{
Z
}_{
2
^{
255
}

19
}$
.
\item
Prove that the low level specification are equivalent to simple
operations in
$
\mathbb
{
Z
}_{
2
^{
255
}

19
}$
and thus equivalent to the middle level.
\item
Prove that the middle level specification is an instance of the high
level one.
\end{enumerate}
The equivalence between each level, garantees us the correctness of the
implementation.
\begin{figure}
[h]
\include
{
tikz/specifications
}
\caption
{
Structural construction of the proof
}
\label
{
tk:ProofStructure
}
\end{figure}
readings/2_Implementation.tex
View file @
777396d0
...
...
@@ 15,8 +15,8 @@ bits placed into 64bits signed container.
typedef long long i64;
typedef i64 gf[16];
\end{lstlisting}
This
representation
does not guarant
ies
uniqueness. i.e.
\\
$
\exists
x,y
\in
\texttt
{
gf
}
\text
{
such that
}$
This does not guarant
y a
uniqueness
representation of each number
. i.e.
\\
$
\exists
x,y
\in
\texttt
{
gf
}
$
such that
\vspace
{
0.25cm
}
$$
x
\neq
y
\ \ \land\ \
x
\equiv
y
\pmod
{
2
^{
255
}

19
}$$
...
...
@@ 177,6 +177,35 @@ We also show that TweetNaCl's code is \textbf{correct}:
\item
Operations on
\texttt
{
gf
}
are equivalent to operations in
$
\mathbb
{
Z
}_{
2
^{
255
}

19
}$
\end{itemize}
\subsection
{
Meetinthemiddle Approach
}
In order to prove that
\texttt
{
crypto
\_
scalarmult
}
is computing a scalar
multiplication over the xcoordinate of a point P, we need to define multiples
levels of specifications and show equivalence between them (Fig.
\ref
{
tk:ProofStructure
}
).
\begin{enumerate}
\item
Write a high level specification (over a generic field
$
\mathbb
{
F
}$
).
\item
Prove that the high level specification is equivalent to the
computation of a montgomery ladder.
\item
Write a low level specification (e.g. over lists of
$
\mathbb
{
Z
}$
).
\item
Prove that the low level specification represent the operations of
defined C code.
\item
Write a middle level specification over
$
\mathbb
{
Z
}_{
2
^{
255
}

19
}$
.
\item
Prove that the low level specification are equivalent to simple
operations in
$
\mathbb
{
Z
}_{
2
^{
255
}

19
}$
and thus equivalent to the middle level.
\item
Prove that the middle level specification is an instance of the high
level one.
\end{enumerate}
The equivalence between each level, garantees us the correctness of the
implementation.
\begin{figure}
[h]
\include
{
tikz/specifications
}
\caption
{
Structural construction of the proof
}
\label
{
tk:ProofStructure
}
\end{figure}
\subsection
{
Correctness Theorem
}
The soundness is implied by the functionnal definition of the following theorem.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment