JIGG

Main module: exposes client and server API. This is the module that is exposed when requiring jigg from node.js.

Source:

Members

(static) Client

Source:
See:

The client class, an alias for Agent.

Example
const JIGG = require('jigg');
const client = new JIGG.Client('Garbler', 'http://localhost:3000', {debug: true});

(static) Server

Source:
See:

The server class

Example
// Using express + http
const express = require('express');
const http = require('http');
const app = express();
const httpServer = http.createServer(app);

const JIGG = require('jigg');
const server = new JIGG.Server(http, {debug: true});

Type Definitions

progressListener(state, currentopt, totalopt, erroropt)

Source:

This callback logs or displays progress.

Parameters:
Name Type Attributes Description
state string

one of of the following states: 'connected', 'garbling', 'OT', 'evaluating', 'output', 'error'. OT is called after oblivious transfer is executed for the current party, if state is garbling or evaluating, then current and total are provided.

current number <optional>

Progress so far (i.e., numerator).

total number <optional>

Target total (i.e., the denominator).

error string | Error <optional>

If any error occured, this will be passed with state 'error'.