Giter Club home page Giter Club logo

mlsag's Introduction

MLSAG in JavaScript

An implementation of MLSAG in JavaScript.

Disclaimer: DO NOT USE THIS PACKAGE IN ANY SERIOUS PROJECT.

This package is still in development, and APIs are subject to change without following the semver rules. In fact, I do not even know if it is working properly and I am not so familiar with these things. PRs, issues and suggestions are extremely welcome.

Please take a look at the paper before using this package as the APIs uses symbols in the paper.

Example

import { MLSAG } from 'mlsag'
import { SHA3 } from 'sha3'
import assert from 'assert'

const mlsag = new MLSAG({
  hash: SHA3,
  hashOptions: [ 512 ],
})

// FIXME: use a public API
const keys = mlsag._randomKeyPairMatrix(5, 2)
const pi = 2
const P = keys.map(kr => kr.map(k => k.getPublic()))
const x = keys[pi].map(k => k.getPrivate())
const message = 'Hello World!'

// raw signature
const signature = mlsag.sign({ P, message, pi, x })
assert(mlsag.verify({ message, P, ...signature }))

// encoded signature
const encodedSignature = mlsag.sign({ P, message, pi, x, encode: true })
assert(mlsag.verify({ message, P, signature: encodedSignature }))

See test/mlsag.js for a more detailed example.

Docs

Only inline JSDoc is available for now.

mlsag's People

Contributors

alan-liang avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.