code: public static byte[] calculateSignature(byte[] random, byte[] privateKey, byte[] message) {
          byte[] result = new byte[64];
  
          if (curve_sigs.curve25519_sign(SHA512Provider, result, privateKey, message, message.length, random) != 0) {
              throw new IllegalArgumentException("Message exceeds max length!");
          }
  
          return result;
      }
docs: Calculating signature
  
  @param random     random seed for signature
  @param privateKey private key for signature
  @param message    message to sign
  @return signature