net/txgbe: fix queue statistics mapping
[dpdk.git] / drivers / crypto / qat / qat_asym.c
index badf018..479d530 100644 (file)
@@ -205,7 +205,7 @@ modexp_set_input(struct rte_crypto_asym_op *asym_op,
                struct rte_crypto_asym_xform *xform)
 {
        struct qat_asym_function qat_function;
-       uint32_t alg_bytesize, func_id;
+       uint32_t alg_bytesize, func_id, in_bytesize;
        int status = 0;
 
        CHECK_IF_NOT_EMPTY(xform->modex.modulus, "mod exp",
@@ -215,7 +215,15 @@ modexp_set_input(struct rte_crypto_asym_op *asym_op,
        if (status)
                return status;
 
-       qat_function = get_asym_function(xform);
+       if (asym_op->modex.base.length > xform->modex.exponent.length &&
+               asym_op->modex.base.length > xform->modex.modulus.length) {
+               in_bytesize = asym_op->modex.base.length;
+       } else if (xform->modex.exponent.length > xform->modex.modulus.length)
+               in_bytesize = xform->modex.exponent.length;
+       else
+               in_bytesize = xform->modex.modulus.length;
+
+       qat_function = get_modexp_function2(in_bytesize);
        func_id = qat_function.func_id;
        if (qat_function.func_id == 0) {
                QAT_LOG(ERR, "Cannot obtain functionality id");
@@ -1183,7 +1191,6 @@ session_clear_modinv(struct rte_crypto_modinv_xform *modinv)
 static void
 session_clear_rsa(struct rte_crypto_rsa_xform *rsa)
 {
-       return;
        memset(rsa->n.data, 0, rsa->n.length);
        rte_free(rsa->n.data);
        memset(rsa->e.data, 0, rsa->e.length);