Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
(modification: no type change headlines) and this project adheres to
[Semantic Versioning](http://semver.org/spec/v2.0.0.html).


## [0.1.0] - 2017-10-11
- Initial release



31 changes: 29 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,38 @@ pairing cryptography library](https://github.com/zcash/bn), implementing an effi

## Installation

TODO
`npm install rustbn.js`

## Usage

TODO
Require the module:

```
const bn128Module = require('rustbn.js')
```

Curve Addition

```
const ecAddPrecompile = bn128Module.cwrap('ec_add', 'string', ['string'])
var inputHexStr = '...'
let result = ecAddPrecompile(inputHexStr)
```

Curve Multiplication

```
const ecMulPrecompile = bn128Module.cwrap('ec_mul', 'string', ['string'])
var inputHexStr = '...'
let result = ecMulPrecompile(inputHexStr)
```

Curve Pairing
```
const ecPairingPrecompile = bn128Module.cwrap('ec_pairing', 'string', ['string'])
var inputHexStr = '...'
let result = ecPairingPrecompile(inputHexStr)
```

## Developer

Expand Down