Skip to content

Instantly share code, notes, and snippets.

View bjarnemagnussen's full-sized avatar

Bjarne Magnussen bjarnemagnussen

View GitHub Profile

Keybase proof

I hereby claim:

  • I am bjarnemagnussen on github.
  • I am bjarnemagnussen (https://keybase.io/bjarnemagnussen) on keybase.
  • I have a public key ASCnqd5RXOj2Cj5g34EFQM93lJ_R0moc1s7oDyrf_JyaSAo

To claim this, I am signing this object:

#
# Based on bip32utils by Corgan Labs
# Reimplemented using the library coincurve in bit
#
import os
from binascii import b2a_hex
from . import base58
from hashlib import new, sha256 as _sha256, sha512 as _sha512
import hmac as _hmac
from coincurve import PrivateKey as ECPrivateKey, PublicKey as ECPublicKey
def sha256(bytestr):
return _sha256(bytestr).digest()
from collections import namedtuple
FIELD_SIZE = 0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f
GROUP_ORDER = 0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141
TONELLI_SHANKS_CONSTANT = (FIELD_SIZE + 1) // 4
BASE_POINT_PARAMETERS = (
0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798,
0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8
)