bgls

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

README

Boneh-Boyen Signatures

This implements the [BB14] signature scheme based upon bilinear maps which does not assume the random oracle model. Instead it uses the Strong Diffie Hellman (SDH) assumption. This signature scheme ends up being far more concretely efficient in signature creation and verification than single BLS signatures (However, BLS multisigs end up being faster after a threshold number of signers). The security of a signature in this scheme is sqrt(p/d), where p is the order of the G1 and G2, and d is the number of signatures provided for a given public key*. This 1/sqrt(d) term comes from attacks on SDH. [Cheon06]

This signature scheme is named BB signatures here, due to authors being Dan Boneh and Xavier Boyen. If there is an official alternate name for this signature scheme, this folder will be renamed.

TODO write and implement partial message recovery.

Documentation

Benchmarks

These still need to be created.

* technically d is the number of adaptive signature queries which an adversary can make on the public key.

References

[BB14] Short Signatures Without Random Oracles and the SDH Assumption in Bilinear Groups, Dan Boneh, Xavier Boyen 2014 [Cheon06] Security Analysis of the Strong Diffie-Hellman Problem, Jung Hee Cheon 2006

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func KeyGen

func KeyGen(curve CurveSystem) (Privkey, Pubkey)

KeyGen generates a private / public keypair for bbsigs. the points are on G2.

func Verify

func Verify(curve CurveSystem, sig Signature, pk Pubkey, msg *big.Int) bool

Verify checks that a standard bbsig is valid

func VerifyCustHash

func VerifyCustHash(curve CurveSystem, sig Signature, pk Pubkey, msg []byte,
	hash func([]byte, *big.Int) *big.Int) bool

VerifyCustHash verifies a BBSig with the provided hash function

func VerifyHashed

func VerifyHashed(curve CurveSystem, sig Signature, pk Pubkey, msg []byte) bool

VerifyHashed verifies a BBSig with blake2b256 ran on the message

Types

type Privkey

type Privkey struct {
	X *big.Int
	Y *big.Int
}

Privkey holds the x,y pair

type Pubkey

type Pubkey struct {
	U Point
	V Point
}

Pubkey holds the u,v pair on G2

func LoadPublicKey

func LoadPublicKey(curve CurveSystem, x *big.Int, y *big.Int) Pubkey

LoadPublicKey turns secret key into a public key

type Signature

type Signature struct {
	Sigma Point
	R     *big.Int
}

Signature holds the data required to verify a bbsig.

func Sign

func Sign(curve CurveSystem, sk Privkey, msg *big.Int) Signature

Sign creates a standard bbsigs signature on a message with a private key

func SignCustHash

func SignCustHash(curve CurveSystem, sk Privkey, msg []byte, hash func([]byte, *big.Int) *big.Int) Signature

SignCustHash creates a BBSig with the provided hash function

func SignHashed

func SignHashed(curve CurveSystem, sk Privkey, msg []byte) Signature

SignHashed creates a BBSig with blake2b256 ran on the message

Jump to

Keyboard shortcuts

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