Exemplo n.º 1
0
void CryptoAlgorithmAES_CBC::decrypt(const CryptoAlgorithmParameters& parameters, const CryptoKey& key, const CryptoOperationData& data, VectorCallback callback, VoidCallback failureCallback, ExceptionCode& ec)
{
    const CryptoAlgorithmAesCbcParams& aesCBCParameters = toCryptoAlgorithmAesCbcParams(parameters);

    if (!keyAlgorithmMatches(aesCBCParameters, key)) {
        ec = NOT_SUPPORTED_ERR;
        return;
    }

    platformDecrypt(aesCBCParameters, toCryptoKeyAES(key), data, WTF::move(callback), WTF::move(failureCallback), ec);
}
Exemplo n.º 2
0
void CryptoAlgorithmAES_CBC::decrypt(const CryptoAlgorithmParameters& parameters, const CryptoKey& key, const CryptoOperationData& data, std::unique_ptr<PromiseWrapper> promise, ExceptionCode& ec)
{
    const CryptoAlgorithmAesCbcParams& aesCBCParameters = toCryptoAlgorithmAesCbcParams(parameters);

    if (!isCryptoKeyAES(key)) {
        ec = NOT_SUPPORTED_ERR;
        return;
    }
    const CryptoKeyAES& aesKey = toCryptoKeyAES(key);

    transformAES_CBC(kCCDecrypt, aesCBCParameters, aesKey, data, std::move(promise));
}