예제 #1
0
        /// <summary>
        /// Create new Ed25519 signature
        /// </summary>
        /// <param name="signature">Buffer for signature</param>
        /// <param name="message">Message bytes</param>
        /// <param name="expandedPrivateKey">Expanded form of private key</param>
        public static void Sign(ArraySegment <byte> signature, ArraySegment <byte> message, ArraySegment <byte> expandedPrivateKey)
        {
            Contract.Requires <ArgumentNullException>(signature.Array != null && message.Array != null && expandedPrivateKey.Array != null);
            Contract.Requires <ArgumentException>(expandedPrivateKey.Count == ExpandedPrivateKeySize);

            Ed25519Operations.crypto_sign(signature.Array, signature.Offset, message.Array, message.Offset, message.Count, expandedPrivateKey.Array, expandedPrivateKey.Offset);
        }
 /// <summary>
 /// Create new Ed25519 signature
 /// </summary>
 /// <param name="signature">Buffer for signature</param>
 /// <param name="message">Message bytes</param>
 /// <param name="expandedPrivateKey">Expanded form of private key</param>
 public static void Sign(ArraySegment <byte> signature, ArraySegment <byte> message, ArraySegment <byte> expandedPrivateKey)
 {
     Ed25519Operations.crypto_sign(signature.Array, signature.Offset, message.Array, message.Offset, message.Count, expandedPrivateKey.Array, expandedPrivateKey.Offset);
 }