Skip to content

bcc-research/CryptoUtilities.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CryptoUtilities.jl

CryptoUtilities.jl is a Julia package providing utilities for succinct proofs, including hardware-optimized implementations of binary fields, Reed-Solomon encodings, and Merkle trees with multiopening proofs.

Features

  • Binary Fields: Efficient arithmetic operations over binary fields.
  • Reed-Solomon Encoding: Encoding and decoding using Reed-Solomon codes w/ O(n log n) cost, implementing this paper.
  • Merkle Trees: Construction, proof generation, and verification for Merkle tree batched openings.

Installation

To use BinaryFields or any of the other packages, simply add the package to your Julia environment:

using Pkg
Pkg.add("https://github.com/bcc-research/CryptoUtilities.jl.git", subdir="BinaryFields")

Replace subdir="BinaryFields" with subdir="BinaryReedSolomon" or subdir="BatchedMerkleTree" to install the other packages.

(We are working on adding the packages to the Julia package registry, but for now, you can install them directly from the GitHub repository.)

Usage

Notebooks

We provide examples and walkthroughs of the package (along with some Julia basics) as Pluto.jl notebooks in the CryptoUtilitiesNotebooks repository. We highly recommend reading those, which should be all you need to get started using this library. We also provide some (very basic) examples below, for completeness.

Binary Fields

using BinaryFields

a = BinaryElem16(0x1)
b = BinaryElem16(0x2)
c = a * b
println(c)

Reed-Solomon Encoding

using BinaryReedSolomon

rs = reed_solomon(BinaryElem16, 256, 1024)
message = rand(BinaryElem16, 256)
encoded = encode(rs, message)

Merkle Trees

using BatchedMerkleTree

leaves = [rand(UInt16, 4) for _ in 1:16]
tree = build_merkle_tree(leaves)
root = get_root(tree)

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages