basic elliptic curve crypto for React Native
Objective-C Java JavaScript
Latest commit 2e6407e Nov 9, 2016 @mvayngrib mvayngrib 1.4.0
Failed to load latest commit information.
android get android working Oct 29, 2016
ios rm explicit sizeInBits specification in importPubKey Oct 4, 2016
.gitignore add android stub Oct 29, 2016
LICENSE Initial commit Dec 27, 2015 update readme Nov 4, 2016
index.js fix hasKey call for android Oct 29, 2016
package.json 1.4.0 Nov 10, 2016


basic elliptic curve crypto for React Native

this module is used by Tradle


See Linking Libraries


import * as ec from 'react-native-ecc'
import { Buffer } from 'buffer'

// if you want to be able to find your keys
// next time, make sure to use the same service ID 
// optional
// ec.setAccessGroup('')

// this library allows you to sign 32 byte hashes (e.g. sha256 hashes)
const msg = new Buffer('hey ho')
// check ec.curves for supported curves
const curve = 'p256'
ec.keyPair(curve, function (err, key) {
  // pub tested for compatibility with npm library "elliptic"
  const pub =

  // look up the key later like this:
  // const key = ec.keyFromPublic(pub)

    data: msg,
    algorithm: 'sha256'
  }, function (err, sig) {
    // signatures tested for compatibility with npm library "elliptic"
    console.log('sig', sig.toString('hex'))
      algorithm: 'sha256',
      data: msg,
      sig: sig
    }, function (err, verified) {
      console.log('verified:', verified)