b0VIM 8.0KYC5ematiuigniter~ematiu/dev/cash-blib/lib/crypto/point.jsutf-8 3210#"! UtpY=Yad"Yk>a4 { s M =   f c .  x R B   \ X 9 $ !   a   ~{NKyvC?sL`\[QIplkjP b21#ro}; return BufferUtil.concat([prefix, xbuf]); } prefix = new Buffer([0x02]); } else { prefix = new Buffer([0x03]); if (odd) { var odd = ybuf[ybuf.length - 1] % 2; var prefix; var ybuf = point.getY().toBuffer({size: 32}); var xbuf = point.getX().toBuffer({size: 32});Point.pointToCompressed = function pointToCompressed(point) {}; return this; } throw new Error('Point times N must be infinity'); if (!(this.mul(Point.getN()).isInfinity())) { //todo: needs test case } throw new Error('Invalid y value for curve.'); if (p2.y.cmp(this.y) !== 0) { } throw new Error('Point does not lie on the curve'); } catch (e) { p2 = ecPointFromX(this.getX(), this.getY().isOdd()); try { var p2; } throw new Error('Point cannot be equal to Infinity'); if (this.isInfinity()){Point.prototype.validate = function validate() { */ * @returns {Point} An instance of the same Point * @throws {Error} A validation error if exists * @param {Point} An instance of Point * @link https://www.iacr.org/archive/pkc2003/25670211/25670211.pdf * * Will determine if the point is valid */**}; return new BN(this._getY().toArray());Point.prototype.getY = function getY() { */ * @returns {BN} A BN instance of the Y coordinate * * Will return the Y coordinate of the Poif (!Point.prototype._getY)}; return new BN(this._getX().toArray());Point.prototype.getX = function getX() { */ * @returns {BN} A BN instance of the X coordinate * * Will return the X coordinate of the Point */** Point.prototype._getX = Point.prototype.getX;if (!Point.prototype._getX)}; return new BN(ec.curve.n.toArray());Point.getN = function getN() { */ * @returns {BN} A BN instance of the number of points on the curve * @link https://en.bitcoin.it/wiki/Private_key#Range_of_valid_ECDSA_private_keys * * Will return the max of range of valid private keys as governed by the secp256k1 ECDSA standard. */**}; return ec.curve.g;Point.getG = function getG() { */ * @returns {Point} An instance of the base point. * @link https://en.bitcoin.it/wiki/Secp256k1 * * Will return a secp256k1 ECDSA base point. */**}; return point; point.validate(); } throw new Error('Invalid X'); } catch (e) { var point = ecPointFromX(x, odd); try {Point.fromX = function fromX(odd, x){ */ * @returns {Point} An instance of Point * @throws {Error} A validation error if exists * @param {BN|String} x - The X coordinate * @param {boolean} odd - If the Y coordinate is odd * * Instantiate a valid secp256k1 Point from only the X coordinate */**Point.prototype = Object.getPrototypeOf(ec.curve.point());}; return point; point.validate(); } throw new Error('Invalid Point'); } catch (e) { var point = ecPoint(x, y, isRed); try {var Point = function Point(x, y, isRed) { */ * @constructor * @returns {Point} An instance of Point * @throws {Error} A validation error if exists * @augments elliptic.curve.point * @link https://github.com/indutny/elliptic * @param {BN|String} y - The Y coordinate * @param {BN|String} x - The X coordinate * * Instantiate a valid secp256k1 Point from the X and Y coordinates. */**var ecPointFromX = ec.curve.pointFromX.bind(ec.curve);var ecPoint = ec.curve.point.bind(ec.curve);var ec = new EC('secp256k1');var EC = require('elliptic').ec;var BufferUtil = require('../util/buffer');var BN = require('./bn');'use strict';admodule.exports = Point;ad =ea8  n>  ~ } s k 2 " r B   T S E   }; return BufferUtil.concat([prefix, xbuf]); } prefix = new Buffer([0x02]); } else { prefix = new Buffer([0x03]); if (odd) { var odd = ybuf[ybuf.length - 1] % 2; var prefix; var ybuf = point.getY().toBuffer({size: 32}); var xbuf = point.getX().toBuffer({size: 32});Point.pointToCompressed = function pointToCompressed(point) {}; return this; } throw new Error('Point times N must be infinity'); if (!(this.mul(Point.getN()).isInfinity())) { //todo: needs test case } throw new Error('Invalid y value for curve.'); if (p2.y.cmp(this.y) !== 0) { } throw new Error('Point does not lie on the curve'); } catch (e) { p2 = ecPointFromX(this.getX(), this.getY().isOdd()); try { var p2; } throw new Error('Point cannot be equal to Infinity'); if (this.isInfinity()){Point.prototype.validate = function validate() { */ * @returns {Point} An instance of the same Point * @throws {Error} A validation error if exists * @param {Point} An instance of Point * @link https://www.iacr.org/archive/pkc2003/25670211/25670211.pdf * * Will determine if the point is valid */**}; return new BN(this._getY().toArray());Point.prototype.getY = function getY() { */ * @returns {BN} A BN instance of the Y coordinate * * Will return the Y coordinate of the Point */** Point.prototype._getY = Point.prototype.getY;