From patchwork Mon Apr 25 08:30:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Balakrishna Garapati X-Patchwork-Id: 66566 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp912353qge; Mon, 25 Apr 2016 01:31:15 -0700 (PDT) X-Received: by 10.107.25.68 with SMTP id 65mr40586360ioz.98.1461573075406; Mon, 25 Apr 2016 01:31:15 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id q74si13952117ioi.158.2016.04.25.01.31.15; Mon, 25 Apr 2016 01:31:15 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id DCB9D61990; Mon, 25 Apr 2016 08:31:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id E09AD61987; Mon, 25 Apr 2016 08:31:10 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 3429561987; Mon, 25 Apr 2016 08:31:09 +0000 (UTC) Received: from mail-lb0-f178.google.com (mail-lb0-f178.google.com [209.85.217.178]) by lists.linaro.org (Postfix) with ESMTPS id B61C76198D for ; Mon, 25 Apr 2016 08:30:52 +0000 (UTC) Received: by mail-lb0-f178.google.com with SMTP id ys16so73874365lbb.3 for ; Mon, 25 Apr 2016 01:30:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=RuIzGj7CYBgFN/TZYwLXHoGm75RgpKK/kPDHhHAWif4=; b=V9oU3ue/CyLXnNw+z3h2vhRoFWE3SnCHQqs91Ilw1+lQ0LLBmV7yEAp/g3Tw3VyfeM qAFwYI8HZy7+IR57yKzeL28/R5JO+FKTlQvO7QO5g1SiQ4gcLYSUZI3/I0ZYRDUDCMQf pZk+oMKKjAK9QtOv9E3bU5++c62Q7J+XFMyHZC/pk7T1y+NUJIBaUU6A1cPCgHi0YfrI lStdt9ORgtzncvS2pLbHL+Zh0hVwCsxAGhiPpKJStp0eAcOBPaHyYfajWYi+OS8mEWml +z89l0ko+xr22KZrTv9wI1a/KKCOYzos6Eg7X0icXML8MGYjLbrfLNxi7lSMINav/t0p +8Ow== X-Gm-Message-State: AOPr4FXuNC4U5cbAF2IwH1ESGWSvktIOnGCPAWqqLMVqr7bKK7OQJQuKEHjvz8T2BcWENP46CN8= X-Received: by 10.112.142.229 with SMTP id rz5mr13763345lbb.111.1461573051507; Mon, 25 Apr 2016 01:30:51 -0700 (PDT) Received: from elxahtkds32.localdomain (host-95-192-62-168.mobileonline.telia.com. [95.192.62.168]) by smtp.gmail.com with ESMTPSA id ez1sm4100618lbc.29.2016.04.25.01.30.50 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 25 Apr 2016 01:30:51 -0700 (PDT) From: Balakrishna Garapati To: lng-odp@lists.linaro.org Date: Mon, 25 Apr 2016 10:30:49 +0200 Message-Id: <1461573049-20884-1-git-send-email-balakrishna.garapati@linaro.org> X-Mailer: git-send-email 1.9.1 X-Topics: crypto patch Subject: [lng-odp] [API-NEXT PATCH 2/2] validation: crypto: verify odp crypto capability X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" test update to verify the crypto capability functionality Signed-off-by: Balakrishna Garapati --- test/validation/crypto/odp_crypto_test_inp.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/test/validation/crypto/odp_crypto_test_inp.c b/test/validation/crypto/odp_crypto_test_inp.c index fc125f7..872746f 100644 --- a/test/validation/crypto/odp_crypto_test_inp.c +++ b/test/validation/crypto/odp_crypto_test_inp.c @@ -46,6 +46,7 @@ static void alg_test(odp_crypto_op_t op, ) { odp_crypto_session_t session; + odp_crypto_capability_t capability; int rc; odp_crypto_ses_create_err_t status; odp_bool_t posted; @@ -53,6 +54,33 @@ static void alg_test(odp_crypto_op_t op, odp_crypto_compl_t compl_event; odp_crypto_op_result_t result; + /* Initialize crypto capability structure */ + memset(&capability, 0, sizeof(odp_crypto_capability_t)); + + rc = odp_crypto_capability(&capability); + CU_ASSERT(!rc); + + if (cipher_alg == ODP_CIPHER_ALG_3DES_CBC && + !(capability.ciphers.bit.trides_cbc)) + rc = -1; + if (cipher_alg == ODP_CIPHER_ALG_AES128_CBC && + !(capability.ciphers.bit.aes128_cbc)) + rc = -1; + if (cipher_alg == ODP_CIPHER_ALG_AES128_GCM && + !(capability.ciphers.bit.aes128_gcm)) + rc = -1; + + CU_ASSERT(!rc); + + if (auth_alg == ODP_AUTH_ALG_AES128_GCM && + !(capability.auths.bit.aes128_gcm)) + rc = -1; + if (auth_alg == ODP_AUTH_ALG_NULL && + !(capability.auths.bit.null)) + rc = -1; + + CU_ASSERT(!rc); + /* Create a crypto session */ odp_crypto_session_params_t ses_params; memset(&ses_params, 0, sizeof(ses_params));