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 ecdsa.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.1-cp311-cp311-win_amd64.whl (106.2 kB view details)

Uploaded CPython 3.11 Windows x86-64

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

Uploaded CPython 3.11 musllinux: musl 1.1+ ARM64

neo3crypto-0.4.1-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.1-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.1-cp311-cp311-macosx_11_0_arm64.whl (111.3 kB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

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

Uploaded CPython 3.11 macOS 10.9+ x86-64

neo3crypto-0.4.1-cp310-cp310-win_amd64.whl (106.2 kB view details)

Uploaded CPython 3.10 Windows x86-64

neo3crypto-0.4.1-cp310-cp310-musllinux_1_1_aarch64.whl (645.1 kB view details)

Uploaded CPython 3.10 musllinux: musl 1.1+ ARM64

neo3crypto-0.4.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (142.3 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

neo3crypto-0.4.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (132.2 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ ARM64

neo3crypto-0.4.1-cp310-cp310-macosx_11_0_arm64.whl (111.3 kB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

neo3crypto-0.4.1-cp310-cp310-macosx_10_9_x86_64.whl (117.5 kB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

File details

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

File metadata

File hashes

Hashes for neo3crypto-0.4.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 c8ebabbfae8faa644be9462e3c08b0af28f6b76b1f1b035e22265df787743c3a
MD5 dbf265ba1799e181fa7702b4312fe7a4
BLAKE2b-256 9be8fc9197e67b63141895d928968211f5081ab9b2478316b1525c351d106d31

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for neo3crypto-0.4.1-cp311-cp311-musllinux_1_1_aarch64.whl
Algorithm Hash digest
SHA256 691545f2be2a8ca5d39aad5ffc7898f9cb24b8de40d357804396fa784b3ae5f4
MD5 b251c9cba7e78853bcd823de2929c630
BLAKE2b-256 e43404edb3e0c01c5873b0f1dc22e49b7507cc476f5c2eb27110aa9d8b546f8b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for neo3crypto-0.4.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0703aa78a39fa907406cb9ddd3997e06baff5cc4dc287e3567c5bec48dce4895
MD5 6201ce9caf76bafc5847aabd90ea0f44
BLAKE2b-256 187c2aa69f8828895b4888d15cae2ad449e1c67de7783d3790af0bf1909a89bb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for neo3crypto-0.4.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 4e2daa2e1e8af8fcddebef707295dbd35439b8789ece39305180ffeb15c8df4e
MD5 83f218e68863d2b99d1a3a38a563ad5d
BLAKE2b-256 c3dd382bfbb3a4e2e62ebf5d28e65b13a50db7385b72018bfa48f8330c431655

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for neo3crypto-0.4.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 76e7de238314e7a34edd4f5d87bbf733ac0885ba4dcda86609230d02ebe89f02
MD5 2b0311505150e468b691ddfb0ee2103c
BLAKE2b-256 f9e3eeef8b434f6d646fe7945af9ec81c65c259f1208fd1c46a206e410b04a2e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for neo3crypto-0.4.1-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 44d5ca2c4c2c0b648eda2b9e3b1518917c42b9691c7c066d232a396b687ea8bd
MD5 c8f4b3b34de7e231ce442a0a592fc7f2
BLAKE2b-256 328d19e92ea73e6746a338f056933e6af3d3c11627a4e410bda113f9d4e30191

See more details on using hashes here.

File details

Details for the file neo3crypto-0.4.1-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for neo3crypto-0.4.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 14cd366335b487a7df41d5f5d713aec8bf485b1e85beccf48061e42f08a876a2
MD5 9ece62a7f73dc767451bf04579201b93
BLAKE2b-256 512bd6196b1f98c00881887fb62ad52fbff4cf1037997abe87321d5ae33efd7c

See more details on using hashes here.

File details

Details for the file neo3crypto-0.4.1-cp310-cp310-musllinux_1_1_aarch64.whl.

File metadata

File hashes

Hashes for neo3crypto-0.4.1-cp310-cp310-musllinux_1_1_aarch64.whl
Algorithm Hash digest
SHA256 2fa8702f3f96fa9f34c8c541be49d2cdf72dbd7bb6875db111d486553e05d4b4
MD5 511174c0e048fa5dd8dbd741e64e3586
BLAKE2b-256 f3b19f2dd0f2abaeae139de433b123974ebf1acd8e8d1b9e896e01a3e3cfe904

See more details on using hashes here.

File details

Details for the file neo3crypto-0.4.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for neo3crypto-0.4.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e6990a11644a8208974b2a32e36e64f36938639e5e027e10505c6565643e24bd
MD5 bb6defa123f5feef3c1bc37ce8bdd3a4
BLAKE2b-256 7f5080fa1eb33b34e8a0bab3f40ee47cbef3c73afbeb4cbdae6d1e8e2c519be6

See more details on using hashes here.

File details

Details for the file neo3crypto-0.4.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for neo3crypto-0.4.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 8b68d869ba1fd92a6a48595146704d687d2573524a47abb81b09ddfcd51c5321
MD5 7b71200b18dfd74cc6021e0c23493f47
BLAKE2b-256 8382d157230d0fd9327377a574ade3764fd776d4c86191e4aa26bf57fde2962d

See more details on using hashes here.

File details

Details for the file neo3crypto-0.4.1-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for neo3crypto-0.4.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 fe620bbb445a149e429ecaf422cefb9ba28ea2eb1fac7fb579f2c15cdb677e1c
MD5 4b1b6c89eb396f9f13e19a9ccd37938b
BLAKE2b-256 e72ad48b14db53cbcfd299f23975d8d003ef4c6290b7ccf1a413e27d25025028

See more details on using hashes here.

File details

Details for the file neo3crypto-0.4.1-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for neo3crypto-0.4.1-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 cf5e3b404a916282a89e9fdc1c5b405acfcf20692e5e8cb27d0b19b80b5ece38
MD5 2a5b555d143c682780231da5a9f7189c
BLAKE2b-256 2e34fbfed1ed51172cf5505762cfa46889e3dbaa904d8da6fc8db0f692144474

See more details on using hashes here.

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