Skip to main content

Native crypto functions for the NEO 3 Blockchain

Project description

CoZ logo

NEO3VM

C++ implementations of cryptographic functions used in the NEO3 Blockchain with bindings for Python 3.10 & 3.11.

The current version supports mmh3 and EllipticCurve functions by wrapping (part of smhasher and micro-ecc) and exposing helper classes. SECP256R1 (a.k.a NIST256P) and SECP256K1 are the only curves exposed, but others can easily be enabled if needed.

Installation

pip install neo3crypto

Or download the wheels from the Github releases page.

Windows users

If installing fails with the error No Matching distribution found then upgrade your Python installation to use the latest post release version (i.e. 3.10.8 instead of 3.10.0)

Usage

import hashlib
import os
from neo3crypto import ECCCurve, ECPoint, sign, verify, mmh3_hash_bytes, mmh3_hash


curve = ECCCurve.SECP256R1
private_key = os.urandom(32)
public_key = ECPoint(private_key, curve)

signature = sign(private_key, b'message', curve, hashlib.sha256)
assert verify(signature, b'message', public_key, hashlib.sha256) == True

assert mmh3_hash("foo", signed=False) == 4138058784
assert bytes.fromhex("0bc59d0ad25fde2982ed65af61227a0e") == mmh3_hash_bytes("hello", 123)

Any hashlib hashing function can be used. Further documentation on the classes can be queried from the extension module using help(neo3crypto).

Building wheels

Make sure to have wheel and CMake installed. Then call python setup.py bdist_wheel.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

neo3crypto-0.4.3-cp312-cp312-win_amd64.whl (107.5 kB view details)

Uploaded CPython 3.12 Windows x86-64

neo3crypto-0.4.3-cp312-cp312-musllinux_1_1_x86_64.whl (664.4 kB view details)

Uploaded CPython 3.12 musllinux: musl 1.1+ x86-64

neo3crypto-0.4.3-cp312-cp312-musllinux_1_1_aarch64.whl (645.6 kB view details)

Uploaded CPython 3.12 musllinux: musl 1.1+ ARM64

neo3crypto-0.4.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (140.8 kB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

neo3crypto-0.4.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (131.4 kB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ ARM64

neo3crypto-0.4.3-cp312-cp312-macosx_11_0_arm64.whl (113.0 kB view details)

Uploaded CPython 3.12 macOS 11.0+ ARM64

neo3crypto-0.4.3-cp312-cp312-macosx_10_9_x86_64.whl (120.0 kB view details)

Uploaded CPython 3.12 macOS 10.9+ x86-64

neo3crypto-0.4.3-cp311-cp311-win_amd64.whl (106.2 kB view details)

Uploaded CPython 3.11 Windows x86-64

neo3crypto-0.4.3-cp311-cp311-musllinux_1_1_x86_64.whl (665.9 kB view details)

Uploaded CPython 3.11 musllinux: musl 1.1+ x86-64

neo3crypto-0.4.3-cp311-cp311-musllinux_1_1_aarch64.whl (645.1 kB view details)

Uploaded CPython 3.11 musllinux: musl 1.1+ ARM64

neo3crypto-0.4.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (142.3 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

neo3crypto-0.4.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (132.3 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ ARM64

neo3crypto-0.4.3-cp311-cp311-macosx_11_0_arm64.whl (111.3 kB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

neo3crypto-0.4.3-cp311-cp311-macosx_10_9_x86_64.whl (117.5 kB view details)

Uploaded CPython 3.11 macOS 10.9+ x86-64

File details

Details for the file neo3crypto-0.4.3-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for neo3crypto-0.4.3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 5d57be2ffa49fa7135dc5d4b736a37a8bc81fafc8124d787cc7a9fb2c112aa8d
MD5 d8fdc9abe56575f4f73b681c1da725c2
BLAKE2b-256 acd200fb62c7313d7a831e99588e0ac2cb55d4a66e848df15ae7c23a02429128

See more details on using hashes here.

Provenance

File details

Details for the file neo3crypto-0.4.3-cp312-cp312-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for neo3crypto-0.4.3-cp312-cp312-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 0b7b74aeb9fbbbde836f99845e4e9d5053b68b8bd3b291c3540463b42f216ce4
MD5 7616a6db364863a0fef656f920c258be
BLAKE2b-256 ff8a9c653ae3ddb00f582f4599a99b2d25ff75ae71b17421272d88ed283e73d8

See more details on using hashes here.

Provenance

File details

Details for the file neo3crypto-0.4.3-cp312-cp312-musllinux_1_1_aarch64.whl.

File metadata

File hashes

Hashes for neo3crypto-0.4.3-cp312-cp312-musllinux_1_1_aarch64.whl
Algorithm Hash digest
SHA256 a7ad9ddf27be8ef3188e193fafa9e6b53467582aff67de7b41a4232836d7f317
MD5 7cdbb5b5829f701fd3d1118e05a79e0e
BLAKE2b-256 21afa750a84e962620e8e5cac33c91b390763c11efc305222878ae46ff5ec5e1

See more details on using hashes here.

Provenance

File details

Details for the file neo3crypto-0.4.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for neo3crypto-0.4.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 40e577e454835187cc0c8770f8d540925b1e351c7848aa4aaf6676ceec781129
MD5 21f6a8322f063a1bf39fe7b4f695b4c5
BLAKE2b-256 589c14918672cb850412c089d3c11464f1c2cae931c037c766f3779e668488cb

See more details on using hashes here.

Provenance

File details

Details for the file neo3crypto-0.4.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for neo3crypto-0.4.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 b8afacf670a4db2b5adee0c5a2804318a465b5d8bd8baebdfd09a341cc1162b5
MD5 0743bc2d384ebca287e9ab505f005975
BLAKE2b-256 434f4a87e4a3e8c0677adcc579fbdb779d8676139e779daefb3dcc677c034a1e

See more details on using hashes here.

Provenance

File details

Details for the file neo3crypto-0.4.3-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for neo3crypto-0.4.3-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0e3b6f775c958064c66eee270f00d61a5f043363a68f5f16572b1e004e44b4ef
MD5 91426fb9c2f32163e5ab21b6989aa021
BLAKE2b-256 4385a0c7f90e75a7fc42ca4c66a0eb0d55e2d693f6d84a1ccad2ffc73c883a93

See more details on using hashes here.

Provenance

File details

Details for the file neo3crypto-0.4.3-cp312-cp312-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for neo3crypto-0.4.3-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 33abc883589b1cd4da6d3bcd0ab800b9d6c406c5a8b4f2a97ca918b7f86a9d30
MD5 1f42a8dcc4c4913241f1e7cf483a597e
BLAKE2b-256 14f8c5e098ee62b7bbb6bb536e37c27c02bb08aa820559752dc9a7abe551f5f1

See more details on using hashes here.

Provenance

File details

Details for the file neo3crypto-0.4.3-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for neo3crypto-0.4.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 c4c19c25e0c55c65a247a09abed7427a49f0ba740ff945966ceb8d3b754104cb
MD5 b5748be5bd8306cdcc136e32e6a1e3cc
BLAKE2b-256 a33bfb93a7abdf9012be197c8eb37e83648dbcbf1a81f64f06bd12ebc12a5203

See more details on using hashes here.

Provenance

File details

Details for the file neo3crypto-0.4.3-cp311-cp311-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for neo3crypto-0.4.3-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 ad62cd8dcafbc21bee254faeac015c01cb0222e1dbd378f1f094e62b0c0a1e04
MD5 606cd6846230450375d254dd71aad291
BLAKE2b-256 739e064f47858541390d69fcd4c70bcd761bbe91c59378749999eac0f70f4946

See more details on using hashes here.

Provenance

File details

Details for the file neo3crypto-0.4.3-cp311-cp311-musllinux_1_1_aarch64.whl.

File metadata

File hashes

Hashes for neo3crypto-0.4.3-cp311-cp311-musllinux_1_1_aarch64.whl
Algorithm Hash digest
SHA256 5cf04302964d7bce515c9572c0ea61d73f8577aaca50aecaad22e47e5aaf44cb
MD5 6c306e7cfa9e31e858d03188ca60d7bc
BLAKE2b-256 9d540044a5780a920c9e70ca8731ecdbb97c2fa809136664a9f0a1d3c571875f

See more details on using hashes here.

Provenance

File details

Details for the file neo3crypto-0.4.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for neo3crypto-0.4.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 aa7d1b82ab61638d5bfef2403bce930724af3020ffa4485d7a740264db69089d
MD5 93c8ad5b66cd89c68b12478c90eea3b0
BLAKE2b-256 d2010fd10b965655d97f5719c3cbab08faa6fccaba139487fa1a7a685a42681b

See more details on using hashes here.

Provenance

File details

Details for the file neo3crypto-0.4.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for neo3crypto-0.4.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 4be4ee921dfba232617ae48b4dd31b09e6e8b75d0ccc16afbbbb0045ebb92c33
MD5 655473550db3f295c42bf00158082cb8
BLAKE2b-256 c5cfc12a05a614861c04f6e6b546f7da3e71919ab90e3f4917b23cd6aafb9396

See more details on using hashes here.

Provenance

File details

Details for the file neo3crypto-0.4.3-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for neo3crypto-0.4.3-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0a285a3dae58f8b3922c4f4f6026ccdad78c18c58146dca31501fa4148ce61d3
MD5 40d3dc5073d26e574f50b48d41aedd73
BLAKE2b-256 4a002724f5e50c58fc73c6e28b373a08a5e5024fb8679ef6e462716b6a2cf653

See more details on using hashes here.

Provenance

File details

Details for the file neo3crypto-0.4.3-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for neo3crypto-0.4.3-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 308421d0e80730bbf923cfe59ee6b4e4db7fd7fd87e15550ab360e3391edc0bd
MD5 bdcffb3b503af5f42664d84ddfbda8a0
BLAKE2b-256 349b2dda69caa2b2de14a9e97fe74b4c04266052acf4d48bd45589a0b4a93263

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page