From patchwork Mon Apr 25 14:38:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Balakrishna Garapati X-Patchwork-Id: 66592 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp1076616qge; Mon, 25 Apr 2016 07:41:52 -0700 (PDT) X-Received: by 10.140.95.100 with SMTP id h91mr8380022qge.30.1461595312193; Mon, 25 Apr 2016 07:41:52 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id x1si10719498qkb.71.2016.04.25.07.41.51; Mon, 25 Apr 2016 07:41:52 -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 1ECCE6162E; Mon, 25 Apr 2016 14:41:51 +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 5713F618E8; Mon, 25 Apr 2016 14:39:31 +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 9CD9F61606; Mon, 25 Apr 2016 14:38:29 +0000 (UTC) Received: from mail-lf0-f44.google.com (mail-lf0-f44.google.com [209.85.215.44]) by lists.linaro.org (Postfix) with ESMTPS id 6360C6109A for ; Mon, 25 Apr 2016 14:38:28 +0000 (UTC) Received: by mail-lf0-f44.google.com with SMTP id c126so118374249lfb.2 for ; Mon, 25 Apr 2016 07:38:28 -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=dPwpDvWwsQ9TVHL2gme8Qi5vbV7kcjIiTV9yBhS3arZVQIR9iWi9/PaPmYAS8lkm9V uoUy11BJaECA+YTBKMw/E7++kx5BfCZE7fvJrfaYCDsT/0xg8wNmIS5dasbt865qHlnZ F9pO/8YJCJRKc1XZrNBei+mzETCsPZWKqAeeZPBIrMXSTk2ozJvZtTqtHrCN5KjeZLKH mt8MEhZ4x4z09mZk7/JI9JjqDl5DBkgn3YR4Cq1jIQCNfc9Vwlf6DrEL5/W7VP8g+dU1 I3wXoam4w/eQpujzD38E+65hgEa2PoGTbvRvNw74AiTcV6b6LBsFLy5U+22F0/hvHqG1 Yy6g== X-Gm-Message-State: AOPr4FU4SrUcFWhg71hhTykErhEyxmqowVjXPdOBJXdx0eD4z/Fh1xMJSYFWP/QD9MXGdwudnwg= X-Received: by 10.25.165.135 with SMTP id o129mr3081053lfe.162.1461595107061; Mon, 25 Apr 2016 07:38:27 -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 g199sm4505986lfe.30.2016.04.25.07.38.25 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 25 Apr 2016 07:38:26 -0700 (PDT) From: Balakrishna Garapati To: lng-odp@lists.linaro.org Date: Mon, 25 Apr 2016 16:38:14 +0200 Message-Id: <1461595094-15095-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 PATCHv2 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,