예제 #1
0
        /// <summary>
        /// Calculates a Curve25519 signature.
        /// </summary>
        /// <param name="privateKey">The private Curve25519 key to create the signature with.</param>
        /// <param name="message">The message to sign.</param>
        /// <returns>A 64-byte signature.</returns>
        public byte[] calculateSignature(byte[] privateKey, byte[] message)
        {
            if (privateKey == null || privateKey.Length != 32)
            {
                throw new ArgumentException("Invalid private key length!");
            }

            byte[] random = provider.getRandom(64);
            return(calculateSignature(random, privateKey, message));
        }
예제 #2
0
 /**
  * Calculates a Curve25519 signature.
  *
  * @param privateKey The private Curve25519 key to create the signature with.
  * @param message The message to sign.
  * @return A 64-byte signature.
  */
 public byte[] calculateSignature(byte[] privateKey, byte[] message)
 {
     byte[] random = provider.getRandom(64);
     return(calculateSignature(random, privateKey, message));
 }