Skip to content

Commit 5660dfe

Browse files
author
Aslan Askarov
committed
Documenting adv, getTime, and random
1 parent 0253b9a commit 5660dfe

File tree

2 files changed

+50
-27
lines changed

2 files changed

+50
-27
lines changed

body.tex

Lines changed: 48 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ \section{Information flow control}
320320
levels. The security level of
321321
a value specifies the confidentiality policy of the
322322
value. Troupe uses the syntax \textcode{$\mathit{v}$@\lev{$\mathit{\ell_{\mathit{val}}}$}\%\lev{$\mathit{\ell_{\mathit{type}}}$}} to
323-
for denote that the value $\mathit{v}$ has security level
323+
denote that the value $\mathit{v}$ has security level
324324
$\mathit{\ell_{\mathit{val}}}$, and the information about the type of this value is labeled at $\mathit{\ell_{\mathit{type}}}$.
325325

326326

@@ -583,12 +583,13 @@ \subsubsection{Generalized receive and mailbox clearances}
583583
care needs to be taken to control information flows through the mailbox structure.
584584

585585

586-
Every message in a mailbox carries an extra label -- the blocking level of the sender.
587-
Receiving a value furthermore propagates the taint of the blocking level from the sender to the receiver.
586+
Every message in a mailbox carries an extra label -- the blocking level of the sender. We refer to this
587+
extra label as the \emph{presence label}.
588+
Receiving a value furthermore propagates the taint of the blocking level from the sender to the receiver via the presence label.
588589
In order to constrain a receive operation from an accidental raise of the blocking level, Troupe
589590
provides a general receive primitive in the form
590591
\code{rcv(lev1,lev2,hns)}. Here, \code{lev1} and \code{lev2}
591-
indicate the to and from-levels of the pc-tags on the messages, and \code{hns} is the list of
592+
indicate the to and from-levels of the presence labels on the messages, and \code{hns} is the list of
592593
handlers as before.
593594
The \code{receive} operation we introduced earlier is equivalent to \code{rcvp}
594595
at the level of the current pc label.
@@ -598,8 +599,9 @@ \subsubsection{Generalized receive and mailbox clearances}
598599

599600

600601
\begin{lstlisting}
601-
let val _ = if (secret) then rcv ({}, {alice}, [hn x => x] else ()
602-
in val x = rcv ({}, {}, [hn x => x ])
602+
let val _ = if secret then rcv ({}, {alice}, [hn x => x])
603+
else ()
604+
in rcv ({}, {}, [hn x => x])
603605
end
604606
\end{lstlisting}
605607

@@ -719,12 +721,22 @@ \section{Language reference}
719721

720722
\subsection{Built-in expressions}
721723

724+
\subsubsection{\code{adv}}
725+
\begin{description}
726+
\item [Description] Simulate sending a value to adversary at level $\{\}$. This function is introduced as a
727+
pedagogical convenience as as it removes the necessity to set up a network process when explaining explicit and implicit information flows.
728+
\item [Arguments] A value to pass to the adversary.
729+
\item [Returns] Unit.
730+
\item [Failure behavior] Crashes the current process if the provided value and the blocking label are more restrictive than bottom.
731+
\item [Example usage] \code{adv\ (42\ raisedTo\ \{alice\})}.
732+
\end{description}
733+
722734
\subsubsection{\code{attenuate}}
723735
\begin{description}
724736
\item [Description] Returns the attenuated authority
725737
\item [Arguments] A value of authority type.
726738
\item [Returns] A value of authority type
727-
\item [Example usage] \code{attenuate ( authority, \{alice\} ) }
739+
\item [Example usage] \code{attenuate ( authority, \{alice\} ) } Note that the above example will generate a runtime error.
728740
\end{description}
729741

730742

@@ -758,6 +770,16 @@ \subsubsection{\code{declassify}}
758770

759771
\end{description}
760772

773+
774+
\subsubsection{\code{getTime}}
775+
\begin{description}
776+
\item [Description] Obtains current Unix timestmap
777+
\item [Arguments] Unit.
778+
\item [Returns] Number.
779+
\item [Example usage] \textcode{getTime()}
780+
\end{description}
781+
782+
761783
\subsubsection{\code{lowermbox}}
762784
\begin{description}
763785
\item [Description] Lowers the clearance of the current process' mailbox.
@@ -810,6 +832,16 @@ \subsubsection{\code{printWithLabels}}
810832
\item [Example usage] \code{printWithLabels\ "Hello, world"}
811833
\end{description}
812834

835+
\subsubsection{\code{random}}
836+
\begin{description}
837+
\item [Description] Generates a random number between 0 (inclusive) and 1.
838+
\item [Arguments] Unit.
839+
\item [Returns] Number.
840+
\item [Example usage] \code{random()}
841+
\end{description}
842+
843+
844+
813845
\subsubsection{\code{sandbox}}
814846
\begin{description}
815847
\item [Description] Execute a function in a sandbox for a fixed duration of time.
@@ -972,12 +1004,12 @@ \subsubsection{\code{whereis}}
9721004
\end{minipage}
9731005
\end{description}
9741006

975-
9761007
\clearpage
9771008
\section{Installation and configuration}
9781009
\label{appendix:installationandconfig}
9791010
\subsection{Installation}
980-
See also the {\tt README} file provided with the installation.
1011+
See the {\tt README} file provided with the installation.
1012+
\if 0
9811013
\begin{enumerate}
9821014
\item Install Node JS.\footnote{
9831015
See \url{https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-ubuntu-18-04}}
@@ -986,14 +1018,14 @@ \subsection{Installation}
9861018
\item Check that the compiler works by running the local test suite: {\tt \$TROUPE/bin/golden}
9871019
\item If you get a message saying that all tests have passed, this means that the local tests work. You can now test the distributed runtime by trying out the Echo example.
9881020
\end{enumerate}
1021+
\fi
9891022

990-
\subsection{Create a network identifier for your server}
1023+
1024+
\subsection{Configuring network identifiers}
9911025
\label{sec:networkid}
9921026
Create a network identifier (together with the public/private key pair) for your node.
9931027
\begin{verbatim}
994-
$ mkdir -p code/ids
995-
$ cd code/ids/
996-
$ curl lbs-troupe.troupe-lang.org/mkid -o id-server.json
1028+
$ curl lbs-troupe.troupe-lang.org/mkid -o my-identifier.json
9971029
\end{verbatim}
9981030

9991031
The {\tt "id"} section of the JSON file is your identifier. The other
@@ -1002,16 +1034,6 @@ \subsection{Create a network identifier for your server}
10021034

10031035

10041036
\subsubsection{Testing your network identifier (optional)}
1005-
At this step, you can pass the file \verb+id-server.json+
1006-
when passing it as an argument to Troupe runtime. For example,
1007-
you can use this to try out the Echo example from Section~\ref{example:echo}. For this,
1008-
do the following steps.
1009-
\begin{enumerate}
1010-
\item Make sure the {\tt id-server.json} file is in the {\tt code/ids/} directory.
1011-
\item Edit {\tt echo-client.trp} by substituting the identity of the server for your own.
1012-
\item Run {\tt make echo-server}.
1013-
\item Open another terminal and run {\tt make echo-client}. If all works, you should see the output from the server.
1014-
\end{enumerate}
1015-
You can interrupt the execution with \^{}C.
1016-
1017-
1037+
At this step, you can pass the generated JSON file
1038+
as an argument to Troupe runtime, using the \verb+--id+ flag. See
1039+
the echo example provided with the installation.

main.tex

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@
3838

3939
%\author{}
4040
% \author{\sf Aslan Askarov \\ \small aslan@cs.au.dk}
41-
%\date{} % Activate to display a given date or no date
41+
42+
\date{March 4, 2020} % Activate to display a given date or no date
4243

4344
\begin{document}
4445
\maketitle

0 commit comments

Comments
 (0)