Auto pushed

This commit is contained in:
nannal
2020-01-25 14:05:59 +02:00
commit 7a954b3253
165 changed files with 26032 additions and 0 deletions

21
node_modules/bip66/LICENSE generated vendored Executable file
View File

@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2015 Daniel Cousens
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

40
node_modules/bip66/README.md generated vendored Executable file
View File

@@ -0,0 +1,40 @@
# bip66
[![NPM Package](https://img.shields.io/npm/v/bip66.svg?style=flat-square)](https://www.npmjs.org/package/bip66)
[![Build Status](https://img.shields.io/travis/bitcoinjs/bip66.svg?branch=master&style=flat-square)](https://travis-ci.org/bitcoinjs/bip66)
[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard)
Strict DER signature encoding/decoding.
See [bip66](https://github.com/bitcoin/bips/blob/master/bip-0066.mediawiki).
- This module **works only with [two's complement](https://en.wikipedia.org/wiki/Two's_complement) numbers**.
- BIP66 doesn't check that `r` or `s` are fully valid.
- `check`/`decode` doesn't check that `r` or `s` great than 33 bytes or that this number represent valid point on elliptic curve.
- `encode` doesn't check that `r`/`s` represent valid point on elliptic curve.
## Example
``` javascript
var bip66 = require('bip66')
var r = new Buffer('1ea1fdff81b3a271659df4aad19bc4ef83def389131a36358fe64b245632e777', 'hex')
var s = new Buffer('29e164658be9ce810921bf81d6b86694785a79ea1e52dbfa5105148d1f0bc1', 'hex')
bip66.encode(r, s)
// Buffer <30 43 02 20 1e a1 fd ff 81 b3 a2 71 65 9d f4 aa d1 9b c4 ef 83 de f3 89 13 1a 36 35 8f e6 4b 24 56 32 e7 77 02 1f 29 e1 64 65 8b e9 ce 81 09 21 bf 81 d6 b8 66 94 78 5a 79 ea 1e 52 db fa 51 05 14 8d 1f 0b c1>
var signature = new Buffer('304302201ea1fdff81b3a271659df4aad19bc4ef83def389131a36358fe64b245632e777021f29e164658be9ce810921bf81d6b86694785a79ea1e52dbfa5105148d1f0bc1', 'hex')
bip66.decode(signature)
// => {
// r: Buffer <1e a1 fd ff 81 b3 a2 71 65 9d f4 aa d1 9b c4 ef 83 de f3 89 13 1a 36 35 8f e6 4b 24 56 32 e7 77>,
// s: Buffer <29 e1 64 65 8b e9 ce 81 09 21 bf 81 d6 b8 66 94 78 5a 79 ea 1e 52 db fa 51 05 14 8d 1f 0b c1>
// }
```
A catch-all exception regex:
``` javascript
/Expected DER (integer|sequence)|(R|S) value (excessively padded|is negative)|(R|S|DER sequence) length is (zero|too short|too long|invalid)/
```
## LICENSE [MIT](LICENSE)

113
node_modules/bip66/index.js generated vendored Executable file
View File

@@ -0,0 +1,113 @@
// Reference https://github.com/bitcoin/bips/blob/master/bip-0066.mediawiki
// Format: 0x30 [total-length] 0x02 [R-length] [R] 0x02 [S-length] [S]
// NOTE: SIGHASH byte ignored AND restricted, truncate before use
var Buffer = require('safe-buffer').Buffer
function check (buffer) {
if (buffer.length < 8) return false
if (buffer.length > 72) return false
if (buffer[0] !== 0x30) return false
if (buffer[1] !== buffer.length - 2) return false
if (buffer[2] !== 0x02) return false
var lenR = buffer[3]
if (lenR === 0) return false
if (5 + lenR >= buffer.length) return false
if (buffer[4 + lenR] !== 0x02) return false
var lenS = buffer[5 + lenR]
if (lenS === 0) return false
if ((6 + lenR + lenS) !== buffer.length) return false
if (buffer[4] & 0x80) return false
if (lenR > 1 && (buffer[4] === 0x00) && !(buffer[5] & 0x80)) return false
if (buffer[lenR + 6] & 0x80) return false
if (lenS > 1 && (buffer[lenR + 6] === 0x00) && !(buffer[lenR + 7] & 0x80)) return false
return true
}
function decode (buffer) {
if (buffer.length < 8) throw new Error('DER sequence length is too short')
if (buffer.length > 72) throw new Error('DER sequence length is too long')
if (buffer[0] !== 0x30) throw new Error('Expected DER sequence')
if (buffer[1] !== buffer.length - 2) throw new Error('DER sequence length is invalid')
if (buffer[2] !== 0x02) throw new Error('Expected DER integer')
var lenR = buffer[3]
if (lenR === 0) throw new Error('R length is zero')
if (5 + lenR >= buffer.length) throw new Error('R length is too long')
if (buffer[4 + lenR] !== 0x02) throw new Error('Expected DER integer (2)')
var lenS = buffer[5 + lenR]
if (lenS === 0) throw new Error('S length is zero')
if ((6 + lenR + lenS) !== buffer.length) throw new Error('S length is invalid')
if (buffer[4] & 0x80) throw new Error('R value is negative')
if (lenR > 1 && (buffer[4] === 0x00) && !(buffer[5] & 0x80)) throw new Error('R value excessively padded')
if (buffer[lenR + 6] & 0x80) throw new Error('S value is negative')
if (lenS > 1 && (buffer[lenR + 6] === 0x00) && !(buffer[lenR + 7] & 0x80)) throw new Error('S value excessively padded')
// non-BIP66 - extract R, S values
return {
r: buffer.slice(4, 4 + lenR),
s: buffer.slice(6 + lenR)
}
}
/*
* Expects r and s to be positive DER integers.
*
* The DER format uses the most significant bit as a sign bit (& 0x80).
* If the significant bit is set AND the integer is positive, a 0x00 is prepended.
*
* Examples:
*
* 0 => 0x00
* 1 => 0x01
* -1 => 0xff
* 127 => 0x7f
* -127 => 0x81
* 128 => 0x0080
* -128 => 0x80
* 255 => 0x00ff
* -255 => 0xff01
* 16300 => 0x3fac
* -16300 => 0xc054
* 62300 => 0x00f35c
* -62300 => 0xff0ca4
*/
function encode (r, s) {
var lenR = r.length
var lenS = s.length
if (lenR === 0) throw new Error('R length is zero')
if (lenS === 0) throw new Error('S length is zero')
if (lenR > 33) throw new Error('R length is too long')
if (lenS > 33) throw new Error('S length is too long')
if (r[0] & 0x80) throw new Error('R value is negative')
if (s[0] & 0x80) throw new Error('S value is negative')
if (lenR > 1 && (r[0] === 0x00) && !(r[1] & 0x80)) throw new Error('R value excessively padded')
if (lenS > 1 && (s[0] === 0x00) && !(s[1] & 0x80)) throw new Error('S value excessively padded')
var signature = Buffer.allocUnsafe(6 + lenR + lenS)
// 0x30 [total-length] 0x02 [R-length] [R] 0x02 [S-length] [S]
signature[0] = 0x30
signature[1] = signature.length - 2
signature[2] = 0x02
signature[3] = r.length
r.copy(signature, 4)
signature[4 + lenR] = 0x02
signature[5 + lenR] = s.length
s.copy(signature, 6 + lenR)
return signature
}
module.exports = {
check: check,
decode: decode,
encode: encode
}

64
node_modules/bip66/package.json generated vendored Executable file
View File

@@ -0,0 +1,64 @@
{
"_from": "bip66@^1.1.3",
"_id": "bip66@1.1.5",
"_inBundle": false,
"_integrity": "sha1-AfqHSHhcpwlV1QESF9GzE5lpyiI=",
"_location": "/bip66",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "bip66@^1.1.3",
"name": "bip66",
"escapedName": "bip66",
"rawSpec": "^1.1.3",
"saveSpec": null,
"fetchSpec": "^1.1.3"
},
"_requiredBy": [
"/secp256k1"
],
"_resolved": "https://registry.npmjs.org/bip66/-/bip66-1.1.5.tgz",
"_shasum": "01fa8748785ca70955d5011217d1b3139969ca22",
"_spec": "bip66@^1.1.3",
"_where": "/filestore/dev/avanity/node_modules/secp256k1",
"author": {
"name": "Daniel Cousens"
},
"bugs": {
"url": "https://github.com/bitcoinjs/bip66/issues"
},
"bundleDependencies": false,
"dependencies": {
"safe-buffer": "^5.0.1"
},
"deprecated": false,
"description": "Strict DER signature encoding/decoding.",
"devDependencies": {
"nyc": "^6.4.0",
"standard": "^10.0.2",
"tape": "^4.5.1"
},
"files": [
"index.js"
],
"homepage": "https://github.com/bitcoinjs/bip66",
"keywords": [
"bip66",
"bitcoin"
],
"license": "MIT",
"main": "index.js",
"name": "bip66",
"repository": {
"type": "git",
"url": "git+https://github.com/bitcoinjs/bip66.git"
},
"scripts": {
"coverage": "nyc --check-coverage --branches 100 --functions 100 tape test/*.js",
"lint": "standard",
"test": "npm run lint && npm run unit",
"unit": "tape test/*.js"
},
"version": "1.1.5"
}