From patchwork Tue Apr 26 05:43:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Balakrishna Garapati X-Patchwork-Id: 66665 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp1419440qge; Mon, 25 Apr 2016 22:44:16 -0700 (PDT) X-Received: by 10.140.98.175 with SMTP id o44mr543466qge.46.1461649456545; Mon, 25 Apr 2016 22:44:16 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id n74si12819457qgn.119.2016.04.25.22.44.15; Mon, 25 Apr 2016 22:44:16 -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 3358461646; Tue, 26 Apr 2016 05:44:15 +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 C734F6162A; Tue, 26 Apr 2016 05:44: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 98E0E610A6; Tue, 26 Apr 2016 05:44:08 +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 004A2610A6 for ; Tue, 26 Apr 2016 05:43:57 +0000 (UTC) Received: by mail-lf0-f52.google.com with SMTP id j11so4819994lfb.1 for ; Mon, 25 Apr 2016 22:43:56 -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=hjurmSYzPlwiaQ8gz3NAVVmKBDynpU2bo2BmJ6ePxMc=; b=kOMMqO5PkCgy5rt0UxLYzVZ3eZV1iXkvByab2qWbkuAqJLLPOfYJNBpNInBfH8Nehl pjmey+OLVbhUf7Weun/8NBK3E+hHyQTFlObG/lbDJ4h/fqPvK/+etP7JxK3RN+pt8ndm PvVPbqhAeRT+6NLjXupo5drMykYhZoWUuJ3ny/r1Q/7IP751htHcgbHmkdA3K7NhG8+q ymi7NuqDEKVlQ5GTqYxxeXMor5M0qWEpptAdv4RYkeWsDub1MsTKLYGQ6zzgt489MyPv tfUKrZ3HKucpaCmcXYbnoMWvnUWAdwfrhXvps7paiVyjEwMCSmQ+ob9QgzKnrxZAfaHC 5KMQ== X-Gm-Message-State: AOPr4FWa8yDc1sHkeegVabEdc2/j+VRlzad7URaNFsoQiAgFPTdqzm0Y/k4+wB9BXyvFTDmGs/o= X-Received: by 10.112.167.161 with SMTP id zp1mr375189lbb.17.1461649435895; Mon, 25 Apr 2016 22:43:55 -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 uh4sm1797779lbb.46.2016.04.25.22.43.55 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 25 Apr 2016 22:43:55 -0700 (PDT) From: Balakrishna Garapati To: lng-odp@lists.linaro.org Date: Tue, 26 Apr 2016 07:43:54 +0200 Message-Id: <1461649434-801-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 PATCHv3 1/2] linux-generic: crypto: capability support 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" Get the available cipher and authentication algorithms in the odp sw implementation. Signed-off-by: Balakrishna Garapati --- v3: capability initialization (Bill) include/odp/api/spec/crypto.h | 8 ++++---- platform/linux-generic/odp_crypto.c | 24 ++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 4 deletions(-) -- 1.9.1 diff --git a/include/odp/api/spec/crypto.h b/include/odp/api/spec/crypto.h index 3e78547..d8123e9 100644 --- a/include/odp/api/spec/crypto.h +++ b/include/odp/api/spec/crypto.h @@ -316,11 +316,11 @@ typedef struct odp_crypto_capability_t { /** Maximum number of crypto sessions */ uint32_t max_sessions; - /** Supported chipher algorithms */ - odp_crypto_cipher_algos_t chiphers; + /** Supported cipher algorithms */ + odp_crypto_cipher_algos_t ciphers; - /** Chipher algorithms implemented with HW offload */ - odp_crypto_cipher_algos_t hw_chiphers; + /** Cipher algorithms implemented with HW offload */ + odp_crypto_cipher_algos_t hw_ciphers; /** Supported authentication algorithms */ odp_crypto_auth_algos_t auths; diff --git a/platform/linux-generic/odp_crypto.c b/platform/linux-generic/odp_crypto.c index 7448575..ffe2988 100644 --- a/platform/linux-generic/odp_crypto.c +++ b/platform/linux-generic/odp_crypto.c @@ -597,6 +597,30 @@ int process_sha256_params(odp_crypto_generic_session_t *session, return 0; } +int odp_crypto_capability(odp_crypto_capability_t *capa) +{ + if (NULL == capa) + return -1; + + /* Initialize crypto capability structure */ + memset(capa, 0, sizeof(odp_crypto_capability_t)); + + capa->ciphers.bit.null = 1; + capa->ciphers.bit.des = 1; + capa->ciphers.bit.trides_cbc = 1; + capa->ciphers.bit.aes128_cbc = 1; + capa->ciphers.bit.aes128_gcm = 1; + + capa->auths.bit.null = 1; + capa->auths.bit.md5_96 = 1; + capa->auths.bit.sha256_128 = 1; + capa->auths.bit.aes128_gcm = 1; + + capa->max_sessions = MAX_SESSIONS; + + return 0; +} + int odp_crypto_session_create(odp_crypto_session_params_t *params, odp_crypto_session_t *session_out,