MCPcopy Create free account
hub / github.com/DOSNetwork/core / TestBLSFailSig

Function TestBLSFailSig

sign/bls/bls_test.go:22–31  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

20}
21
22func TestBLSFailSig(t *testing.T) {
23 msg := []byte("Hello Boneh-Lynn-Shacham")
24 private, public := NewKeyPair(suite, random.New())
25 sig, err := Sign(suite, private, msg)
26 require.Nil(t, err)
27 sig[0] ^= 0x01
28 if Verify(suite, public, msg, sig) == nil {
29 t.Fatal("bls: verification succeeded unexpectedly")
30 }
31}
32
33func TestBLSFailKey(t *testing.T) {
34 msg := []byte("Hello Boneh-Lynn-Shacham")

Callers

nothing calls this directly

Calls 5

NewKeyPairFunction · 0.85
SignFunction · 0.70
VerifyFunction · 0.70
NewMethod · 0.65
FatalMethod · 0.65

Tested by

no test coverage detected