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

Uploaded CPython 3.11 Windows x86-64

neo3crypto-0.4-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-cp311-cp311-macosx_11_0_arm64.whl (111.2 kB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

neo3crypto-0.4-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-cp310-cp310-win_amd64.whl (106.2 kB view details)

Uploaded CPython 3.10 Windows x86-64

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

Uploaded CPython 3.10 macOS 11.0+ ARM64

neo3crypto-0.4-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-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: neo3crypto-0.4-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 106.2 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for neo3crypto-0.4-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 ff1bb2bc3085c72a8c4cd133361c3817fa2fdee666943e0bc97b015e7ac0913c
MD5 276b4f2904adbfea6061a243ada204b0
BLAKE2b-256 ef7ab79eed5053e21bf2982e1eb5edf68fa807c668aa38113da6862955a5e5bd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for neo3crypto-0.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 49bbe1e41b57c9a62515dc843b678f03293aa1f7a506e03e1058929e0b439fc7
MD5 9a44d1184e52da93ac136ecf5c6cb949
BLAKE2b-256 0a2fb079ec6d5d10831c7febadc34751a73c8c633a4364ba82cd198864a29b09

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for neo3crypto-0.4-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 139620e9fd415533d8818d39ae3806ea9b089b555085081cae76eaf8aa6bc27d
MD5 2ec5ee08c146a382205849dfcbd0c01a
BLAKE2b-256 f23cbf83e721c2f1440d1ef56b0f16c85f21f38856e8b886bdd6ff620bcb1729

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for neo3crypto-0.4-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 b2f0dbd39df82fa532d924a0212745d69fd754ec9275e0f8194f00e435cf6631
MD5 1f5e858afd3090a80e773072b4be3e35
BLAKE2b-256 c701f64baa5f432354ce5b3a3ac41d1d938c2d621380b83da06f0fb25231e535

See more details on using hashes here.

File details

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

File metadata

  • Download URL: neo3crypto-0.4-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.2 CPython/3.11.3

File hashes

Hashes for neo3crypto-0.4-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 8c79bf34853685c671a444f89fe8382bc238e5f0a35588212552382176b242ab
MD5 a3158a8800fe010c05b5bffaf179c8e6
BLAKE2b-256 03f0130f05e463f3fb80761ef58bfed13760cdbdefba24841797345c8446425c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for neo3crypto-0.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a4ce7b8a3fcd8fc6d0f833aed5eb63805607dabd2f1c26542f6740640fe79091
MD5 1e297f5e8e8f158abb2059747328de4f
BLAKE2b-256 d36db68b28b21a6fe311d832d6576a043211c1f3d2bc97ff38bb9c1000635653

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for neo3crypto-0.4-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 32340f467f9a5db437aca4e60d6580d2a1b83810259c0c2ba774ce0b1841f053
MD5 311f57df19065b20dda5632263ea9191
BLAKE2b-256 47b4e83544a2c592a1402517e67ab55a7475f969c4705f3a4a696e6723339198

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for neo3crypto-0.4-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 91af8f6c1ae80906bbb4f143c3d51205df60a52b2a966c20c6c28d4bc72ae503
MD5 b57c3e35c0ccdd273473102abb82d58c
BLAKE2b-256 e54eac1b5b4c142fc17e71d41b489525fa67bbb910eca950dc5b92a42840448d

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