{"_id":"@asoltys/tiny-secp256k1","_rev":"1-ff98f688ac363902e3cc7e3dff18f698","name":"@asoltys/tiny-secp256k1","dist-tags":{"latest":"1.1.7"},"versions":{"1.1.7":{"name":"@asoltys/tiny-secp256k1","version":"1.1.7","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","@asoltys/elliptic":"^6.4.1","nan":"^2.13.2"},"devDependencies":{"browserify":"^16.2.2","tap-difflet":"^0.7.2","tape":"^4.9.0"},"browser":{"./index.js":"./js.js"},"gitHead":"42a06daa6687772f280638e7d166bd72e9d516dc","_id":"@asoltys/tiny-secp256k1@1.1.7","_nodeVersion":"12.16.1","_npmVersion":"6.14.7","dist":{"integrity":"sha512-NIfBbu9FDjNZgfNToBmAPOcK1AUt5CxVzuD/z3zNgx98Xx1WJ1Qx6PiWPnB2kRDg+uzTSeQa3tYKUKb/AGh0Ew==","shasum":"95909c7922a23cbf05cad738add605f06e15c417","tarball":"https://registry.npmjs.org/@asoltys/tiny-secp256k1/-/tiny-secp256k1-1.1.7.tgz","fileCount":19,"unpackedSize":67264,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfzHryCRA9TVsSAnZWagAAf2gP/iKcyqrU3JCGlIEVSOYo\n/tSfR6qXS1xSB7wJd9V7N5F75J2jU3HSNR0vr0h5AKRLEC3hnpUY81/YZAy7\nf5GinQ/wcrAXjtdxrb3RPeASLbtD5Nl1ew8DhkhjC73EzjPeshuxPCNYIXaC\ndkhlJ6TGGknPV7Kdq5VIueaKR/linPrMXwHrbpXhm7/grpHQwILncchjmL+o\ntBUwb/0b6BP08Dcn4ODBoAxdD6gtYVevfXYsyduEgxlCTws7lyYhHwPcZhVc\nNIgbfl+4Xs1uBB8yiK6iIOXdzWpWX1x5JlP1417goWJyK/Qpor8W5k2533dC\naAP/GVvXMVKdCs3AxR2k9yzZvaZZJmLdHAzpHCUaEDRmRfDJoYcJRO1+eX6I\n+DEElNynwGEbcKQgnPYvjOuTbncwfT15wMInNH/Whjah7D4WWIaIkWkiRoWs\nUs5cLxikEcS/2iA0n10eRhNr8PkOv825ji2iIOrQTtbH5xF33OMyCuYyZCNg\nkv+KcqWDbepbevLiaLm/N5MycE0kCcSeLiKg57pUWcOVVr1MKwQd57TCzoHM\nQ2i68m5vx9WiJLpxXGOLuQT6Weq7dCYIp+mvUgcwvGNC1oOv/ep0VmVsdNqW\nw3zFIsa/cwn+lP2b5WrK8+tdjWsJ7rpPCHeS83J6S8HEMaTx1draZZs3Pzf1\nAQp/\r\n=Fi0N\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD0rChRyJ9+Lo/nTxGUTVMIDum8JMkWxxS2Mr9Lnom64QIgWjJj76tR9eCvj0YtSo71ZSm7KMNsBG3G//ha8TKX+Zs="}]},"_npmUser":{"name":"asoltys","email":"asoltys@gmail.com"},"directories":{},"maintainers":[{"name":"asoltys","email":"asoltys@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tiny-secp256k1_1.1.7_1607236337768_0.20738912156426292"},"_hasShrinkwrap":false}},"time":{"created":"2020-12-06T06:32:17.732Z","1.1.7":"2020-12-06T06:32:17.950Z","modified":"2022-04-04T15:48:09.568Z"},"maintainers":[{"name":"asoltys","email":"asoltys@gmail.com"}],"description":"A tiny secp256k1 native/JS wrapper","homepage":"https://github.com/bitcoinjs/tiny-secp256k1#readme","repository":{"type":"git","url":"git+https://github.com/bitcoinjs/tiny-secp256k1.git"},"bugs":{"url":"https://github.com/bitcoinjs/tiny-secp256k1/issues"},"license":"MIT","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"}