cryptnoxpy.cryptos package

Submodules

cryptnoxpy.cryptos.main module

Module containing core cryptographic functions for Cryptnox cards.

Provides elliptic curve cryptography (secp256k1), key generation, digital signatures, and cryptocurrency address generation.

cryptnoxpy.cryptos.main.change_curve(p, n, a, b, gx, gy)[source]
cryptnoxpy.cryptos.main.getG()[source]
cryptnoxpy.cryptos.main.inv(a, n)[source]
cryptnoxpy.cryptos.main.access(obj, prop)[source]
cryptnoxpy.cryptos.main.multiaccess(obj, prop)[source]
cryptnoxpy.cryptos.main.slice(obj, start=0, end=1606938044258990275541962092341162602522202993782792835301376)[source]
cryptnoxpy.cryptos.main.count(obj)[source]
cryptnoxpy.cryptos.main.sum(obj)[source]
cryptnoxpy.cryptos.main.isinf(p)[source]
cryptnoxpy.cryptos.main.to_jacobian(p)[source]
cryptnoxpy.cryptos.main.jacobian_double(p)[source]
cryptnoxpy.cryptos.main.jacobian_add(p, q)[source]
cryptnoxpy.cryptos.main.fast_add(a, b)[source]
cryptnoxpy.cryptos.main.get_pubkey_format(pub)[source]
cryptnoxpy.cryptos.main.encode_pubkey(pub, formt)[source]
cryptnoxpy.cryptos.main.decode_pubkey(pub, formt=None)[source]
cryptnoxpy.cryptos.main.get_privkey_format(priv)[source]
cryptnoxpy.cryptos.main.encode_privkey(priv, formt, vbyte=128)[source]
cryptnoxpy.cryptos.main.decode_privkey(priv, formt=None)[source]
cryptnoxpy.cryptos.main.add_pubkeys(p1, p2)[source]
cryptnoxpy.cryptos.main.add_privkeys(p1, p2)[source]
cryptnoxpy.cryptos.main.divide(pubkey, privkey)[source]
cryptnoxpy.cryptos.main.compress(pubkey)[source]
cryptnoxpy.cryptos.main.decompress(pubkey)[source]
cryptnoxpy.cryptos.main.neg_pubkey(pubkey)[source]
cryptnoxpy.cryptos.main.neg_privkey(privkey)[source]
cryptnoxpy.cryptos.main.subtract_pubkeys(p1, p2)[source]
cryptnoxpy.cryptos.main.subtract_privkeys(p1, p2)[source]
cryptnoxpy.cryptos.main.bin_hash160(string)[source]
cryptnoxpy.cryptos.main.hash160(string)[source]
cryptnoxpy.cryptos.main.hex_to_hash160(s_hex)[source]
cryptnoxpy.cryptos.main.bin_sha256(string)[source]
cryptnoxpy.cryptos.main.sha256(string)[source]
cryptnoxpy.cryptos.main.bin_ripemd160(string)[source]
cryptnoxpy.cryptos.main.ripemd160(string)[source]
cryptnoxpy.cryptos.main.bin_dbl_sha256(s)[source]
cryptnoxpy.cryptos.main.dbl_sha256(string)[source]
cryptnoxpy.cryptos.main.bin_slowsha(string)[source]
cryptnoxpy.cryptos.main.slowsha(string)[source]
cryptnoxpy.cryptos.main.hash_to_int(x)[source]
cryptnoxpy.cryptos.main.num_to_var_int(x)[source]
cryptnoxpy.cryptos.main.electrum_sig_hash(message)[source]
cryptnoxpy.cryptos.main.b58check_to_bin(inp)[source]
cryptnoxpy.cryptos.main.get_version_byte(inp)[source]
cryptnoxpy.cryptos.main.hex_to_b58check(inp, magicbyte=0)[source]
cryptnoxpy.cryptos.main.b58check_to_hex(inp)[source]
cryptnoxpy.cryptos.main.pubkey_to_hash(pubkey)[source]
cryptnoxpy.cryptos.main.pubkey_to_hash_hex(pubkey)[source]
cryptnoxpy.cryptos.main.pubkey_to_address(pubkey, magicbyte=0)[source]
cryptnoxpy.cryptos.main.pubtoaddr(pubkey, magicbyte=0)
cryptnoxpy.cryptos.main.is_privkey(priv)[source]
cryptnoxpy.cryptos.main.is_pubkey(pubkey)[source]
cryptnoxpy.cryptos.main.encode_sig(v, r, s)[source]
cryptnoxpy.cryptos.main.decode_sig(sig)[source]
cryptnoxpy.cryptos.main.deterministic_generate_k(msghash, priv)[source]
cryptnoxpy.cryptos.main.ecdsa_verify_addr(msg, sig, addr, coin)[source]
cryptnoxpy.cryptos.main.ecdsa_verify(msg, sig, pub, coin)[source]
cryptnoxpy.cryptos.main.add(p1, p2)[source]
cryptnoxpy.cryptos.main.subtract(p1, p2)[source]
cryptnoxpy.cryptos.main.magicbyte_to_prefix(magicbyte)[source]

cryptnoxpy.cryptos.py2specials module

Module containing Python 2 compatibility utilities.

Provides type definitions, string/bytes handling, and encoding utilities for Python 2 compatibility in cryptographic operations.

cryptnoxpy.cryptos.py3specials module

Module containing Python 3 specific cryptographic implementations.

Provides Python 3 optimized cryptographic functions including elliptic curve operations, ECDSA signing/verification, and mathematical utilities for secp256k1 operations.

cryptnoxpy.cryptos.py3specials.bin_dbl_sha256(s)[source]
cryptnoxpy.cryptos.py3specials.lpad(msg, symbol, length)[source]
cryptnoxpy.cryptos.py3specials.get_code_string(base)[source]
cryptnoxpy.cryptos.py3specials.changebase(string, frm, to, minlen=0)[source]
cryptnoxpy.cryptos.py3specials.bin_to_b58check(inp, magicbyte=0)[source]
cryptnoxpy.cryptos.py3specials.bytes_to_hex_string(b)[source]
cryptnoxpy.cryptos.py3specials.safe_from_hex(s)[source]
cryptnoxpy.cryptos.py3specials.from_int_representation_to_bytes(a)[source]
cryptnoxpy.cryptos.py3specials.from_int_to_byte(a)[source]
cryptnoxpy.cryptos.py3specials.from_byte_to_int(a)[source]
cryptnoxpy.cryptos.py3specials.from_string_to_bytes(a)[source]
cryptnoxpy.cryptos.py3specials.safe_hexlify(a)[source]
cryptnoxpy.cryptos.py3specials.encode(val, base, minlen=0)[source]
cryptnoxpy.cryptos.py3specials.decode(string, base)[source]
cryptnoxpy.cryptos.py3specials.random_string(x)[source]

cryptnoxpy.cryptos.ripemd module

Module containing RIPEMD-160 hash algorithm implementation.

Pure Python implementation of the RIPEMD-160 cryptographic hash function. Used for generating Bitcoin addresses and other cryptographic operations.

class cryptnoxpy.cryptos.ripemd.RIPEMD160(arg=None)[source]

Bases: object

Return a new RIPEMD160 object. An optional string argument may be provided; if present, this string will be automatically hashed.

__init__(arg=None)[source]
update(arg)[source]
digest()[source]
hexdigest()[source]
copy()[source]
cryptnoxpy.cryptos.ripemd.new(arg=None)[source]

Return a new RIPEMD160 object. An optional string argument may be provided; if present, this string will be automatically hashed.

class cryptnoxpy.cryptos.ripemd.RMDContext[source]

Bases: object

__init__()[source]
copy()[source]
cryptnoxpy.cryptos.ripemd.ROL(n, x)[source]
cryptnoxpy.cryptos.ripemd.F0(x, y, z)[source]
cryptnoxpy.cryptos.ripemd.F1(x, y, z)[source]
cryptnoxpy.cryptos.ripemd.F2(x, y, z)[source]
cryptnoxpy.cryptos.ripemd.F3(x, y, z)[source]
cryptnoxpy.cryptos.ripemd.F4(x, y, z)[source]
cryptnoxpy.cryptos.ripemd.R(a, b, c, d, e, Fj, Kj, sj, rj, X)[source]
cryptnoxpy.cryptos.ripemd.RMD160Transform(state, block)[source]
cryptnoxpy.cryptos.ripemd.RMD160Update(ctx, inp, inplen)[source]
cryptnoxpy.cryptos.ripemd.RMD160Final(ctx)[source]

Module contents

Module containing cryptographic utilities for Cryptnox cards.

cryptnoxpy.cryptos.encode_pubkey(pub, formt)[source]

The cryptnoxpy.cryptos package contains cryptographic utilities for Cryptnox cards and exports:

Main cryptographic operations module. See cryptnoxpy.cryptos.main for details.

Python 2 specific cryptographic utilities. See cryptnoxpy.cryptos.py2specials for details.

Python 3 specific cryptographic utilities. See cryptnoxpy.cryptos.py3specials for details.

py3specials.encode_pubkey(pubkey, formt)

Encode a public key in the specified format. See cryptnoxpy.cryptos.main.encode_pubkey() for details.