From patchwork Fri Apr 22 14:14:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Balakrishna Garapati X-Patchwork-Id: 66451 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp746870qge; Fri, 22 Apr 2016 07:14:28 -0700 (PDT) X-Received: by 10.107.12.67 with SMTP id w64mr26299155ioi.114.1461334468189; Fri, 22 Apr 2016 07:14:28 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id b3si10164282iob.63.2016.04.22.07.14.27; Fri, 22 Apr 2016 07:14:28 -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 9426568824; Fri, 22 Apr 2016 14:14:27 +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 0C69E687F0; Fri, 22 Apr 2016 14:14:20 +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 CC37D687F9; Fri, 22 Apr 2016 14:14:17 +0000 (UTC) Received: from mail-lf0-f52.google.com (mail-lf0-f52.google.com [209.85.215.52]) by lists.linaro.org (Postfix) with ESMTPS id 764FA6739F for ; Fri, 22 Apr 2016 14:14:03 +0000 (UTC) Received: by mail-lf0-f52.google.com with SMTP id e190so80120295lfe.0 for ; Fri, 22 Apr 2016 07:14:03 -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=IUWuzVfTkBvPl12EvlnqrhEW7dr5NwV2RbSfEAxC3+o=; b=IfOJD9scfK1YtsqEiVGo1ohOhSmcYy4+tqwOFjsrb7JVtbGSh5KTU4wFM28oaHcdId XO2NSSiBS+h7+e88+d6pkf5DEGF/U+RHnrotcvqt9dTq7Vjilpq/Hy5/pTO+SLY1GgkF VPn+gsVwRHXXxiJeShDOfWB1LA/HaC7qDzCqFnHPT191md2sApMdo9hX6OwRleNGkMPj 8aB5OrnzgZff8iwKVPBNLrZnGT5l8oLhWfXuTqvOu3lutFERkfi36bshO5MJU6c4Kzfv 1xm8W+nIgaoiNOAVF9OZSbJsQhzPcBEKYa7yF0LvxJOP2lg1UPVSkfWLJHqLbp4kqFg5 jR+g== X-Gm-Message-State: AOPr4FXWZMVIhuScuEuNZUdTBiitl+g5bdZNJWgtc1qvitoXJhaZHMphG0NYaOmf4Su0R8YqLBM= X-Received: by 10.25.86.144 with SMTP id k138mr8872290lfb.6.1461334442365; Fri, 22 Apr 2016 07:14:02 -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 r130sm1619530lfe.6.2016.04.22.07.14.01 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 22 Apr 2016 07:14:01 -0700 (PDT) From: Balakrishna Garapati To: lng-odp@lists.linaro.org Date: Fri, 22 Apr 2016 16:14:00 +0200 Message-Id: <1461334440-19840-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] 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 fucntionality 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..b608a76 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.trides_cbc)) + rc = -1; + if (cipher_alg == ODP_CIPHER_ALG_AES128_GCM && + !(capability.ciphers.bit.trides_cbc)) + 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));