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

Function Sign

sign/bls/bls.go:25–33  ·  view source on GitHub ↗

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.

(suite suites.Suite, x kyber.Scalar, msg []byte)

Source from the content-addressed store, hash-verified

23// Sign creates a BLS signature S = x * H(m) on a message m using the private
24// key x. The signature S is a point on curve G1.
25func Sign(suite suites.Suite, x kyber.Scalar, msg []byte) ([]byte, error) {
26 HM := hashToPoint(suite, msg)
27 xHM := HM.Mul(x, HM)
28 s, err := xHM.MarshalBinary()
29 if err != nil {
30 return nil, err
31 }
32 return s, nil
33}
34
35// Verify checks the given BLS signature S on the message m using the public
36// key X by verifying that the equality e(H(m), X) == e(H(m), x*B2) ==

Callers 3

TestBLSFunction · 0.70
TestBLSFailSigFunction · 0.70
TestBLSFailKeyFunction · 0.70

Calls 3

hashToPointFunction · 0.85
MulMethod · 0.45
MarshalBinaryMethod · 0.45

Tested by 3

TestBLSFunction · 0.56
TestBLSFailSigFunction · 0.56
TestBLSFailKeyFunction · 0.56