Circom libs in Python
Project description
circomlibpy
Circom libs in Python
Obtaining a Poseidon hash from two elements:
from circomlibpy.poseidon import PoseidonHash
poseidon = PoseidonHash()
hash = poseidon.hash(2, [12345, 67890])
Constructing a Merkle tree based on Poseidon hashes:
from circomlibpy.merkle_tree import MerkleTree
leafs: list[int] = [
[1, 2, 3],
[11, 22, 33],
]
mtree = MerkleTree(leafs)
path, order = mtree.gen_proof(index=0)
print(f'Root: {mtree.root}')
print(f'Path: {path}')
print(f'Order: {order}')
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
circomlibpy-1.0.0.tar.gz
(905.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
circomlibpy-1.0.0-py3-none-any.whl
(906.1 kB
view details)
File details
Details for the file circomlibpy-1.0.0.tar.gz.
File metadata
- Download URL: circomlibpy-1.0.0.tar.gz
- Upload date:
- Size: 905.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fa5e03bf9c82ba6afe4b7f7e51ab76676630fa33040851803fb8846c835b1d10
|
|
| MD5 |
86ef7e5eb7212e012563db47f5f9818d
|
|
| BLAKE2b-256 |
67d601e064fb5ef06ac7e86659aad630126bccd95278e4d6ab98b2683eae40f7
|
File details
Details for the file circomlibpy-1.0.0-py3-none-any.whl.
File metadata
- Download URL: circomlibpy-1.0.0-py3-none-any.whl
- Upload date:
- Size: 906.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e4ffcc3a74e7686cb335756976e757921efbe1e6bcb3858342536d1ac01d24b1
|
|
| MD5 |
08667111a97e0496db3cb2bc718abd29
|
|
| BLAKE2b-256 |
f14f7408c12ea2bbb877fe20f777ba9ad0fd1ec67ae825aa2eb8bc006eaf711c
|