Exemple #1
0
        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));
        }
Exemple #2
0
 ///
 /// <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));
 }