ecurve
JavaScript component for Elliptic Curve Cryptography. Works in both Node.js and the browser.
Official documentation:
Elliptic curve cryptography, which uses keybase/bn for bignums
JavaScript component for Elliptic Curve Cryptography. Works in both Node.js and the browser.
Official documentation:
secp224r1
because we're using curve specific optimizations for other curves see #21Curve
instance Daniel CousensCurve
class. Daniel CousensPoint
class from Curve
. Daniel Cousens no longer works:
var Curve = require('ecurve').Curve
var Point = Curve.Point
better way:
var Curve = requre('ecurve').Curve
var Point = require('ecurve').Point
terst
and replaced with Node.js assert
as per http://cryptocoinjs.com/about/contributing/ECCurveFp
field q
renamed to p
/ Daniel Cousensecparams
field g
renamed to G
/ Daniel CousensECFieldElementFp
shown unnecessary (deleted) / Daniel CousensisOnCurve()
/ Daniel CousensfromAffine()
, added properties affineX
and affineY
to Point
. This is because
Point
internally stores coordinates as Jacobian. Daniel CousensgetECParams()
to getCurveByName()
Daniel CousensECPointFP.decodeFrom()
to accept Buffer
instead of Array
. Thanks BitcoinJS devs / Daniel Cousens :)ECPointFP.prototype.getEncoded()
to return a Buffer
instead of an Array
compressed
property to instances of ECPointFp
, set to true
by defaultECCurveFp.prototype.decodePointHex
removed. This change brings additonal clarity and removes untested (unused)
portions of decodePointHex
.Old way:
var G = curve.decodePointHex("04"
+ "79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798"
+ "483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8");
New way:
var x = BigInteger.fromHex("79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798")
var y = BigInteger.fromHex("483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8")
var G = new ECPointFp(curve, curve.fromBigInteger(x), curve.fromBigInteger(y));
util.js
which contained integerToBytes(bigInt, sizeInBytes)
, new
way: [].slice.call(bigInt.toBuffer(sizeInBytes))
ECPointFp.prototype.add2D
, ECPointFp.prototype.twice2D
, and ECPointFp.prototype.multiply2D
getCurve()
to getECParams()
to alleviate confusion:New way:
var ecurve = require('ecurve')
var ecparams = ecurve.getECParams('secp256k1')
ecparams
[names.js] object methods getN()
, getH()
, getG()
, and getCurve()
to properties n
, h
, g
, curve
. This isn't
Java. JavaScript has excellent property support through Object.defineProperty
.ECCurveFp
methods getQ()
, getA()
, and getB()
to properties. See justfication in previous change. ecurve-names
into this moduleECFieldElementFp
to field-element.js
ECPointFp
to point.js
ECCurveFp
to curve.js
to
bigi@^1.1.0`decodeFrom
works with compressed keys, #8ECPointFp.decodeFrom
was incorrectly moved to ECPointFp.prototype
bigi