public static byte[] ComputePublicKey(byte[] publicGenBytes, uint accountNumber) { ECPoint rootPubPoint = Secp256K1.Curve().DecodePoint(publicGenBytes); BigInteger scalar = ComputeScalar(publicGenBytes, accountNumber); ECPoint point = Secp256K1.BasePoint().Multiply(scalar); ECPoint offset = rootPubPoint.Add(point); return offset.GetEncoded(true); }
/// /// <param name="secretKey"> secret point on the curve as BigInteger </param> /// <returns> corresponding public point </returns> public static ECPoint ComputePublicKey(BigInteger secretKey) { return(Secp256K1.BasePoint().Multiply(secretKey)); }