INNER CODE UNIT · Go
blindGroupElement
lightningnetwork/lightning-onion · crypto.go:185
func blindGroupElement(hopPubKey *btcec.PublicKey, blindingFactor btcec.ModNScalar) *btcec.PublicKey {
var hopPubKeyJ btcec.JacobianPoint
hopPubKey.AsJacobian(&hopPubKeyJ)
var blindedPoint btcec.JacobianPoint
btcec.ScalarMultNonConst(
&blindingFactor, &hopPubKeyJ, &blindedPoint,
)
blindedPoint.ToAffine()
return btcec.NewPublicKey(&blindedPoint.X, &blindedPoint.Y)
}
// blindBaseElement blinds the groups's generator G by performing scalar base
// multiplication using the blindingFactor: blindingFactor * G.
func blindBaseElement(blindingFactor btcec.ModNScalar) *btcec.PublicKey {
// TODO(roasbeef): remove after btcec version bump to add alias for
// this method