prysm-pulse/shared/bls/bls_test.go
Raul Jordan f2bc9e0352
BLS Public API (#676)
* public bls api

* added basic tests

* merge master
2018-10-18 00:44:00 -05:00

48 lines
1.0 KiB
Go

package bls
import (
"testing"
)
func TestSign(t *testing.T) {
sk := &SecretKey{}
msg := []byte{}
if _, err := Sign(sk, msg); err != nil {
t.Errorf("Expected nil error, received %v", err)
}
}
func TestVerifySig(t *testing.T) {
pk := &PublicKey{}
msg := []byte{}
sig := &Signature{}
if _, err := VerifySig(pk, msg, sig); err != nil {
t.Errorf("Expected nil error, received %v", err)
}
}
func TestVerifyAggregateSig(t *testing.T) {
pk := &PublicKey{}
msg := []byte{}
asig := &Signature{}
if _, err := VerifyAggregateSig([]*PublicKey{pk}, msg, asig); err != nil {
t.Errorf("Expected nil error, received %v", err)
}
}
func TestBatchVerify(t *testing.T) {
pk := &PublicKey{}
msg := []byte{}
sig := &Signature{}
if _, err := BatchVerify([]*PublicKey{pk}, msg, []*Signature{sig}); err != nil {
t.Errorf("Expected nil error, received %v", err)
}
}
func TestAggregateSigs(t *testing.T) {
sig := &Signature{}
if _, err := AggregateSigs([]*Signature{sig}); err != nil {
t.Errorf("Expected nil error, received %v", err)
}
}