Skip to content

Commit 4b28046

Browse files
committed
offline alert message
1 parent 1228993 commit 4b28046

File tree

2 files changed

+15
-33
lines changed

2 files changed

+15
-33
lines changed

tutorial/intro.html

Lines changed: 7 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -12826,7 +12826,7 @@ <h2 id="asimpleexample4bitlogicaland">A Simple Example: 4-bit Logical And</h2>
1282612826
# 2 and 3 are the evaluator's
1282712827
# 6 is the output wire
1282812828

12829-
# gates
12829+
# gates
1283012830
2 1 0 1 4 AND # 4 = 0 AND 1
1283112831
2 1 2 3 5 AND # 5 = 2 AND 3
1283212832
2 1 4 5 6 AND # 6 = 4 AND 5
@@ -12848,12 +12848,12 @@ <h2 id="asimpleexample4bitlogicaland">A Simple Example: 4-bit Logical And</h2>
1284812848
<p>Now that we have the circuit, it is time to write the code for the parties and the server. JIGG requires minimal configurations.
1284912849
All we have to do is provide the JIGG parties with the address of the server, the circuit, and the inputs.</p>
1285012850
<p>The computation is asynchronous because it involves communication. The output is made available through a promise.
12851-
Additionally, a listener may be set to keep track of the progress of the computation. </p>
12851+
Additionally, a listener may be set to keep track of the progress of the computation.</p>
1285212852
<pre><code class="neptune[frame=2,scope=server,title=Server,env=server] language-neptune[frame=2,scope=server,title=Server,env=server]">// Create new JIGG Server, this server runs whenever httpServer is running
1285312853
const jiggServer = new JIGG.Server(httpServer);
1285412854
Console.log('JIGG Server created');
1285512855
</code></pre>
12856-
<pre><code class="neptune[frame=2,scope=garbler1,title=Garbler,env=browser] language-neptune[frame=2,scope=garbler1,title=Garbler,env=browser]">const inputs = [0, 1];
12856+
<pre><code class="neptune[frame=2,scope=garbler1,title=Garbler,env=browser,offline=false] language-neptune[frame=2,scope=garbler1,title=Garbler,env=browser,offline=false]">const inputs = [0, 1];
1285712857
const circuit = getAnd4Circuit();
1285812858

1285912859
// in node.js, use new JIGG.Client(...)
@@ -12873,7 +12873,7 @@ <h2 id="asimpleexample4bitlogicaland">A Simple Example: 4-bit Logical And</h2>
1287312873
// start
1287412874
agent.start();
1287512875
</code></pre>
12876-
<pre><code class="neptune[frame=2,scope=evaluator1,title=Evaluator,env=browser] language-neptune[frame=2,scope=evaluator1,title=Evaluator,env=browser]">const inputs = [0, 1];
12876+
<pre><code class="neptune[frame=2,scope=evaluator1,title=Evaluator,env=browser,offline=false] language-neptune[frame=2,scope=evaluator1,title=Evaluator,env=browser,offline=false]">const inputs = [0, 1];
1287712877
const circuit = getAnd4Circuit();
1287812878

1287912879
// in node.js, use new JIGG.Client(...)
@@ -12904,7 +12904,7 @@ <h2 id="inputoutputencoding32bitaddition">Input/output encoding: 32-bit Addition
1290412904
The circuit behaves as you would expect. For every two bits at the same position in the input, the circuit XORs these bits and the carry bit (initially 0)
1290512905
to find the output bit in the corresponding position, the circuit then determines the next carry by checking if
1290612906
any two of the input bits and previous carry wires are 1.</p>
12907-
<pre><code class="neptune[frame=3,scope=garbler3,title=Garbler,env=browser] language-neptune[frame=3,scope=garbler3,title=Garbler,env=browser]">const input = 154;
12907+
<pre><code class="neptune[frame=3,scope=garbler3,title=Garbler,env=browser,offline=false] language-neptune[frame=3,scope=garbler3,title=Garbler,env=browser,offline=false]">const input = 154;
1290812908
const circuit = getAdd32Circuit();
1290912909

1291012910
// in node.js, use new JIGG.Client(...)
@@ -12924,7 +12924,7 @@ <h2 id="inputoutputencoding32bitaddition">Input/output encoding: 32-bit Addition
1292412924
// start
1292512925
agent.start();
1292612926
</code></pre>
12927-
<pre><code class="neptune[frame=3,scope=evaluator3,title=Evaluator,env=browser] language-neptune[frame=3,scope=evaluator3,title=Evaluator,env=browser]">const input = 310;
12927+
<pre><code class="neptune[frame=3,scope=evaluator3,title=Evaluator,env=browser,offline=false] language-neptune[frame=3,scope=evaluator3,title=Evaluator,env=browser,offline=false]">const input = 310;
1292812928
const circuit = getAdd32Circuit();
1292912929

1293012930
// in node.js, use new JIGG.Client(...)
@@ -12969,7 +12969,7 @@ <h2 id="serverasagarblerevaluator">Server as a Garbler/Evaluator</h2>
1296912969
// start
1297012970
agent.start();
1297112971
</code></pre>
12972-
<pre><code class="neptune[frame=4,scope=evaluator3,title=Evaluator,env=browser] language-neptune[frame=4,scope=evaluator3,title=Evaluator,env=browser]">const input = '202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f'; // hex input
12972+
<pre><code class="neptune[frame=4,scope=evaluator3,title=Evaluator,env=browser,offline=false] language-neptune[frame=4,scope=evaluator3,title=Evaluator,env=browser,offline=false]">const input = '202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f'; // hex input
1297312973
const circuit = getSha256Circuit();
1297412974

1297512975
// in node.js, use new JIGG.Client(...)
@@ -14974,15 +14974,13 @@ <h1 id="additionalresources">Additional Resources</h1>
1497414974

1497514975
},{}],20:[function(require,module,exports){
1497614976

14977-
1497814977
var BlobBuilder = typeof BlobBuilder !== 'undefined' ? BlobBuilder :
1497914978
typeof WebKitBlobBuilder !== 'undefined' ? WebKitBlobBuilder :
1498014979
typeof MSBlobBuilder !== 'undefined' ? MSBlobBuilder :
1498114980
typeof MozBlobBuilder !== 'undefined' ? MozBlobBuilder :
1498214981
false;
1498314982

1498414983

14985-
1498614984
var blobSupported = (function() {
1498714985
try {
1498814986
var a = new Blob(['hi']);
@@ -14993,7 +14991,6 @@ <h1 id="additionalresources">Additional Resources</h1>
1499314991
})();
1499414992

1499514993

14996-
1499714994
var blobSupportsArrayBufferView = blobSupported && (function() {
1499814995
try {
1499914996
var b = new Blob([new Uint8Array([1,2])]);
@@ -15004,13 +15001,11 @@ <h1 id="additionalresources">Additional Resources</h1>
1500415001
})();
1500515002

1500615003

15007-
1500815004
var blobBuilderSupported = BlobBuilder
1500915005
&& BlobBuilder.prototype.append
1501015006
&& BlobBuilder.prototype.getBlob;
1501115007

1501215008

15013-
1501415009
function mapArrayBufferViews(ary) {
1501515010
return ary.map(function(chunk) {
1501615011
if (chunk.buffer instanceof ArrayBuffer) {
@@ -21933,19 +21928,16 @@ <h1 id="additionalresources">Additional Resources</h1>
2193321928
},{}],55:[function(require,module,exports){
2193421929

2193521930

21936-
2193721931
if (typeof module !== 'undefined') {
2193821932
module.exports = Emitter;
2193921933
}
2194021934

2194121935

21942-
2194321936
function Emitter(obj) {
2194421937
if (obj) return mixin(obj);
2194521938
};
2194621939

2194721940

21948-
2194921941
function mixin(obj) {
2195021942
for (var key in Emitter.prototype) {
2195121943
obj[key] = Emitter.prototype[key];
@@ -21954,7 +21946,6 @@ <h1 id="additionalresources">Additional Resources</h1>
2195421946
}
2195521947

2195621948

21957-
2195821949
Emitter.prototype.on =
2195921950
Emitter.prototype.addEventListener = function(event, fn){
2196021951
this._callbacks = this._callbacks || {};
@@ -21964,7 +21955,6 @@ <h1 id="additionalresources">Additional Resources</h1>
2196421955
};
2196521956

2196621957

21967-
2196821958
Emitter.prototype.once = function(event, fn){
2196921959
function on() {
2197021960
this.off(event, on);
@@ -21977,7 +21967,6 @@ <h1 id="additionalresources">Additional Resources</h1>
2197721967
};
2197821968

2197921969

21980-
2198121970
Emitter.prototype.off =
2198221971
Emitter.prototype.removeListener =
2198321972
Emitter.prototype.removeAllListeners =
@@ -22009,7 +21998,6 @@ <h1 id="additionalresources">Additional Resources</h1>
2200921998
};
2201021999

2201122000

22012-
2201322001
Emitter.prototype.emit = function(event){
2201422002
this._callbacks = this._callbacks || {};
2201522003
var args = [].slice.call(arguments, 1)
@@ -22026,14 +22014,12 @@ <h1 id="additionalresources">Additional Resources</h1>
2202622014
};
2202722015

2202822016

22029-
2203022017
Emitter.prototype.listeners = function(event){
2203122018
this._callbacks = this._callbacks || {};
2203222019
return this._callbacks['$' + event] || [];
2203322020
};
2203422021

2203522022

22036-
2203722023
Emitter.prototype.hasListeners = function(event){
2203822024
return !! this.listeners(event).length;
2203922025
};
@@ -32742,7 +32728,6 @@ <h1 id="additionalresources">Additional Resources</h1>
3274232728

3274332729
},{"./aesid.json":134,"./asn1":135,"./fixProc":137,"browserify-aes":26,"pbkdf2":142,"safe-buffer":173}],139:[function(require,module,exports){
3274432730

32745-
3274632731
exports.encode = function (obj) {
3274732732
var str = '';
3274832733

@@ -32757,7 +32742,6 @@ <h1 id="additionalresources">Additional Resources</h1>
3275732742
};
3275832743

3275932744

32760-
3276132745
exports.decode = function(qs){
3276232746
var qry = {};
3276332747
var pairs = qs.split('&');
@@ -32770,7 +32754,6 @@ <h1 id="additionalresources">Additional Resources</h1>
3277032754

3277132755
},{}],140:[function(require,module,exports){
3277232756

32773-
3277432757
var re = /^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/;
3277532758

3277632759
var parts = [
@@ -39712,7 +39695,6 @@ <h1 id="additionalresources">Additional Resources</h1>
3971239695
return token.trim();
3971339696
});
3971439697
});
39715-
console.log(rows);
3971639698

3971739699
const wireCount = parseInt(rows[0][1]);
3971839700
const inputs = rows[1].slice(1);

tutorial/intro.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ This circuit is as simple as it sounds. Our two parties provide each provide 2 b
9292
# 2 and 3 are the evaluator's
9393
# 6 is the output wire
9494
95-
# gates
95+
# gates
9696
2 1 0 1 4 AND # 4 = 0 AND 1
9797
2 1 2 3 5 AND # 5 = 2 AND 3
9898
2 1 4 5 6 AND # 6 = 4 AND 5
@@ -118,15 +118,15 @@ Now that we have the circuit, it is time to write the code for the parties and t
118118
All we have to do is provide the JIGG parties with the address of the server, the circuit, and the inputs.
119119

120120
The computation is asynchronous because it involves communication. The output is made available through a promise.
121-
Additionally, a listener may be set to keep track of the progress of the computation.
121+
Additionally, a listener may be set to keep track of the progress of the computation.
122122

123123
```neptune[frame=2,scope=server,title=Server,env=server]
124124
// Create new JIGG Server, this server runs whenever httpServer is running
125125
const jiggServer = new JIGG.Server(httpServer);
126126
Console.log('JIGG Server created');
127127
```
128128

129-
```neptune[frame=2,scope=garbler1,title=Garbler,env=browser]
129+
```neptune[frame=2,scope=garbler1,title=Garbler,env=browser,offline=false]
130130
const inputs = [0, 1];
131131
const circuit = getAnd4Circuit();
132132
@@ -148,7 +148,7 @@ agent.getOutput().then(function (outputs) {
148148
agent.start();
149149
```
150150

151-
```neptune[frame=2,scope=evaluator1,title=Evaluator,env=browser]
151+
```neptune[frame=2,scope=evaluator1,title=Evaluator,env=browser,offline=false]
152152
const inputs = [0, 1];
153153
const circuit = getAnd4Circuit();
154154
@@ -185,7 +185,7 @@ The circuit behaves as you would expect. For every two bits at the same position
185185
to find the output bit in the corresponding position, the circuit then determines the next carry by checking if
186186
any two of the input bits and previous carry wires are 1.
187187

188-
```neptune[frame=3,scope=garbler3,title=Garbler,env=browser]
188+
```neptune[frame=3,scope=garbler3,title=Garbler,env=browser,offline=false]
189189
const input = 154;
190190
const circuit = getAdd32Circuit();
191191
@@ -207,7 +207,7 @@ agent.getOutput('number').then(function (output) {
207207
agent.start();
208208
```
209209

210-
```neptune[frame=3,scope=evaluator3,title=Evaluator,env=browser]
210+
```neptune[frame=3,scope=evaluator3,title=Evaluator,env=browser,offline=false]
211211
const input = 310;
212212
const circuit = getAdd32Circuit();
213213
@@ -261,7 +261,7 @@ agent.getOutput('hex').then(function (output) {
261261
agent.start();
262262
```
263263

264-
```neptune[frame=4,scope=evaluator3,title=Evaluator,env=browser]
264+
```neptune[frame=4,scope=evaluator3,title=Evaluator,env=browser,offline=false]
265265
const input = '202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f'; // hex input
266266
const circuit = getSha256Circuit();
267267
@@ -300,4 +300,4 @@ A detailed example can be found in the [JIGG repo](https://github.com/multiparty
300300

301301
You can find additional circuits and examples in the [JIGG repo](https://github.com/multiparty/jigg).
302302

303-
Detailed documentation for user-facing API can be found in the [online docs](https://multiparty.org/jigg/docs/).
303+
Detailed documentation for user-facing API can be found in the [online docs](https://multiparty.org/jigg/docs/).

0 commit comments

Comments
 (0)