Skip to content

libraries/bn128

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ALT BN128

This repo implements the following EIPs on CKB-VM:

The way to use it is dead simple. You can compile riscv or native results, it depends on you.

Build for CKB/RISC-V

# Build test
$ riscv64-unknown-elf-g++ -fno-exceptions -Os -march=rv64gc -Iinclude -Iintx/include -o build/test test/test_bn128.cpp

# Run test on CKB-VM
$ cd ckb-vm-run
$ cargo build --release
$ cd ..
$ ./ckb-vm-run/target/release/asm build/test

Build for native

# Build test
$ g++ -fno-exceptions -Os -Iinclude -Iintx/include -o build/test test/test_bn128.cpp

# Run test on native
$ ./build/test
# If the return code is 0, it means that the test has all passed.
$ echo $?

Or use the script directly

$ export RISCV=/path/to/riscvdir

$ ./script/test.sh
$ ./script/test_benchmark.sh

Read the test code to see how to call add(), mul() and pairing().

About

alt_bn128 C++ implements

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published