{"name":"tiny-secp256k1","version":"0.0.0-rc-1560324438","description":"A tiny secp256k1 native/JS wrapper","main":"index.js","gypfile":true,"engines":{"node":">=6.0.0"},"scripts":{"build":"node-gyp rebuild","install":"npm run build || echo \"secp256k1 bindings compilation fail. Pure JS implementation will be used.\"","unit":"tape tests/index.js | tap-difflet -p","test-browser":"browserify tests/index.js > tests/bundle.js","test":"npm run unit"},"repository":{"type":"git","url":"git+https://github.com/bitcoinjs/tiny-secp256k1.git"},"author":"","license":"MIT","bugs":{"url":"https://github.com/bitcoinjs/tiny-secp256k1/issues"},"homepage":"https://github.com/bitcoinjs/tiny-secp256k1#readme","dependencies":{"bindings":"^1.3.0","bn.js":"^4.11.8","create-hmac":"^1.1.7","elliptic":"^6.4.0","nan":"^2.13.2"},"devDependencies":{"browserify":"^16.2.2","tap-difflet":"^0.7.1","tape":"^4.9.0"},"browser":{"./index.js":"./js.js"},"readme":"# tiny-secp256k1\n[![Build Status](https://travis-ci.org/bitcoinjs/tiny-secp256k1.png?branch=master)](https://travis-ci.org/bitcoinjs/tiny-secp256k1)\n[![NPM](https://img.shields.io/npm/v/tiny-secp256k1.svg)](https://www.npmjs.org/package/tiny-secp256k1)\n[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard)\n\nThis library is under development,  and,  like the [secp256k1](https://github.com/bitcoin-core/secp256k1) C library it depends on,  this is a research effort to determine an optimal API for end-users of the bitcoinjs ecosystem.\n\n## Installation\n\n### npm\n\n``` bash\nnpm install tiny-secp256k1\n```\n\n### yarn\n\n```bash\nyarn add tiny-secp256k1\n```\n\nIf you are having problems,  please read the guide at [secp256k1-node](https://github.com/cryptocoinjs/secp256k1-node#installation),  as the build instructions should be exactly the same (and this module is a direct derivation).\n\n\n## Documentation\n\n### isPoint (A)\n``` haskell\nisPoint :: Buffer -> Bool\n```\nReturns `false` if\n* `A` is not encoded with a sequence tag of `0x02`, `0x03` or `0x04`\n* `A.x` is not in `[1...p - 1]`\n* `A.y` is not in `[1...p - 1]`\n\n\n### isPointCompressed (A)\n``` haskell\nisPointCompressed :: Buffer -> Bool\n```\nReturns `false` if the signature is **not** compressed.\n\n\n### isPrivate (d)\n``` haskell\nisPrivate :: Buffer -> Bool\n```\nReturns `false` if\n* `d` is not 256-bit, or\n* `d` is not in `[1..order - 1]`\n\n\n### pointAdd (A, B[, compressed])\n``` haskell\npointAdd :: Buffer -> Buffer [-> Bool] -> Maybe Buffer\n```\nReturns `null` if result is at infinity.\n\n##### Throws:\n* `Expected Point` if `!isPoint(A)`\n* `Expected Point` if `!isPoint(B)`\n\n\n### pointAddScalar (A, tweak[, compressed])\n``` haskell\npointAddScalar :: Buffer -> Buffer [-> Bool] -> Maybe Buffer\n```\nReturns `null` if result is at infinity.\n\n##### Throws:\n* `Expected Point` if `!isPoint(A)`\n* `Expected Tweak` if `tweak` is not in `[0...order - 1]`\n\n\n### pointCompress (A, compressed)\n``` haskell\npointCompress :: Buffer -> Bool -> Buffer\n```\n\n##### Throws:\n* `Expected Point` if `!isPoint(A)`\n\n\n### pointFromScalar (d[, compressed])\n``` haskell\npointFromScalar :: Buffer [-> Bool] -> Maybe Buffer\n```\nReturns `null` if result is at infinity.\n\n##### Throws:\n* `Expected Private` if `!isPrivate(d)`\n\n\n### pointMultiply (A, tweak[, compressed])\n``` haskell\npointMultiply :: Buffer -> Buffer [-> Bool] -> Maybe Buffer\n```\nReturns `null` if result is at infinity.\n\n##### Throws:\n* `Expected Point` if `!isPoint(A)`\n* `Expected Tweak` if `tweak` is not in `[0...order - 1]`\n\n\n### privateAdd (d, tweak)\n``` haskell\nprivateAdd :: Buffer -> Buffer -> Maybe Buffer\n```\nReturns `null` if result is equal to `0`.\n\n##### Throws:\n* `Expected Private` if `!isPrivate(d)`\n* `Expected Tweak` if `tweak` is not in `[0...order - 1]`\n\n\n### privateSub (d, tweak)\n``` haskell\nprivateSub :: Buffer -> Buffer -> Maybe Buffer\n```\nReturns `null` if result is equal to `0`.\n\n##### Throws:\n* `Expected Private` if `!isPrivate(d)`\n* `Expected Tweak` if `tweak` is not in `[0...order - 1]`\n\n\n### sign (h, d)\n``` haskell\nsign :: Buffer -> Buffer -> Buffer\n```\nReturns normalized signatures, each of (r, s) values are guaranteed to less than `order / 2`.\nUses RFC6979.\n\n##### Throws:\n* `Expected Private` if `!isPrivate(d)`\n* `Expected Scalar` if `h` is not 256-bit\n\n\n### signWithEntropy (h, d, e)\n``` haskell\nsign :: Buffer -> Buffer -> Buffer -> Buffer\n```\nReturns normalized signatures, each of (r, s) values are guaranteed to less than `order / 2`.\nUses RFC6979.\nAdds `e` as Added Entropy to the deterministic k generation.\n\n##### Throws:\n* `Expected Private` if `!isPrivate(d)`\n* `Expected Scalar` if `h` is not 256-bit\n* `Expected Extra Data (32 bytes)` if `e` is not 256-bit\n\n\n### verify (h, Q, signature[, strict = false])\n``` haskell\nverify :: Buffer -> Buffer -> Buffer -> Bool\n```\nReturns `false` if any of (r, s) values are equal to `0`,  or if the signature is rejected.\n\nIf `strict` is `true`, valid signatures with any of (r, s) values greater than `order / 2` are rejected.\n\n##### Throws:\n* `Expected Point` if `!isPoint(Q)`\n* `Expected Signature` if `signature` has any (r, s) values not in range `[0...order - 1]`\n* `Expected Scalar` if `h` is not 256-bit\n\n---\n\n## Credit\nThis is a partially derived work of https://github.com/cryptocoinjs/secp256k1-node, specifically [this commit](https://github.com/bitcoinjs/tiny-secp256k1/commit/03a1d0ab5d61dc05ab42a7e884cf37d628a10724).\n\nThis library uses the native library [secp256k1](https://github.com/bitcoin-core/secp256k1) by the bitcoin-core developers,  including derivatives of its tests and test vectors.\n\n\n# LICENSE [MIT](LICENSE)\n","readmeFilename":"README.md","gitHead":"3fdd7bac99df70d170422a3d66d5dfa9210ea9fa","_id":"tiny-secp256k1@0.0.0-rc-1560324438","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-qyNWLPk/vJJUVZHlHioO+0B/CMkAYFh/uAaWtVSmd4VxSUoAmRxBhWGQZNjWFZg8KA+xYNaBR0Hh97YVevGFFg==","shasum":"6fab7492c31b17f1d68efc0c292af743272ff264","tarball":"http://registry-npm.ywwl.com/tiny-secp256k1/download/tiny-secp256k1-0.0.0-rc-1560324438.tgz","fileCount":105,"unpackedSize":865900,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdAKnYCRA9TVsSAnZWagAAtP8QAIb5RZCawgAuFEwZ/w3k\nN0L1PfOSb9gdK3aaSwDNojQmUyrV5/FINCvnSsf8miiCzhFA+fZ9e6kNANxN\ncAXhQbN7pmguGpz/ELYeyTOEfD1eWTJPW8hmMd+nN/8Kcrv4QOY1LZwNeZ8x\nKpRC47DrKZmlj/WcOVUe57ObamkD03wAnC4gVZCZ4aukuOMJ45MSPv9UjYRx\ncV9LjsUY8G/JW6jC4M+2oWgc0m3ZWTna89MTioItui+aSc7xgO8W7D7aZ1MW\n6urpE6UZKQnvkiHjz334Qy77ZT4FeDtdHATizKFUsZ3RHWD4DDXXzYSCQnxr\nE3r9SvgAmbZ/k+rI+fHh2owJgbkhCDaGVv627p6VguUIr2cXn3GB36sPFf1p\n/fV9NMSoZ3ij+AfAr+hKcL0XkxakR2qZFQOORztiwClnaf040cBgCikfK6CW\nIsRf2dSJaL/J3awDsXrG9dYlTQXDV8C0aFOzgO0qwlLTh5V7AjJy2mGgIact\nWcpjziAdg+SBtPoaXiunCd3bYXWjf1L86oqOXC1tLlL/3MhFICd8KCOujKXv\nykMx8RhInp73odxGkbElShDJlpKmTtnlqW+NQovso/HtwUi8bYFlsBaJ016A\nkPQeUWvSL+2SY8t5OrFEvG7SZQmWnAf8F4a86Sysp+MO+bKwjT+PQ7lUCdJg\n8QvV\r\n=CQvw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBJZ6sNaTXYlA4yPA9GTJWkeKIgZn7pSkY3BNPJtvxxKAiEAmIND2ludu/0wd0kHtJn0TzhC8gzLZelZMEtugdNVZms="}],"size":166335,"noattachment":false,"key":"/tiny-secp256k1/-/tiny-secp256k1-0.0.0-rc-1560324438.tgz"},"maintainers":[{"email":"jprichardson@gmail.com","name":"jprichardson"},{"email":"junderwood@bitcoinbank.co.jp","name":"junderw"}],"_npmUser":{"name":"junderw","email":"junderwood@bitcoinbank.co.jp"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tiny-secp256k1_0.0.0-rc-1560324438_1560324567489_0.3402357992374716"},"_hasShrinkwrap":false,"publish_time":1560324567713,"_cnpm_publish_time":1560324567713,"dist-tags":{"latest":"2.2.5","test":"0.0.0-rc-1560324438"}}