Skip to content

Latest commit

 

History

History
111 lines (81 loc) · 1.35 KB

File metadata and controls

111 lines (81 loc) · 1.35 KB

Usage Guide

Building from Source

# Clone the repository
git clone https://github.com/zacksfF/go-bn128.git
cd go-bn128

# Initialize module
go mod download
go mod tidy

Quick Start

# Run quick validation
make quick

Testing

# Run all tests with coverage
make test

Test coverage: 91%

# View coverage report
make coverage

Benchmarking

# Run all benchmarks
make bench

Performance on modern hardware:

  • G1 scalar multiplication: ~3ms
  • G2 scalar multiplication: ~6ms
  • Pairing operation: ~15ms
# Specific benchmarks
make bench-g1        # G1 operations only
make bench-pairing   # Pairing operations only

Running Examples

# Run 5 real-world applications
make run-apps

Applications included:

  1. zkSNARK Proof Verification
  2. BLS Multi-Signature
  3. Identity-Based Encryption
  4. Verifiable Random Function
  5. Anonymous Voting

Code Quality

# Format and check code
make check

Complete Verification

# Run everything: tests, benchmarks, quality checks
make verify

Time: 5-10 minutes

Profiling

# CPU profiling
make profile-cpu

# Memory profiling
make profile-mem

Cleanup

# Remove generated files
make clean

Help

# Show all available commands
make help

Prerequisites

  • Go 1.21+
  • Make