예제 #1
0
        public static byte[] SignBytes(byte[] message, byte[] secretPhrase)
        {
            var digest = SimpleHash(secretPhrase);
            var s      = Curve25519.Keygen(digest).S;
            var m      = SimpleHash(message);
            var x      = SimpleHash(m, s);
            var y      = Curve25519.Keygen(x).P;
            var h      = SimpleHash(m, y);
            var v      = Curve25519.Sign(h, x, s);

            return(v.Concat(h).ToArray());
        }
예제 #2
0
        public static byte[] GetPublicKey(byte[] secretPhrase)
        {
            var digest = SimpleHash(secretPhrase);

            return(Curve25519.Keygen(digest).P);
        }