This repository contains compiled static library of https://github.com/herumi/bls with BLS_ETH=1.
add SecretKey::GetSafePublicKey(), which returns an error if sec is zeroMultiVerify returns true only if all signatures are valid.SignHashWithDomain, VerifyHashWithDomain, VerifyAggregateHashWithDomain are removed.EthModeDraft07 is added for draft-07.EthModeDraft06 is default. Call SetETHmode(EthModeDraft05) to use older evrsion.SetETHmode(2) has changed because of changing DST in hash-to-curve function.Init as the followings:
Init(BLS12_381)
then, you can use the following functions.
| bls-eth-go-binary | eth2.0 spec name |
|---|---|
| SecretKey::SignByte | Sign |
| PublicKey::VerifyByte | Verify |
| Sign::Aggregate | Aggregate |
| Sign::FastAggregateVerify | FastAggregateVerify |
| Sign::AggregateVerifyNoCheck | AggregateVerify |
The size of message must be 32 byte.
Check functions:
deserialize check the correctness of the orderdeserialize check the correctness of the orderexamples/sample.gogit clone -b release https://github.com/herumi/bls-eth-go-binary
cd bls-eth-go-binary
go run examples/sample.go
setup_vendor.shSince this package includes C headers and libraries,
when using go build -mod=vendor, please run:
$GOMODCACHE/github.com/herumi/bls-eth-go-binary@<version>/setup_vendor.sh
This command will copy all necessary files to your vendor directory.
The following steps are not necessary if you use release branch.
git clone https://github.com/herumi/bls-eth-go-binary
cd bls-eth-go-binary
git submodule update --init --recursive
go test ./bls
On x64 Linux,
make
Otherwise, clang is necessary to build ll files.
make CXX=clang++
make ARCH=x86_64 # for Intel mac
make ARCH=arm64 # for M1 mac
sudo apt-get install gcc-multilib
make -C src/bls -f Makefile.onelib build_aarch64 CXX=clang++ -j OUT_DIR=../..
Install a cross compiler.
sudo apt install gcc-riscv64-linux-gnu
Build a library and run the sample.
make riscv64
env CGO_ENABLED=1 GOARCH=riscv64 CC=riscv64-linux-gnu-gcc-14 go build examples/sample.go
env QEMU_LD_PREFIX=/usr/riscv64-linux-gnu ./sample
Install ndk-build.
make android
If you need a shared library, then after make clean,
make android BLS_LIB_SHARED=1
make ios
Check llc --version shows to support the target armv7a.
make ../mcl/src/base32.ll
env CXX=clang++ BIT=32 ARCH=arm _OS=android _ARCH=armeabi-v7a make MCL_USE_GMP=0 UNIT=4 CFLAGS_USER="-target armv7a-linux-eabi -fPIC"
armv7a-linux-eabi.env CC=arm-linux-gnueabi-gcc CGO_ENABLED=1 GOOS=linux GOARM=7 GOARCH=arm go build examples/sample.go
env QEMU_LD_PREFIX=/usr/arm-linux-gnueabi qemu-arm ./sample
Check llc --version shows to support the target mips.
make ../mcl/src/base32.ll
env CXX=clang++ BIT=32 ARCH=mipsel _OS=linux _ARCH=mipsle make MCL_USE_GMP=0 UNIT=4 CFLAGS_USER="-target mipsel-linux -fPIC"
mipsel-linux.env CC=mipsel-linux-gnu-gcc CGO_ENABLED=1 GOOS=linux GOARCH=mipsle GOMIPS=softfloat go build examples/sample.go
env QEMU_LD_PREFIX=/usr/mipsel-linux-gnu qemu-mipsel ./sample
#define BLS_ETH
#include <mcl/bn_c384_256.h>
#include <bls/bls.h>
MITSUNARI Shigeo(herumi@nifty.com)
Overall
Maintained
Code review
Go module
Latest release
Releases this year
This repository contains compiled static library of https://github.com/herumi/bls with BLS_ETH=1.
add SecretKey::GetSafePublicKey(), which returns an error if sec is zeroMultiVerify returns true only if all signatures are valid.SignHashWithDomain, VerifyHashWithDomain, VerifyAggregateHashWithDomain are removed.EthModeDraft07 is added for draft-07.EthModeDraft06 is default. Call SetETHmode(EthModeDraft05) to use older evrsion.SetETHmode(2) has changed because of changing DST in hash-to-curve function.Init as the followings:
Init(BLS12_381)
then, you can use the following functions.
| bls-eth-go-binary | eth2.0 spec name |
|---|---|
| SecretKey::SignByte | Sign |
| PublicKey::VerifyByte | Verify |
| Sign::Aggregate | Aggregate |
| Sign::FastAggregateVerify | FastAggregateVerify |
| Sign::AggregateVerifyNoCheck | AggregateVerify |
The size of message must be 32 byte.
Check functions:
deserialize check the correctness of the orderdeserialize check the correctness of the orderexamples/sample.gogit clone -b release https://github.com/herumi/bls-eth-go-binary
cd bls-eth-go-binary
go run examples/sample.go
setup_vendor.shSince this package includes C headers and libraries,
when using go build -mod=vendor, please run:
$GOMODCACHE/github.com/herumi/bls-eth-go-binary@<version>/setup_vendor.sh
This command will copy all necessary files to your vendor directory.
The following steps are not necessary if you use release branch.
git clone https://github.com/herumi/bls-eth-go-binary
cd bls-eth-go-binary
git submodule update --init --recursive
go test ./bls
On x64 Linux,
make
Otherwise, clang is necessary to build ll files.
make CXX=clang++
make ARCH=x86_64 # for Intel mac
make ARCH=arm64 # for M1 mac
sudo apt-get install gcc-multilib
make -C src/bls -f Makefile.onelib build_aarch64 CXX=clang++ -j OUT_DIR=../..
Install a cross compiler.
sudo apt install gcc-riscv64-linux-gnu
Build a library and run the sample.
make riscv64
env CGO_ENABLED=1 GOARCH=riscv64 CC=riscv64-linux-gnu-gcc-14 go build examples/sample.go
env QEMU_LD_PREFIX=/usr/riscv64-linux-gnu ./sample
Install ndk-build.
make android
If you need a shared library, then after make clean,
make android BLS_LIB_SHARED=1
make ios
Check llc --version shows to support the target armv7a.
make ../mcl/src/base32.ll
env CXX=clang++ BIT=32 ARCH=arm _OS=android _ARCH=armeabi-v7a make MCL_USE_GMP=0 UNIT=4 CFLAGS_USER="-target armv7a-linux-eabi -fPIC"
armv7a-linux-eabi.env CC=arm-linux-gnueabi-gcc CGO_ENABLED=1 GOOS=linux GOARM=7 GOARCH=arm go build examples/sample.go
env QEMU_LD_PREFIX=/usr/arm-linux-gnueabi qemu-arm ./sample
Check llc --version shows to support the target mips.
make ../mcl/src/base32.ll
env CXX=clang++ BIT=32 ARCH=mipsel _OS=linux _ARCH=mipsle make MCL_USE_GMP=0 UNIT=4 CFLAGS_USER="-target mipsel-linux -fPIC"
mipsel-linux.env CC=mipsel-linux-gnu-gcc CGO_ENABLED=1 GOOS=linux GOARCH=mipsle GOMIPS=softfloat go build examples/sample.go
env QEMU_LD_PREFIX=/usr/mipsel-linux-gnu qemu-mipsel ./sample
#define BLS_ETH
#include <mcl/bn_c384_256.h>
#include <bls/bls.h>
MITSUNARI Shigeo(herumi@nifty.com)
Overall
Maintained
Code review
Go module
Latest release
Releases this year