Esempio n. 1
0
        public static byte[] Sign(byte[] message, byte[] key)
        {
            if (key == null || key.Length != 64)
            {
                throw new KeyOutOfRangeException("key", (key == null) ? 0 : key.Length, string.Format("key must be {0} bytes in length.", 64));
            }
            byte[] array = new byte[message.Length + 64];
            long   num   = 0L;

            SodiumLibrary.crypto_sign(array, ref num, message, (long)message.Length, key);
            byte[] array2 = new byte[num];
            Array.Copy(array, 0L, array2, 0L, num);
            return(array2);
        }