bls

package module
v0.1.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 25, 2022 License: MPL-2.0 Imports: 3 Imported by: 9

README

CGo Wrapper for BLS12-381 Sign

bls.go exposes a CGo wrapper to the native rust bls12-381 signing library.

Building

Makefile at the repo root takes care of everything, but essentially you'll want to have the built lib binaries in this directory for GCC to link against them as specified in the CGo headers at the top of bls.go. We provide pre-built binaries for Ubuntu and Darwin for convenience.

Usage

$ go get github.com/dusk-network/bls12_381-sign/go/cgo/bls

This package exports the following methods:

GenerateKeys() ([]byte, []byte)
GenerateKeysWithRaw() ([]byte, []byte, []byte) 
Sign(sk, pk, msg []byte) ([]byte, error)
Verify(apk, sig, msg []byte) error
CreateApk(pk []byte) ([]byte, error)
AggregatePk(apk []byte, pks ...[]byte) ([]byte, error)
AggregatePKsUnchecked(pks ...[]byte) ([]byte, error)
AggregateSig(sig []byte, sigs ...[]byte) ([]byte, error)
PkToRaw(pk []byte) ([]byte, error)

Please check bls_test.go for a few examples.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AggregatePKsUnchecked

func AggregatePKsUnchecked(pks ...[]byte) ([]byte, error)

func AggregatePk

func AggregatePk(apk []byte, pks ...[]byte) ([]byte, error)

func AggregateSig

func AggregateSig(sig []byte, sigs ...[]byte) ([]byte, error)

func CreateApk

func CreateApk(pk []byte) ([]byte, error)

func GenerateKeys

func GenerateKeys() ([]byte, []byte)

func GenerateKeysWithRaw

func GenerateKeysWithRaw() ([]byte, []byte, []byte)

func PkToRaw

func PkToRaw(pk []byte) ([]byte, error)

func Sign

func Sign(sk, pk, msg []byte) ([]byte, error)

func Verify

func Verify(apk, sig, msg []byte) error

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL