hashToPoint hashes a message to a point on curve G1. XXX: This should be replaced eventually by a proper hash-to-point mapping like Elligator.
(suite suites.Suite, msg []byte)
| 52 | // hashToPoint hashes a message to a point on curve G1. XXX: This should be replaced |
| 53 | // eventually by a proper hash-to-point mapping like Elligator. |
| 54 | func hashToPoint(suite suites.Suite, msg []byte) kyber.Point { |
| 55 | hash := sha3.NewKeccak256() |
| 56 | var buf []byte |
| 57 | hash.Write(msg) |
| 58 | buf = hash.Sum(buf) |
| 59 | x := suite.G1().Scalar().SetBytes(buf) |
| 60 | point := suite.G1().Point().Mul(x, nil) |
| 61 | return point |
| 62 | } |