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

Function hashToPoint

sign/bls/bls.go:54–62  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.
54func 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}

Callers 2

SignFunction · 0.85
VerifyFunction · 0.85

Calls 6

G1Method · 0.65
WriteMethod · 0.45
SetBytesMethod · 0.45
ScalarMethod · 0.45
MulMethod · 0.45
PointMethod · 0.45

Tested by

no test coverage detected