Ejemplo n.º 1
0
 public bool ContainsKey(Cryptography.ECC.ECPoint publicKey)
 {
     return(ContainsKey(publicKey.EncodePoint(true).ToScriptHash()));
 }
Ejemplo n.º 2
0
 public KeyPair GetKey(Cryptography.ECC.ECPoint publicKey)
 {
     return(GetKey(publicKey.EncodePoint(true).ToScriptHash()));
 }
Ejemplo n.º 3
0
 public extern static bool VerifyWithECDsa(ByteString message, Cryptography.ECC.ECPoint pubkey, ByteString signature, NamedCurve curve);
Ejemplo n.º 4
0
 public static UInt160 CreateStandardAccount(Cryptography.ECC.ECPoint pubKey)
 {
     return(Contract.CreateStandardAccount(pubKey));
 }
Ejemplo n.º 5
0
 public extern static bool CheckSig(Cryptography.ECC.ECPoint pubkey, ByteString signature);
 public StealthPubKeys(Cryptography.ECC.ECPoint payloadPubKey, Cryptography.ECC.ECPoint viewPubKey)
 {
     this.PayloadPubKey = payloadPubKey;
     this.ViewPubKey    = viewPubKey;
 }
 public void Deserialize(BinaryReader reader)
 {
     PayloadPubKey = reader.ReadSerializable <Cryptography.ECC.ECPoint>();
     ViewPubKey    = reader.ReadSerializable <Cryptography.ECC.ECPoint>();
 }
Ejemplo n.º 8
0
 public Account GetAccount(Cryptography.ECC.ECPoint publicKey)
 {
     return(GetAccount(publicKey.EncodePoint(true).ToScriptHash()));
 }
 public StealthPubKeys()
 {
     PayloadPubKey = new Cryptography.ECC.ECPoint();
     ViewPubKey    = new Cryptography.ECC.ECPoint();
 }
Ejemplo n.º 10
0
        public static SchnorrSignatureType Generate(byte[] x, Cryptography.ECC.ECPoint P1, Cryptography.ECC.ECPoint P2, int index)
        {
            byte[] a = GenerateRandomScalar();

            if (index == 0)
            {
                Cryptography.ECC.ECPoint L1 = Cryptography.ECC.ECCurve.Secp256r1.G * a;

                byte[] s2 = GenerateRandomScalar();
                byte[] c2 = Crypto.Default.Hash256(L1.EncodePoint(true));

                Cryptography.ECC.ECPoint L2 = Cryptography.ECC.ECCurve.Secp256r1.G * s2 + P2 * c2;

                byte[] c1 = Crypto.Default.Hash256(L2.EncodePoint(true));
                byte[] s1 = ScalarFunctions.MulSub(c1, x, a);

                SchnorrSignatureType retSig = new SchnorrSignatureType(L1, s1, s2);

                return(retSig);
            }
            else if (index == 1)
            {
                Cryptography.ECC.ECPoint L2 = Cryptography.ECC.ECCurve.Secp256r1.G * a;

                byte[] s1 = GenerateRandomScalar();
                byte[] c1 = Crypto.Default.Hash256(L2.EncodePoint(true));

                Cryptography.ECC.ECPoint L1 = Cryptography.ECC.ECCurve.Secp256r1.G * s1 + P1 * c1;

                byte[] c2 = Crypto.Default.Hash256(L1.EncodePoint(true));
                byte[] s2 = ScalarFunctions.MulSub(c2, x, a);

                SchnorrSignatureType retSig = new SchnorrSignatureType(L1, s1, s2);

                return(retSig);
            }
            else
            {
                throw new Exception("SchnorrNonLinkable Index Overload Error!");
            }
        }
Ejemplo n.º 11
0
 public static byte[] PointToScalar(Cryptography.ECC.ECPoint pt)
 {
     return(new byte[0]);
 }
Ejemplo n.º 12
0
 public static extern UInt160 CreateStandardAccount(Cryptography.ECC.ECPoint pubKey);
Ejemplo n.º 13
0
 public static extern bool CheckWitness(Cryptography.ECC.ECPoint pubkey);
Ejemplo n.º 14
0
 public extern static bool Verify(byte[] message, Cryptography.ECC.ECPoint pubkey, byte[] signature);