From patchwork Mon Apr 25 08:30:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Balakrishna Garapati X-Patchwork-Id: 66565 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp912173qge; Mon, 25 Apr 2016 01:30:46 -0700 (PDT) X-Received: by 10.107.146.65 with SMTP id u62mr36808697iod.189.1461573046329; Mon, 25 Apr 2016 01:30:46 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id u126si22255996ioe.109.2016.04.25.01.30.45; Mon, 25 Apr 2016 01:30:46 -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 547BA6198D; Mon, 25 Apr 2016 08:30:45 +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 1E8B06197E; Mon, 25 Apr 2016 08:30:41 +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 D550061987; Mon, 25 Apr 2016 08:30:39 +0000 (UTC) Received: from mail-lf0-f50.google.com (mail-lf0-f50.google.com [209.85.215.50]) by lists.linaro.org (Postfix) with ESMTPS id F26906197C for ; Mon, 25 Apr 2016 08:30:38 +0000 (UTC) Received: by mail-lf0-f50.google.com with SMTP id y84so14714319lfc.0 for ; Mon, 25 Apr 2016 01:30:38 -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=zCznY2XYbHvt9QDK9q0iUH+yn2i3RXIodukRKuNlmUw=; b=ZkvAqc14JI9lIvsGxek3IxZhfGaQVUtB6qqvr7zSMYAx16JnHgQnw8z5a6A5ugXiPH bON3554W3abGGJX5hdUrrzvlrSBZ3mwkD2O99lQdlBWrFSj9PfS9gJnZ8bgy3u0+38ia mxaNN4s07GpNeM3VGTdWyI1pWRNDRGFSbqXMLJRpo8QSJoSRP3IvIrceU8gUm4h6+PIc wTYwrBlcX2kPPNaXZW681AxTOSePDaMGgj5d2lBq/EnPa3dPNUZBQ+7A91WrgeEUQnQx CWqUSYSOLoMp1sRKbwGMFblHJKoT9R3z/YRT/6hgJKSiVZf1SIVIVfmT0kLDyAD7QvoV a9Gg== X-Gm-Message-State: AOPr4FUlfHfqk+kLm/wrCSy+zn+aO2UmdIrSuCAo7X+A2bA5MzTnydm4WXCnnWt/41NeZzcx+Kg= X-Received: by 10.25.146.65 with SMTP id u62mr4620183lfd.121.1461573037430; Mon, 25 Apr 2016 01:30:37 -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 s63sm4165806lfs.17.2016.04.25.01.30.36 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 25 Apr 2016 01:30:36 -0700 (PDT) From: Balakrishna Garapati To: lng-odp@lists.linaro.org Date: Mon, 25 Apr 2016 10:30:35 +0200 Message-Id: <1461573035-20748-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 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 --- include/odp/api/spec/crypto.h | 8 ++++---- platform/linux-generic/odp_crypto.c | 25 +++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 4 deletions(-) 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..89488fd 100644 --- a/platform/linux-generic/odp_crypto.c +++ b/platform/linux-generic/odp_crypto.c @@ -597,6 +597,31 @@ 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; + + 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; + + /* turn off the hw offload capability */ + capa->hw_ciphers.all_bits = 0; + capa->hw_auths.all_bits = 0; + + capa->max_sessions = MAX_SESSIONS; + + return 0; +} + int odp_crypto_session_create(odp_crypto_session_params_t *params, odp_crypto_session_t *session_out,