Skip to content

Commit 788bec0

Browse files
authored
Merge pull request #6 from ethereumjs/new-release-010
New release v0.1.0
2 parents 99a9adb + 3a01df9 commit 788bec0

File tree

2 files changed

+42
-2
lines changed

2 files changed

+42
-2
lines changed

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Changelog
2+
All notable changes to this project will be documented in this file.
3+
4+
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
5+
(modification: no type change headlines) and this project adheres to
6+
[Semantic Versioning](http://semver.org/spec/v2.0.0.html).
7+
8+
9+
## [0.1.0] - 2017-10-11
10+
- Initial release
11+
12+
13+

README.md

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,38 @@ pairing cryptography library](https://github.com/zcash/bn), implementing an effi
77

88
## Installation
99

10-
TODO
10+
`npm install rustbn.js`
1111

1212
## Usage
1313

14-
TODO
14+
Require the module:
15+
16+
```
17+
const bn128Module = require('rustbn.js')
18+
```
19+
20+
Curve Addition
21+
22+
```
23+
const ecAddPrecompile = bn128Module.cwrap('ec_add', 'string', ['string'])
24+
var inputHexStr = '...'
25+
let result = ecAddPrecompile(inputHexStr)
26+
```
27+
28+
Curve Multiplication
29+
30+
```
31+
const ecMulPrecompile = bn128Module.cwrap('ec_mul', 'string', ['string'])
32+
var inputHexStr = '...'
33+
let result = ecMulPrecompile(inputHexStr)
34+
```
35+
36+
Curve Pairing
37+
```
38+
const ecPairingPrecompile = bn128Module.cwrap('ec_pairing', 'string', ['string'])
39+
var inputHexStr = '...'
40+
let result = ecPairingPrecompile(inputHexStr)
41+
```
1542

1643
## Developer
1744

0 commit comments

Comments
 (0)