pointAddScalar function
Point Add Scalar
Implementation
Uint8List? pointAddScalar(Uint8List p, Uint8List tweak, bool _compressed) {
if (!isPoint(p)) throw ArgumentError(_throwBadPoint);
if (!isOrderScalar(tweak)) throw ArgumentError(_throwBadTweak);
bool compressed = assumeCompression(_compressed, p);
ECPoint? pp = decodeFrom(p);
if (_compare(tweak, _zero32) == 0) return getEncoded(pp, compressed);
BigInt tt = fromBuffer(tweak);
ECPoint qq = (_g * tt) as ECPoint;
ECPoint uu = (pp! + qq) as ECPoint;
if (uu.isInfinity) return null;
return getEncoded(uu, compressed);
}