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)
| 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. |
| 25 | func 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) == |