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.8, 3.9 & 3.10.

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.8.8 instead of 3.8.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.3-cp310-cp310-win_amd64.whl (106.2 kB view details)

Uploaded CPython 3.10 Windows x86-64

neo3crypto-0.3-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.3-cp310-cp310-macosx_11_0_arm64.whl (111.3 kB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

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

Uploaded CPython 3.10 macOS 10.9+ x86-64

neo3crypto-0.3-cp39-cp39-win_amd64.whl (104.4 kB view details)

Uploaded CPython 3.9 Windows x86-64

neo3crypto-0.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (142.4 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

neo3crypto-0.3-cp39-cp39-macosx_10_9_x86_64.whl (117.6 kB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

neo3crypto-0.3-cp38-cp38-win_amd64.whl (106.1 kB view details)

Uploaded CPython 3.8 Windows x86-64

neo3crypto-0.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (142.1 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

neo3crypto-0.3-cp38-cp38-macosx_10_9_x86_64.whl (117.4 kB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: neo3crypto-0.3-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 106.2 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.5

File hashes

Hashes for neo3crypto-0.3-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 c2933f7e13842bd949fca8c91a9169b500882c1dbfd5592785ab2229f800f0a6
MD5 078dc9da3445b64c0dc353687df79ff5
BLAKE2b-256 c46beacec5852d4afa253a716c0b408b25f28207c583f99d099680b45582bdde

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for neo3crypto-0.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6efbfab2a8ebd31e305d9cd8e8db8bf8029a595b30d0923996036a2c2ad99e92
MD5 efa691255740dd8281211d446c760e73
BLAKE2b-256 7bd3e84309e614243f2a71460144f7e74f008e53665d4e4c738bceade86cd784

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for neo3crypto-0.3-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2f3a223127b55ad645cc265ee84e694e30b7d5d93b7ed83d79e21914ac389ca9
MD5 fda6c4dee1e2d5fc712de24870f21eb8
BLAKE2b-256 8621e852b617d50933231460fa5a62db385f2356158f58829308d45e7f2a20bf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for neo3crypto-0.3-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 40e3863f33c453f9cb5f32f7e85fe84ffbff63f322f723184d3b3acf24509816
MD5 84112e71fc63b56d866e59fc05503e63
BLAKE2b-256 e297524fe1efe33008cdff169821385c5266c7e7e364206903ac31a9a62af0ef

See more details on using hashes here.

File details

Details for the file neo3crypto-0.3-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: neo3crypto-0.3-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 104.4 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.5

File hashes

Hashes for neo3crypto-0.3-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 1bdf9837ab7657bb53862512b6e49812ddbd06b8fd8e0d9c7f94b8847edde5dd
MD5 1ff0250c04d3f23c1c702bff4aed36d3
BLAKE2b-256 7042ac19684fdf1dc0aedcb1e943c75b80f811fe5b513d0e2bd1c03872c5084c

See more details on using hashes here.

File details

Details for the file neo3crypto-0.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for neo3crypto-0.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3caf5e21f37894ef435924b52efbcd9015abae661c7c5b3c8ce19d99e4c9460c
MD5 b32702053f2d34f93ae0f4131975fc2c
BLAKE2b-256 67d6791dcf676d0647e09585e96332cd2aa29a605f257b2868f0b500d93ae387

See more details on using hashes here.

File details

Details for the file neo3crypto-0.3-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for neo3crypto-0.3-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 8fe5e098245074e07cd952747b3e117ace8ffb8550f5580f6dcffeb7a98fd9a2
MD5 856a90be2ff3657e19028a993f5b3487
BLAKE2b-256 a083e119772b2492bcfa8622878fac06bab2547b7214927084e28215bf926357

See more details on using hashes here.

File details

Details for the file neo3crypto-0.3-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: neo3crypto-0.3-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 106.1 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.5

File hashes

Hashes for neo3crypto-0.3-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 73ea0d42b6a59bfe6ceb6d9f196ac1e07f9cf9e3174c8a2f3d76afa6bbdb8c8e
MD5 7ac2929dd79f10331dd17c98b853ec42
BLAKE2b-256 c67646a2d52adfa1935ae3bddb22260c1ddf1d2f7841ca08791bbbe2fe00ffd3

See more details on using hashes here.

File details

Details for the file neo3crypto-0.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for neo3crypto-0.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0ec9b53d5f33265b52594e83b1aebb5c654b99bf3b11891194b371eea49ba3fc
MD5 e29e720e0db2d6fc74da9efdfad522e4
BLAKE2b-256 686df3796c7abf72a9e96201bed2889338a68160ea71d89a1578149d7a0f8c38

See more details on using hashes here.

File details

Details for the file neo3crypto-0.3-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for neo3crypto-0.3-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 21f8cc3c453b1a3f519754cdd8ce6cbcd86f755eb138be5a167537816d347fd0
MD5 af4b0bd8cff44074d2ddf7303376a112
BLAKE2b-256 9d3e11d4ff782886255536587734ff1ac09d5d0905e557e9ec912ecaea2cbfbb

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