Comparing version 0.0.1 to 0.0.2
{ | ||
"name": "secp256k1", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "This module provides native bindings to ecdsa secp256k1 functions", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -1,2 +0,2 @@ | ||
secp256k1 | ||
secp256k1 [![Build Status](https://travis-ci.org/wanderer/secp256k1-node.svg?branch=master)](https://travis-ci.org/wanderer/secp256k1-node) | ||
=== | ||
@@ -6,2 +6,34 @@ | ||
Usage | ||
=== | ||
```javascript | ||
var ecdsa = require('secp256k1'), | ||
sr = require('secure-random'); | ||
var privateKey = sr.randomBuffer(32); | ||
//a random message to sign | ||
var msg = sr.randomBuffer(32); | ||
//get the public key in a compressed format | ||
var pubKey = ecdsa.createPublicKey(privateKey, true); | ||
//sign the message | ||
var sig = ecdsa.sign(privateKey, msg); | ||
//verify the signature | ||
if(ecdsa.verify(pubKey, msg, sig)){ | ||
console.log("valid signature"); | ||
} | ||
``` | ||
Test | ||
=== | ||
run `npm test` | ||
API | ||
=== | ||
secp256k1.verifySecetKey(sercetKey) | ||
@@ -142,2 +174,4 @@ ----------------------------- | ||
# NOTES | ||
This will not work on node version 11 yet. Arrays need to have `isolates` for this. | ||
@@ -149,1 +183,2 @@ | ||
@@ -0,1 +1,2 @@ | ||
//tests against the `ecdsa` module | ||
var ecdsa = require('ecdsa'); | ||
@@ -12,3 +13,2 @@ var BigInteger = require('bigi'); | ||
//test public key generation | ||
var pubKey; | ||
@@ -15,0 +15,0 @@ var compactSig; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 2 instances in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
182
666248
69
7