Exemplo n.º 1
0
        public override bool Verify(byte[] message, IEnumerable <Address> addresses)
        {
            foreach (var address in addresses)
            {
                if (!address.IsUser)
                {
                    continue;
                }

                if (Ed25519.Verify(this.Bytes, message, address.PublicKey))
                {
                    return(true);
                }
            }

            return(false);
        }
Exemplo n.º 2
0
        public override bool Verify(byte[] message, IEnumerable <Address> addresses)
        {
            foreach (var address in addresses)
            {
                if (!address.IsUser)
                {
                    continue;
                }

                var pubKey = address.ToByteArray().Skip(2).ToArray();
                if (Ed25519.Verify(this.Bytes, message, pubKey))
                {
                    return(true);
                }
            }

            return(false);
        }
Exemplo n.º 3
0
        public static Ed25519Signature Generate(IKeyPair keypair, byte[] message)
        {
            var sign = Ed25519.Sign(message, Ed25519.ExpandedPrivateKeyFromSeed(keypair.PrivateKey));

            return(new Ed25519Signature(sign));
        }