Skip to content

Commit 0522f35

Browse files
authored
Merge pull request #4 from multiparty/tutorials
Tutorials directory with Intro to JIGG Tutorial
2 parents eacdc11 + 4b28046 commit 0522f35

21 files changed

+41514
-50
lines changed

.gitmodules

Lines changed: 0 additions & 4 deletions
This file was deleted.

README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,16 @@ npm install
2121
│ ├─ comm/ Communications modules (such as for OT)
2222
│ ├─ modules/ Data structure modules (such as circuits)
2323
│ └─ utils/ Other utility modules (such as cryptographic primitives)
24-
└─ test/ End-to-end tests
24+
├─ test/ End-to-end tests
25+
└─ tutorial/ Interactive tutorial on using JIGG
2526

27+
## Running The tutorial
28+
29+
You can run the tutorial interactively on your local machine, after cloning JIGG, by using
30+
```shell
31+
cd path/to/JIGG
32+
npm run tutorial
33+
```
2634

2735
## Running Demo Circuit Applications
2836

@@ -77,7 +85,7 @@ JIGG can parse a circuit in the standardized '[Bristol](https://homes.esat.kuleu
7785
```
7886

7987
### Circuit Assembler
80-
To create a new circuit, write a macro with existing circuits as its gates and run the [macro-circuit-assembler](https://github.com/wyatt-howe/macro-circuit-assembler/tree/casm) with:
88+
To create a new circuit, write a macro with existing circuits as its gates and run the [macro-circuit-assembler](https://github.com/wyatt-howe/macro-circuit-assembler/) with:
8189

8290
```shell
8391
npm run casm -- <path_to_macro> <output_path>

circuits/bristol/logic-and-4-bit.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
3 7
2-
2 2 2
3-
1 1
1+
3 7 # 3 gates, 7 wires
2+
2 2 2 # 2 parties, 2 bits for each of them
3+
1 1 # 1 output, 1 bit long
44
2 1 0 1 4 AND
55
2 1 2 3 5 AND
66
2 1 4 5 6 AND

circuits/bristol/logic-nand-4-bit.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
4 8 # 4 gates, 8 wires
2+
2 2 2 # 2 parties, 2 bits for each of them
3+
1 1 # 1 output, 1 bit long
4+
2 1 0 1 4 AND # 2 inputs, 1 output, wire #0 AND wire #1 --> wire #4
5+
2 1 2 3 5 AND
6+
2 1 4 5 6 AND
7+
1 1 6 7 INV # 1 input, 1 output, invert wire 6 --> wire 7

dist/jigg.js

Lines changed: 16 additions & 15 deletions
Large diffs are not rendered by default.

docs/Agent.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
<input type="text" id="nav-search" placeholder="Search" />
3434

35-
<h2><a href="index.html">Home</a></h2><h2><a href="https://github.com/multiparty/jigg" target="_blank" class="menu-item" id="github_link" >Github Repo</a></h2><h3>Classes</h3><ul><li><a href="Agent.html">Agent</a><ul class='methods'><li data-type='method'><a href="Agent.html#addProgressListener">addProgressListener</a></li><li data-type='method'><a href="Agent.html#disconnect">disconnect</a></li><li data-type='method'><a href="Agent.html#getOutput">getOutput</a></li><li data-type='method'><a href="Agent.html#loadCircuit">loadCircuit</a></li><li data-type='method'><a href="Agent.html#setInput">setInput</a></li><li data-type='method'><a href="Agent.html#start">start</a></li></ul></li><li><a href="Server.html">Server</a><ul class='methods'><li data-type='method'><a href="Server.html#makeAgent">makeAgent</a></li></ul></li></ul><h3>Modules</h3><ul><li><a href="module-Browser.html">Browser</a></li><li><a href="module-JIGG.html">JIGG</a></li></ul>
35+
<h2><a href="index.html">Home</a></h2><h2><a href="https://github.com/multiparty/jigg" target="_blank" class="menu-item" id="github_link" >Github Repo</a></h2><h2><a href="../tutorial/intro.html" class="menu-item" >Tutorial</a></h2><h3>Classes</h3><ul><li><a href="Agent.html">Agent</a><ul class='methods'><li data-type='method'><a href="Agent.html#addProgressListener">addProgressListener</a></li><li data-type='method'><a href="Agent.html#disconnect">disconnect</a></li><li data-type='method'><a href="Agent.html#getOutput">getOutput</a></li><li data-type='method'><a href="Agent.html#loadCircuit">loadCircuit</a></li><li data-type='method'><a href="Agent.html#setInput">setInput</a></li><li data-type='method'><a href="Agent.html#start">start</a></li></ul></li><li><a href="Server.html">Server</a><ul class='methods'><li data-type='method'><a href="Server.html#makeAgent">makeAgent</a></li></ul></li></ul><h3>Modules</h3><ul><li><a href="module-Browser.html">Browser</a></li><li><a href="module-JIGG.html">JIGG</a></li></ul>
3636
</nav>
3737

3838
<div id="main">
@@ -1186,7 +1186,7 @@ <h4 class="name" id="start"><span class="type-signature"></span>start<span class
11861186
<br class="clear">
11871187

11881188
<footer>
1189-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Thu Feb 13 2020 12:30:51 GMT-0500 (Eastern Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
1189+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Tue Feb 18 2020 13:36:11 GMT-0500 (EST) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
11901190
</footer>
11911191

11921192
<script>prettyPrint();</script>

docs/Server.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
<input type="text" id="nav-search" placeholder="Search" />
3434

35-
<h2><a href="index.html">Home</a></h2><h2><a href="https://github.com/multiparty/jigg" target="_blank" class="menu-item" id="github_link" >Github Repo</a></h2><h3>Classes</h3><ul><li><a href="Agent.html">Agent</a><ul class='methods'><li data-type='method'><a href="Agent.html#addProgressListener">addProgressListener</a></li><li data-type='method'><a href="Agent.html#disconnect">disconnect</a></li><li data-type='method'><a href="Agent.html#getOutput">getOutput</a></li><li data-type='method'><a href="Agent.html#loadCircuit">loadCircuit</a></li><li data-type='method'><a href="Agent.html#setInput">setInput</a></li><li data-type='method'><a href="Agent.html#start">start</a></li></ul></li><li><a href="Server.html">Server</a><ul class='methods'><li data-type='method'><a href="Server.html#makeAgent">makeAgent</a></li></ul></li></ul><h3>Modules</h3><ul><li><a href="module-Browser.html">Browser</a></li><li><a href="module-JIGG.html">JIGG</a></li></ul>
35+
<h2><a href="index.html">Home</a></h2><h2><a href="https://github.com/multiparty/jigg" target="_blank" class="menu-item" id="github_link" >Github Repo</a></h2><h2><a href="../tutorial/intro.html" class="menu-item" >Tutorial</a></h2><h3>Classes</h3><ul><li><a href="Agent.html">Agent</a><ul class='methods'><li data-type='method'><a href="Agent.html#addProgressListener">addProgressListener</a></li><li data-type='method'><a href="Agent.html#disconnect">disconnect</a></li><li data-type='method'><a href="Agent.html#getOutput">getOutput</a></li><li data-type='method'><a href="Agent.html#loadCircuit">loadCircuit</a></li><li data-type='method'><a href="Agent.html#setInput">setInput</a></li><li data-type='method'><a href="Agent.html#start">start</a></li></ul></li><li><a href="Server.html">Server</a><ul class='methods'><li data-type='method'><a href="Server.html#makeAgent">makeAgent</a></li></ul></li></ul><h3>Modules</h3><ul><li><a href="module-Browser.html">Browser</a></li><li><a href="module-JIGG.html">JIGG</a></li></ul>
3636
</nav>
3737

3838
<div id="main">
@@ -482,7 +482,7 @@ <h5>Returns:</h5>
482482
<br class="clear">
483483

484484
<footer>
485-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Thu Feb 13 2020 12:30:51 GMT-0500 (Eastern Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
485+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Tue Feb 18 2020 13:36:11 GMT-0500 (EST) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
486486
</footer>
487487

488488
<script>prettyPrint();</script>

docs/index.html

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
<input type="text" id="nav-search" placeholder="Search" />
3434

35-
<h2><a href="index.html">Home</a></h2><h2><a href="https://github.com/multiparty/jigg" target="_blank" class="menu-item" id="github_link" >Github Repo</a></h2><h3>Classes</h3><ul><li><a href="Agent.html">Agent</a><ul class='methods'><li data-type='method'><a href="Agent.html#addProgressListener">addProgressListener</a></li><li data-type='method'><a href="Agent.html#disconnect">disconnect</a></li><li data-type='method'><a href="Agent.html#getOutput">getOutput</a></li><li data-type='method'><a href="Agent.html#loadCircuit">loadCircuit</a></li><li data-type='method'><a href="Agent.html#setInput">setInput</a></li><li data-type='method'><a href="Agent.html#start">start</a></li></ul></li><li><a href="Server.html">Server</a><ul class='methods'><li data-type='method'><a href="Server.html#makeAgent">makeAgent</a></li></ul></li></ul><h3>Modules</h3><ul><li><a href="module-Browser.html">Browser</a></li><li><a href="module-JIGG.html">JIGG</a></li></ul>
35+
<h2><a href="index.html">Home</a></h2><h2><a href="https://github.com/multiparty/jigg" target="_blank" class="menu-item" id="github_link" >Github Repo</a></h2><h2><a href="../tutorial/intro.html" class="menu-item" >Tutorial</a></h2><h3>Classes</h3><ul><li><a href="Agent.html">Agent</a><ul class='methods'><li data-type='method'><a href="Agent.html#addProgressListener">addProgressListener</a></li><li data-type='method'><a href="Agent.html#disconnect">disconnect</a></li><li data-type='method'><a href="Agent.html#getOutput">getOutput</a></li><li data-type='method'><a href="Agent.html#loadCircuit">loadCircuit</a></li><li data-type='method'><a href="Agent.html#setInput">setInput</a></li><li data-type='method'><a href="Agent.html#start">start</a></li></ul></li><li><a href="Server.html">Server</a><ul class='methods'><li data-type='method'><a href="Server.html#makeAgent">makeAgent</a></li></ul></li></ul><h3>Modules</h3><ul><li><a href="module-Browser.html">Browser</a></li><li><a href="module-JIGG.html">JIGG</a></li></ul>
3636
</nav>
3737

3838
<div id="main">
@@ -78,7 +78,13 @@ <h2>Project Layout</h2>
7878
│ ├─ comm/ Communications modules (such as for OT)
7979
│ ├─ modules/ Data structure modules (such as circuits)
8080
│ └─ utils/ Other utility modules (such as cryptographic primitives)
81-
└─ test/ End-to-end tests
81+
├─ test/ End-to-end tests
82+
└─ tutorial/ Interactive tutorial on using JIGG
83+
</code></pre>
84+
<h2>Running The tutorial</h2>
85+
<p>You can run the tutorial interactively on your local machine, after cloning JIGG, by using</p>
86+
<pre class="prettyprint source lang-shell"><code>cd path/to/JIGG
87+
npm run tutorial
8288
</code></pre>
8389
<h2>Running Demo Circuit Applications</h2>
8490
<p>Start the communications server from server.js with the command below:</p>
@@ -117,16 +123,15 @@ <h3>Circuit Format</h3>
117123
2 1 4 6 7 AND
118124
</code></pre>
119125
<h3>Circuit Assembler</h3>
120-
<p>To create a new circuit, write a macro with existing circuits as its gates and run the <a href="https://github.com/wyatt-howe/macro-circuit-assembler/tree/casm">macro-circuit-assembler</a> with:</p>
126+
<p>To create a new circuit, write a macro with existing circuits as its gates and run the <a href="https://github.com/wyatt-howe/macro-circuit-assembler/">macro-circuit-assembler</a> with:</p>
121127
<pre class="prettyprint source lang-shell"><code>npm run casm -- &lt;path_to_macro> &lt;output_path>
122128
</code></pre>
123129
<p>For example, this macro assembles an AND circuit over 8 bits using
124130
existing 4 bit AND circuits:</p>
125131
<pre class="prettyprint source"><code>npm run casm -- circuits/macros/and-8.casm circuits/and-8.txt
126132
</code></pre>
127133
<h2>Running Tests</h2>
128-
<h3>End-to-end Tests</h3>
129-
<p>All of the built-in test vectors can be verified in <code>npm test</code>. The tests will run a server automatically.</p>
134+
<p>All of the built-in test vectors can be verified in <code>npm test</code>. The tests will run a server automatically. These are end-to-end tests.</p>
130135
<h2>Capabilities</h2>
131136
<p>JIGG is designed for semi-honest parties (in either node or in the browser). We support point-and-permute, free-XOR, free single-input gates, and encryption from a random oracle (fixed-key XChaCha20). The half-AND optimization is compatible but not yet supported. The default label size is 128 bits and relies on JavaScript's Uint8Array class. The <a href="https://github.com/wyatt-howe/jigg/tree/simple-labels"><code>simple-labels</code></a> branch demonstrates dynamically-sized labels (that are 53 bits in length or less) without using arrays. Some potential improvements are listed in the to-do section.</p>
132137
<h2>Contributing</h2>
@@ -152,7 +157,7 @@ <h2>Information and Collaborators</h2>
152157
<br class="clear">
153158

154159
<footer>
155-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Thu Feb 13 2020 12:30:51 GMT-0500 (Eastern Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
160+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Tue Feb 18 2020 13:36:11 GMT-0500 (EST) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
156161
</footer>
157162

158163
<script>prettyPrint();</script>

docs/jigg.js.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
<input type="text" id="nav-search" placeholder="Search" />
3434

35-
<h2><a href="index.html">Home</a></h2><h2><a href="https://github.com/multiparty/jigg" target="_blank" class="menu-item" id="github_link" >Github Repo</a></h2><h3>Classes</h3><ul><li><a href="Agent.html">Agent</a><ul class='methods'><li data-type='method'><a href="Agent.html#addProgressListener">addProgressListener</a></li><li data-type='method'><a href="Agent.html#disconnect">disconnect</a></li><li data-type='method'><a href="Agent.html#getOutput">getOutput</a></li><li data-type='method'><a href="Agent.html#loadCircuit">loadCircuit</a></li><li data-type='method'><a href="Agent.html#setInput">setInput</a></li><li data-type='method'><a href="Agent.html#start">start</a></li></ul></li><li><a href="Server.html">Server</a><ul class='methods'><li data-type='method'><a href="Server.html#makeAgent">makeAgent</a></li></ul></li></ul><h3>Modules</h3><ul><li><a href="module-Browser.html">Browser</a></li><li><a href="module-JIGG.html">JIGG</a></li></ul>
35+
<h2><a href="index.html">Home</a></h2><h2><a href="https://github.com/multiparty/jigg" target="_blank" class="menu-item" id="github_link" >Github Repo</a></h2><h2><a href="../tutorial/intro.html" class="menu-item" >Tutorial</a></h2><h3>Classes</h3><ul><li><a href="Agent.html">Agent</a><ul class='methods'><li data-type='method'><a href="Agent.html#addProgressListener">addProgressListener</a></li><li data-type='method'><a href="Agent.html#disconnect">disconnect</a></li><li data-type='method'><a href="Agent.html#getOutput">getOutput</a></li><li data-type='method'><a href="Agent.html#loadCircuit">loadCircuit</a></li><li data-type='method'><a href="Agent.html#setInput">setInput</a></li><li data-type='method'><a href="Agent.html#start">start</a></li></ul></li><li><a href="Server.html">Server</a><ul class='methods'><li data-type='method'><a href="Server.html#makeAgent">makeAgent</a></li></ul></li></ul><h3>Modules</h3><ul><li><a href="module-Browser.html">Browser</a></li><li><a href="module-JIGG.html">JIGG</a></li></ul>
3636
</nav>
3737

3838
<div id="main">
@@ -106,7 +106,7 @@ <h1 class="page-title">jigg.js</h1>
106106
<br class="clear">
107107

108108
<footer>
109-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Thu Feb 13 2020 12:30:51 GMT-0500 (Eastern Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
109+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Tue Feb 18 2020 13:36:11 GMT-0500 (EST) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
110110
</footer>
111111

112112
<script>prettyPrint();</script>

docs/jiggClient.js.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
<input type="text" id="nav-search" placeholder="Search" />
3434

35-
<h2><a href="index.html">Home</a></h2><h2><a href="https://github.com/multiparty/jigg" target="_blank" class="menu-item" id="github_link" >Github Repo</a></h2><h3>Classes</h3><ul><li><a href="Agent.html">Agent</a><ul class='methods'><li data-type='method'><a href="Agent.html#addProgressListener">addProgressListener</a></li><li data-type='method'><a href="Agent.html#disconnect">disconnect</a></li><li data-type='method'><a href="Agent.html#getOutput">getOutput</a></li><li data-type='method'><a href="Agent.html#loadCircuit">loadCircuit</a></li><li data-type='method'><a href="Agent.html#setInput">setInput</a></li><li data-type='method'><a href="Agent.html#start">start</a></li></ul></li><li><a href="Server.html">Server</a><ul class='methods'><li data-type='method'><a href="Server.html#makeAgent">makeAgent</a></li></ul></li></ul><h3>Modules</h3><ul><li><a href="module-Browser.html">Browser</a></li><li><a href="module-JIGG.html">JIGG</a></li></ul>
35+
<h2><a href="index.html">Home</a></h2><h2><a href="https://github.com/multiparty/jigg" target="_blank" class="menu-item" id="github_link" >Github Repo</a></h2><h2><a href="../tutorial/intro.html" class="menu-item" >Tutorial</a></h2><h3>Classes</h3><ul><li><a href="Agent.html">Agent</a><ul class='methods'><li data-type='method'><a href="Agent.html#addProgressListener">addProgressListener</a></li><li data-type='method'><a href="Agent.html#disconnect">disconnect</a></li><li data-type='method'><a href="Agent.html#getOutput">getOutput</a></li><li data-type='method'><a href="Agent.html#loadCircuit">loadCircuit</a></li><li data-type='method'><a href="Agent.html#setInput">setInput</a></li><li data-type='method'><a href="Agent.html#start">start</a></li></ul></li><li><a href="Server.html">Server</a><ul class='methods'><li data-type='method'><a href="Server.html#makeAgent">makeAgent</a></li></ul></li></ul><h3>Modules</h3><ul><li><a href="module-Browser.html">Browser</a></li><li><a href="module-JIGG.html">JIGG</a></li></ul>
3636
</nav>
3737

3838
<div id="main">
@@ -251,7 +251,7 @@ <h1 class="page-title">jiggClient.js</h1>
251251
<br class="clear">
252252

253253
<footer>
254-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Thu Feb 13 2020 12:30:51 GMT-0500 (Eastern Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
254+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Tue Feb 18 2020 13:36:11 GMT-0500 (EST) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
255255
</footer>
256256

257257
<script>prettyPrint();</script>

0 commit comments

Comments
 (0)