Documentation
¶
Overview ¶
Package bn256 allows to use Handel with the BLS signature scheme over the BN256 groups. It implements the relevant Handel interfaces: PublicKey, Secretkey and Signature. The BN256 implementations comes from the cloudflare/bn256 package, including the base points..
Index ¶
Constants ¶
This section is empty.
Variables ¶
var G2Base *bn256.G2
G2Base is the base point specified for the G2 group. If one wants to use a different point, set this variable before using any public methods / structs of this package.
var Hash = sha256.New
Hash is the hash function used to hash the message prior to signing
Functions ¶
Types ¶
type Constructor ¶
type Constructor struct { }
Constructor implements the handel.Constructor interface
func NewConstructor ¶
func NewConstructor() *Constructor
NewConstructor returns a handel.Constructor capable of creating empty BLS signature object and empty public keys.
func (*Constructor) PublicKey ¶
func (s *Constructor) PublicKey() handel.PublicKey
PublicKey implements the handel.Constructor interface
func (*Constructor) SecretKey ¶
func (s *Constructor) SecretKey() handel.SecretKey
SecretKey implements the simul/lib/Constructor interface
func (*Constructor) Signature ¶
func (s *Constructor) Signature() handel.Signature
Signature implements the handel.Constructor interface
type PublicKey ¶
type PublicKey struct {
// contains filtered or unexported fields
}
PublicKey holds the public key information = point in G2
func (*PublicKey) MarshalBinary ¶
MarshalBinary implements the simul/lib/PublicKey interface
func (*PublicKey) UnmarshalBinary ¶
UnmarshalBinary implements the simul/lib/PublicKey interface
func (*PublicKey) VerifySignature ¶
VerifySignature checks the given BLS signature bls on the message m using the public key p by verifying that the equality e(H(m), X) == e(H(m), x*B2) == e(x*H(m), B2) == e(S, B2) holds where e is the pairing operation and B2 is the base point from curve G2.
type SecretKey ¶
type SecretKey struct {
// contains filtered or unexported fields
}
SecretKey holds the secret scalar and can return the corresponding public key. It can sign messages using the BLS signature scheme.
func (*SecretKey) MarshalBinary ¶
MarshalBinary implements the simul/lib/SecretKey interface
func (*SecretKey) Sign ¶
Sign creates a BLS signature S = x * H(m) on a message m using the private key x. The signature S is a point on curve G1.
func (*SecretKey) UnmarshalBinary ¶
UnmarshalBinary implements the simul/lib/SecretKey interface
type SigBLS ¶
type SigBLS struct {
// contains filtered or unexported fields
}
SigBLS represents a BLS signature using the BN256 curves
func (*SigBLS) MarshalBinary ¶
MarshalBinary implements the handel.Signature interface
func (*SigBLS) UnmarshalBinary ¶
UnmarshalBinary implements the handel.Signature interface