JSPM

kyber-js

0.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q33018F

A javascript implementation of Kyber interfaces

Package Exports

  • kyber-js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (kyber-js) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

KyberJS

Javascript implementation of Kyber interfaces

  1. This is developmental, and not ready for protecting production data.
  2. This is not a constant time implementation, and likely has timing side channels that can be attacked.

Usage

<html>
  <head>
    <meta charset="UTF-8">
    <script src="dist/bundle.min.js" type="text/javascript"></script>
    <script type="text/javascript">
      var nist = kyber.group.nist;
      var p256 = new nist.Curve(nist.Params.p256);
      var randomPoint = p256.point().pick();
      var randomScalar = p256.scalar().pick();
      var product = p256.point().mul(randomScalar, randomPoint);
      console.log(product.string(), randomPoint.string(), randomScalar.string());
    </script>
  </head>
  <body>
  </body>
</html>

Dev Setup

git clone https://github.com/dedis/cothority
cd cothority/external/js/kyber
npm install

Browser Build

npm run build will output dist/bundle.min.js and dist/bundle.node.min.js

Running Tests

Execute npm test to run the unit tests.

Generate Documentation

Execute npm run doc to generate JSDoc output in markdown format in doc/doc.md