@nthparty/oblivious
TypeScript icon, indicating that this package has built-in type declarations

1.3.0 • Public • Published

oblivious-js

npm version GitHub Actions Status Coverage Status

JavaScript library that serves as an API for common primitives used to implement OPRF and OT protocols.

Purpose

This library provides TypeScript libsodium wrappers for cryptographic primitives that are often used to implement oblivious pseudorandom function (OPRF) and oblivious transfer (OT) protocols.

For more information on the underlying mathematical structures and primitives, consult materials about the Ed25519 system and the Ristretto group.

Package Installation and Usage

The package is available on npm:

npm install @nthparty/oblivious

The library can be imported in the usual ways:

const Oblivious = require('path/to/dist/oblivious.js');  // Standalone
const Oblivious = require('path/to/dist/oblivious.slim.js')(sodium);  // Slim
const { Oblivious } = require('@nthparty/oblivious');  // Node.js

Oblivious.ready.then(function () {
    const p = Oblivious.Point.random();
    console.log(p);  // Point(32) [Uint8Array] [ ... ]
});

The latest browser-optimized distributions can be found here.

Testing and Conventions

All unit tests are executed and their coverage measured when using Jest (see jest.config.js for configuration details):

npm test

Browser-based tests are located in test/browser/, and you can run them either locally, or by visiting the preview.

Style conventions are enforced using ESLint:

eslint src test/oblivious.test.ts
# -OR-
npm run-script lint

Contributions

In order to contribute to the source code, open an issue or submit a pull request on the GitHub page for this library. Remember to run npm run-script lint on any proposed code changes.

Versioning

Beginning with version 0.1.0, the version number format for this library and the changes to the library associated with version number increments conform with Semantic Versioning 2.0.0.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.3.02latest

Version History

VersionDownloads (Last 7 Days)Published
1.3.02
1.2.60
1.2.50
1.2.40
1.2.30
1.2.21
1.2.10
1.2.00
1.1.10
1.0.10
1.0.00

Package Sidebar

Install

npm i @nthparty/oblivious

Weekly Downloads

3

Version

1.3.0

License

MIT

Unpacked Size

829 kB

Total Files

12

Last publish

Collaborators

  • lapets
  • fjansen
  • whowe