diff options
author | Determinant <tederminant@gmail.com> | 2020-08-16 02:31:31 -0400 |
---|---|---|
committer | Determinant <tederminant@gmail.com> | 2020-08-16 02:31:31 -0400 |
commit | 05da4603fb8155f89fc24dcebf880938a0394e85 (patch) | |
tree | 941ef65de10a94485cef3b98a92298d69524aa2a | |
parent | 17390b9905330a05ff68998f690d7d7a1bcf29d8 (diff) |
freeze the dependencies
82 files changed, 28384 insertions, 3 deletions
@@ -2,6 +2,6 @@ keytree ======= - CD into the cloned repo -- Install the deps: ``pip3 --user install .`` -- Derive 10 keys from the given mnemonic: ``keytree.py --end-idx 10`` -- Generate a new mnemonic and derive 10 keys from it: ``keytree.py --end-idx 10 --gen-mnemonic`` +- Derive 10 keys from the given mnemonic: ``./keytree.py --end-idx 10`` +- Generate a new mnemonic and derive 10 keys from it: ``./keytree.py --end-idx 10 --gen-mnemonic`` +- Caveat: if you instead do a normal pip install and use ``keytree.py``, it will use the latest deps fetched by pip. diff --git a/freezed_deps/_pysha3.cpython-38-x86_64-linux-gnu.so b/freezed_deps/_pysha3.cpython-38-x86_64-linux-gnu.so Binary files differnew file mode 100755 index 0000000..0d09638 --- /dev/null +++ b/freezed_deps/_pysha3.cpython-38-x86_64-linux-gnu.so diff --git a/freezed_deps/base58-2.0.1.dist-info/COPYING b/freezed_deps/base58-2.0.1.dist-info/COPYING new file mode 100644 index 0000000..342bd62 --- /dev/null +++ b/freezed_deps/base58-2.0.1.dist-info/COPYING @@ -0,0 +1,19 @@ +Copyright (c) 2015 David Keijser + +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. diff --git a/freezed_deps/base58-2.0.1.dist-info/INSTALLER b/freezed_deps/base58-2.0.1.dist-info/INSTALLER new file mode 100644 index 0000000..a1b589e --- /dev/null +++ b/freezed_deps/base58-2.0.1.dist-info/INSTALLER @@ -0,0 +1 @@ +pip diff --git a/freezed_deps/base58-2.0.1.dist-info/METADATA b/freezed_deps/base58-2.0.1.dist-info/METADATA new file mode 100644 index 0000000..22a37ad --- /dev/null +++ b/freezed_deps/base58-2.0.1.dist-info/METADATA @@ -0,0 +1,20 @@ +Metadata-Version: 2.1 +Name: base58 +Version: 2.0.1 +Summary: Base58 and Base58Check implementation +Home-page: https://github.com/keis/base58 +Author: David Keijser +Author-email: keijser@gmail.com +License: MIT +Platform: UNKNOWN +Classifier: Development Status :: 5 - Production/Stable +Classifier: Intended Audience :: Developers +Classifier: Natural Language :: English +Classifier: License :: OSI Approved :: MIT License +Classifier: Programming Language :: Python +Classifier: Programming Language :: Python :: 3 +Requires-Python: >=3.5 + +UNKNOWN + + diff --git a/freezed_deps/base58-2.0.1.dist-info/RECORD b/freezed_deps/base58-2.0.1.dist-info/RECORD new file mode 100644 index 0000000..d20c1c2 --- /dev/null +++ b/freezed_deps/base58-2.0.1.dist-info/RECORD @@ -0,0 +1,13 @@ +../../bin/base58,sha256=WWCKVkDRfe64OQtfsxf-b0PQGIclDIn84xO8gkjjWcY,213
+base58-2.0.1.dist-info/COPYING,sha256=z0aU8EC3oxzY7D280LWDpgHA1MN94Ba-eqCgbjpqOlQ,1057
+base58-2.0.1.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
+base58-2.0.1.dist-info/METADATA,sha256=r4yScmUS3A8Yx7mmsSyaqfMSINg6FAIQK2ocWJO1tJw,540
+base58-2.0.1.dist-info/RECORD,,
+base58-2.0.1.dist-info/WHEEL,sha256=p46_5Uhzqz6AzeSosiOnxK-zmFja1i22CrQCjmYe8ec,92
+base58-2.0.1.dist-info/entry_points.txt,sha256=7WwcggBSeBwcC22-LkpqMOCaPdey0nOG3QEaKok403Y,49
+base58-2.0.1.dist-info/top_level.txt,sha256=BVSonMPECDcX_2XqQ7iILRqitlshZNNEmLCEWlpvUvI,7
+base58/__init__.py,sha256=ccX9CZMek4UC0edA_cHs71MgC4YqJCPBhvycuzhbucc,3085
+base58/__main__.py,sha256=OiE3DXq4vwYyAVYC3SM9Y0AQbMuS2IA0v2mvzwv96pk,1080
+base58/__pycache__/__init__.cpython-38.pyc,,
+base58/__pycache__/__main__.cpython-38.pyc,,
+base58/py.typed,sha256=dcrsqJrcYfTX-ckLFJMTaj6mD8aDe2u0tkQG-ZYxnEg,26
diff --git a/freezed_deps/base58-2.0.1.dist-info/WHEEL b/freezed_deps/base58-2.0.1.dist-info/WHEEL new file mode 100644 index 0000000..3b5c403 --- /dev/null +++ b/freezed_deps/base58-2.0.1.dist-info/WHEEL @@ -0,0 +1,5 @@ +Wheel-Version: 1.0 +Generator: bdist_wheel (0.33.6) +Root-Is-Purelib: true +Tag: py3-none-any + diff --git a/freezed_deps/base58-2.0.1.dist-info/entry_points.txt b/freezed_deps/base58-2.0.1.dist-info/entry_points.txt new file mode 100644 index 0000000..dc6d6a2 --- /dev/null +++ b/freezed_deps/base58-2.0.1.dist-info/entry_points.txt @@ -0,0 +1,3 @@ +[console_scripts] +base58 = base58.__main__:main + diff --git a/freezed_deps/base58-2.0.1.dist-info/top_level.txt b/freezed_deps/base58-2.0.1.dist-info/top_level.txt new file mode 100644 index 0000000..b4c9d71 --- /dev/null +++ b/freezed_deps/base58-2.0.1.dist-info/top_level.txt @@ -0,0 +1 @@ +base58 diff --git a/freezed_deps/base58/__init__.py b/freezed_deps/base58/__init__.py new file mode 100644 index 0000000..ff2fa18 --- /dev/null +++ b/freezed_deps/base58/__init__.py @@ -0,0 +1,130 @@ +'''Base58 encoding + +Implementations of Base58 and Base58Check encodings that are compatible +with the bitcoin network. +''' + +# This module is based upon base58 snippets found scattered over many bitcoin +# tools written in python. From what I gather the original source is from a +# forum post by Gavin Andresen, so direct your praise to him. +# This module adds shiny packaging and support for python3. + +from hashlib import sha256 +from typing import Union + +__version__ = '2.0.1' + +# 58 character alphabet used +BITCOIN_ALPHABET = \ + b'123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz' +RIPPLE_ALPHABET = b'rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz' + +# Retro compatibility +alphabet = BITCOIN_ALPHABET + + +def scrub_input(v: Union[str, bytes]) -> bytes: + if isinstance(v, str): + v = v.encode('ascii') + + return v + + +def b58encode_int( + i: int, default_one: bool = True, alphabet: bytes = BITCOIN_ALPHABET +) -> bytes: + """ + Encode an integer using Base58 + """ + if not i and default_one: + return alphabet[0:1] + string = b"" + while i: + i, idx = divmod(i, 58) + string = alphabet[idx:idx+1] + string + return string + + +def b58encode( + v: Union[str, bytes], alphabet: bytes = BITCOIN_ALPHABET +) -> bytes: + """ + Encode a string using Base58 + """ + v = scrub_input(v) + + nPad = len(v) + v = v.lstrip(b'\0') + nPad -= len(v) + + p, acc = 1, 0 + for c in reversed(v): + acc += p * c + p = p << 8 + result = b58encode_int(acc, default_one=False, alphabet=alphabet) + return alphabet[0:1] * nPad + result + + +def b58decode_int( + v: Union[str, bytes], alphabet: bytes = BITCOIN_ALPHABET +) -> int: + """ + Decode a Base58 encoded string as an integer + """ + v = v.rstrip() + v = scrub_input(v) + + decimal = 0 + for char in v: + decimal = decimal * 58 + alphabet.index(char) + return decimal + + +def b58decode( + v: Union[str, bytes], alphabet: bytes = BITCOIN_ALPHABET +) -> bytes: + """ + Decode a Base58 encoded string + """ + v = v.rstrip() + v = scrub_input(v) + + origlen = len(v) + v = v.lstrip(alphabet[0:1]) + newlen = len(v) + + acc = b58decode_int(v, alphabet=alphabet) + + result = [] + while acc > 0: + acc, mod = divmod(acc, 256) + result.append(mod) + + return b'\0' * (origlen - newlen) + bytes(reversed(result)) + + +def b58encode_check( + v: Union[str, bytes], alphabet: bytes = BITCOIN_ALPHABET +) -> bytes: + """ + Encode a string using Base58 with a 4 character checksum + """ + v = scrub_input(v) + + digest = sha256(sha256(v).digest()).digest() + return b58encode(v + digest[:4], alphabet=alphabet) + + +def b58decode_check( + v: Union[str, bytes], alphabet: bytes = BITCOIN_ALPHABET +) -> bytes: + '''Decode and verify the checksum of a Base58 encoded string''' + + result = b58decode(v, alphabet=alphabet) + result, check = result[:-4], result[-4:] + digest = sha256(sha256(result).digest()).digest() + + if check != digest[:4]: + raise ValueError("Invalid checksum") + + return result diff --git a/freezed_deps/base58/__main__.py b/freezed_deps/base58/__main__.py new file mode 100644 index 0000000..b76fdad --- /dev/null +++ b/freezed_deps/base58/__main__.py @@ -0,0 +1,47 @@ +import argparse +import sys + +from base58 import b58decode, b58decode_check, b58encode, b58encode_check + + +def main(): + '''Base58 encode or decode FILE, or standard input, to standard output.''' + + stdout = sys.stdout.buffer + + parser = argparse.ArgumentParser(description=main.__doc__) + parser.add_argument( + 'file', + metavar='FILE', + nargs='?', + type=argparse.FileType('r'), + default='-') + parser.add_argument( + '-d', '--decode', + action='store_true', + help='decode data') + parser.add_argument( + '-c', '--check', + action='store_true', + help='append a checksum before encoding') + + args = parser.parse_args() + fun = { + (False, False): b58encode, + (False, True): b58encode_check, + (True, False): b58decode, + (True, True): b58decode_check + }[(args.decode, args.check)] + + data = args.file.buffer.read() + + try: + result = fun(data) + except Exception as e: + sys.exit(e) + + stdout.write(result) + + +if __name__ == '__main__': + main() diff --git a/freezed_deps/base58/py.typed b/freezed_deps/base58/py.typed new file mode 100644 index 0000000..e5aff4f --- /dev/null +++ b/freezed_deps/base58/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561.
\ No newline at end of file diff --git a/freezed_deps/bech32.py b/freezed_deps/bech32.py new file mode 100644 index 0000000..d450080 --- /dev/null +++ b/freezed_deps/bech32.py @@ -0,0 +1,123 @@ +# Copyright (c) 2017 Pieter Wuille +# +# 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. + +"""Reference implementation for Bech32 and segwit addresses.""" + + +CHARSET = "qpzry9x8gf2tvdw0s3jn54khce6mua7l" + + +def bech32_polymod(values): + """Internal function that computes the Bech32 checksum.""" + generator = [0x3b6a57b2, 0x26508e6d, 0x1ea119fa, 0x3d4233dd, 0x2a1462b3] + chk = 1 + for value in values: + top = chk >> 25 + chk = (chk & 0x1ffffff) << 5 ^ value + for i in range(5): + chk ^= generator[i] if ((top >> i) & 1) else 0 + return chk + + +def bech32_hrp_expand(hrp): + """Expand the HRP into values for checksum computation.""" + return [ord(x) >> 5 for x in hrp] + [0] + [ord(x) & 31 for x in hrp] + + +def bech32_verify_checksum(hrp, data): + """Verify a checksum given HRP and converted data characters.""" + return bech32_polymod(bech32_hrp_expand(hrp) + data) == 1 + + +def bech32_create_checksum(hrp, data): + """Compute the checksum values given HRP and data.""" + values = bech32_hrp_expand(hrp) + data + polymod = bech32_polymod(values + [0, 0, 0, 0, 0, 0]) ^ 1 + return [(polymod >> 5 * (5 - i)) & 31 for i in range(6)] + + +def bech32_encode(hrp, data): + """Compute a Bech32 string given HRP and data values.""" + combined = data + bech32_create_checksum(hrp, data) + return hrp + '1' + ''.join([CHARSET[d] for d in combined]) + + +def bech32_decode(bech): + """Validate a Bech32 string, and determine HRP and data.""" + if ((any(ord(x) < 33 or ord(x) > 126 for x in bech)) or + (bech.lower() != bech and bech.upper() != bech)) |