static int qcrypto_cipher_setiv_aes(QCryptoCipher *cipher,

                                     const uint8_t *iv, size_t niv,

                                     Error **errp)

{

    QCryptoCipherBuiltin *ctxt = cipher->opaque;

    if (niv != 16) {

        error_setg(errp, "IV must be 16 bytes not %zu", niv);

        return -1;

    }



    g_free(ctxt->state.aes.iv);

    ctxt->state.aes.iv = g_new0(uint8_t, niv);

    memcpy(ctxt->state.aes.iv, iv, niv);

    ctxt->state.aes.niv = niv;



    return 0;

}

static int qcrypto_cipher_setiv_aes(QCryptoCipher *cipher,

                                     const uint8_t *iv, size_t niv,

                                     Error **errp)

{

    QCryptoCipherBuiltin *ctxt = cipher->opaque;

    if (niv != 16) {

        error_setg(errp, "IV must be 16 bytes not %zu", niv);

        return -1;

    }



    g_free(ctxt->state.aes.iv);

    ctxt->state.aes.iv = g_new0(uint8_t, niv);

    memcpy(ctxt->state.aes.iv, iv, niv);

    ctxt->state.aes.niv = niv;



    return 0;

}

    g_free(ctxt->state.aes.iv);     if (niv != 16) {         error_setg(errp, "IV must be 16 bytes not %zu", niv);     g_free(ctxt->state.aes.iv);     ctxt->state.aes.iv = g_new0(uint8_t, niv);     memcpy(ctxt->state.aes.iv, iv, niv);     ctxt->state.aes.niv = niv;
static int FUNC_0(QCryptoCipher *VAR_0,

                                     const uint8_t *VAR_1, size_t VAR_2,

                                     Error **VAR_3)

{

    QCryptoCipherBuiltin *ctxt = VAR_0->opaque;

    if (VAR_2 != 16) {

        error_setg(VAR_3, "IV must be 16 bytes not %zu", VAR_2);

        return -1;

    }



    g_free(ctxt->state.aes.VAR_1);

    ctxt->state.aes.VAR_1 = g_new0(uint8_t, VAR_2);

    memcpy(ctxt->state.aes.VAR_1, VAR_1, VAR_2);

    ctxt->state.aes.VAR_2 = VAR_2;



    return 0;

}

static int FUNC_0(QCryptoCipher *VAR_0,
const uint8_t *VAR_1, size_t VAR_2,
Error **VAR_3)
{ QCryptoCipherBuiltin *ctxt = VAR_0->opaque; if (VAR_2 != 16) { error_setg(VAR_3, "IV must be 16 bytes not %zu", VAR_2); return -1; } g_free(ctxt->state.aes.VAR_1); ctxt->state.aes.VAR_1 = g_new0(uint8_t, VAR_2); memcpy(ctxt->state.aes.VAR_1, VAR_1, VAR_2); ctxt->state.aes.VAR_2 = VAR_2; return 0; }