Comparing version 0.8.0 to 0.9.0
@@ -32,7 +32,11 @@ var assert = require('assert'); | ||
ECDSA.prototype.genKeyPair = function genKeyPair() { | ||
ECDSA.prototype.genKeyPair = function genKeyPair(options) { | ||
if (!options) | ||
options = {}; | ||
// Instantiate Hmac_DRBG | ||
var drbg = new elliptic.hmacDRBG({ | ||
hash: this.hash, | ||
entropy: elliptic.rand(this.hash.hmacStrength), | ||
pers: options.pers, | ||
entropy: options.entropy || elliptic.rand(this.hash.hmacStrength), | ||
nonce: this.n | ||
@@ -39,0 +43,0 @@ }); |
{ | ||
"name": "elliptic", | ||
"version": "0.8.0", | ||
"version": "0.9.0", | ||
"description": "EC cryptography", | ||
@@ -5,0 +5,0 @@ "main": "lib/elliptic.js", |
@@ -176,2 +176,16 @@ var assert = require('assert'); | ||
}); | ||
it('should deterministically generate private key', function() { | ||
var curve = elliptic.nist.secp256k1; | ||
assert(curve); | ||
var ecdsa = new elliptic.ecdsa(curve); | ||
var keys = ecdsa.genKeyPair({ | ||
pers: 'my.pers.string', | ||
entropy: hash.sha256().update('hello world').digest() | ||
}); | ||
assert.equal( | ||
keys.getPrivate('hex'), | ||
'c381628be281b2e35e913fc3a2e8ac3867eae90e5ad9d0d7a2e4af90cee92787'); | ||
}); | ||
}); |
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
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
100785
2505