Sign array of hex data deterministically using deterministic k.

@param string[] $hexDataToSign
@param PrivateKeyInterface|string $privateKey
@return string[]
192246
public static function signMultiple($hexDataToSign, $privateKey)
    {
        ArgumentArrayValidator::validate($hexDataToSign, 'hexDataToSign');

        $signatures = array();
        foreach ($hexDataToSign as $tosign) {
            $signatures[] = self::sign($tosign, $privateKey);
        }
        return $signatures;
    }
391588
public function sign($privateKeys, $coinSymbol)
    {
        if (is_string($privateKeys)) {
            $privateKeys = array($privateKeys);
        }

        // Create PrivateKey objects from plain hex private keys (public keys compressed)
        $privateKeyCompressedList = PrivateKeyList::fromHexPrivateKeyArray($privateKeys, $coinSymbol, true);

        // Create PrivateKey objects from plain hex private keys (public keys uncompressed)
        // Uncompressed keys are not supported by the API, we use them only to check if user is using them and
        // show a specific exception.
        $privateKeyUncompressedList = PrivateKeyList::fromHexPrivateKeyArray($privateKeys, $coinSymbol, false);

        $this->generateSignatures($privateKeyCompressedList, $privateKeyUncompressedList, $coinSymbol);

        return $this;
    }
813038
function sign(private_key, data) {
  var key = new bitcoinjs.ECKey(new BigInteger(private_key, 16), false);
  var hash = bitcoinjs.crypto.hash256(new Buffer(data, 'hex'));
  return key.sign(hash).toDER().toString('hex');
}
866564
public byte[] sign(byte[] data) {
		lock.lock();
		try {
			signature.initSign(this.privateKey);
			signature.update(data);
			return signature.sign();
		} catch (Exception e) {
			throw new CryptoException(e);
		} finally {
			lock.unlock();
		}
	}
726900
public static Sign sign(SignAlgorithm algorithm, String privateKeyBase64, String publicKeyBase64) {
		return new Sign(algorithm, privateKeyBase64, publicKeyBase64);
	}
146583
public function sign($hexPrivateKey)
    {
        $this->setSignatures(Signer::signMultiple($this->tosign, $hexPrivateKey));
        return $this;
    }
30174
private function verifyOpenSSLSignature(JWKInterface $key, $data, $R, $S)
    {
        $pem = ECKey::toPublic(new ECKey($key))->toPEM();

        $oid_sequence = new Sequence();
        $oid_sequence->addChildren([
            new Integer(gmp_strval($this->convertHexToGmp($R), 10)),
            new Integer(gmp_strval($this->convertHexToGmp($S), 10)),
        ]);

        return 1 === openssl_verify($data, $oid_sequence->getBinary(), $pem, $this->getHashAlgorithm());
    }
1213631
public function sign($contents, $privateKey)
    {
        $rsa = new RSA();
        $rsa->loadKey($privateKey);

        $rsa->setSignatureMode(RSA::SIGNATURE_PKCS1);

        return $rsa->sign($contents);
    }
325309
public function signTokenRequest(TokenRequest $tokenRequest, $privateKey)
    {
        openssl_sign($tokenRequest->getIssuer() . ':' . $tokenRequest->getUsername(), $signature, $privateKey);

        return $tokenRequest->setSignature(base64_encode($signature));
    }
338400
public function signStream($stream, $privateKey)
    {
        try {
            $virgilSourceStream = new VirgilStreamDataSource($stream);
            $virgilSourceStream->reset();

            return (new CryptoVirgilStreamSigner($this->hashAlgorithm))->sign(
                $virgilSourceStream,
                $privateKey
            );
        } catch (Exception $exception) {
            throw new ContentSigningException($exception->getMessage(), $exception->getCode());
        }
    }
301842
public static function opensslSign(
        $str,
        $privateKeyPath,
        $algo = OPENSSL_ALGO_SHA1,
        $passPhrase = '',
        $format = self::FORMAT_HEX

    )
    {
        $privateKey = openssl_pkey_get_private(file_get_contents($privateKeyPath), $passPhrase);

        openssl_sign(trim($str), $singature, $privateKey, $algo);

        openssl_free_key($privateKey);

        $singature = trim($singature);

        switch ($format) {
            case self::FORMAT_HEX:
                return bin2hex($singature);
            case self::FORMAT_BASE64:
                return EncodeHelper::base64Encode($singature);
        }

        return bin2hex(trim($singature));
    }
89667
public function parseCoordinatePairFromPublicKey($pubkey)
    {
        return array(
                    'x' => $this->addHexPrefix(substr($pubkey, 0, 64)),
                    'y' => $this->addHexPrefix(substr($pubkey, 64))
                    );
    }
151447
static String sign(String data, String key, String algorithm) {
        try {
            Mac mac = Mac.getInstance(algorithm);
            mac.init(new SecretKeySpec(key.getBytes(DEFAULT_ENCODING), algorithm));
            byte[] signature = Base64.encodeBase64(mac.doFinal(data.getBytes(DEFAULT_ENCODING)));
            String encoded = new String(signature, DEFAULT_ENCODING);
            //log.debug("\nSign:"+data+"\nKey:"+key+"\nAlgorithm:"+algorithm+"\nSignature:"+encoded);
            return encoded;
        } catch (Exception e) {
            throw MwsUtl.wrap(e);
        }
    }
1069526
def sign_with_privkey(
    digest: bytes,
    privkey: Ed25519PrivateKey,
    global_pubkey: Ed25519PublicPoint,
    nonce: int,
    global_commit: Ed25519PublicPoint,
) -> Ed25519Signature:
    
    h = _ed25519.H(privkey)
    a = _ed25519.decodecoord(h)

    S = (nonce + _ed25519.Hint(global_commit + global_pubkey + digest) * a) % _ed25519.l
    return Ed25519Signature(_ed25519.encodeint(S))
801570
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;
    }
468586
private function getHexFingerprintFromSshPublicKey ($publickey)
    {
        $content = explode(' ', $publickey, 3);
        return implode(':', str_split(md5(base64_decode($content[1])), 2));
    }
112091
def sign(xml, private, public):
    '''
    
    '''
    xml = xml.encode('utf-8', 'xmlcharrefreplace')
    signed_info_xml = _generate_signed_info(xml)

    signer = PKCS1_v1_5.PKCS115_SigScheme(private)
    signature_value = signer.sign(SHA.new(c14n(signed_info_xml)))

    signature_xml = PTN_SIGNATURE_XML % {
        'signed_info_xml': signed_info_xml,
        'signature_value': binascii.b2a_base64(signature_value)[:-1],
        'key_info_xml': _generate_key_info_xml_rsa(public.key.n, public.key.e)
    }

    position = xml.rfind('</')
    return xml[0:position] + signature_xml + xml[position:]