public byte[] SignMessage(byte[] message, SignerKeyPair key) { var signedMessage = new byte[message.Length + _bytes]; long signedMessageRealLength = 0; var result = PlatformInvoke32.crypto_sign(signedMessage, ref signedMessageRealLength, message, message.Length, key.SecretKeyBytes); if (result != 0) throw new CryptographicException("Failed"); Array.Resize(ref signedMessage, (int)signedMessageRealLength); return signedMessage; }
public byte[] SignMessage(byte[] message, SignerKeyPair key) { var signedMessage = new byte[message.Length + _bytes]; long signedMessageRealLength = 0; var result = PlatformInvoke64.crypto_sign(signedMessage, ref signedMessageRealLength, message, message.Length, key.SecretKeyBytes); if (result != 0) { throw new CryptographicException("Failed"); } Array.Resize(ref signedMessage, (int)signedMessageRealLength); return(signedMessage); }