From patchwork Fri Apr 22 14:13:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Balakrishna Garapati X-Patchwork-Id: 66450 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp746583qge; Fri, 22 Apr 2016 07:13:56 -0700 (PDT) X-Received: by 10.107.15.14 with SMTP id x14mr24559500ioi.139.1461334435769; Fri, 22 Apr 2016 07:13:55 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id k7si4306075igd.36.2016.04.22.07.13.55; Fri, 22 Apr 2016 07:13:55 -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 41717687F4; Fri, 22 Apr 2016 14:13:55 +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 3BF736739F; Fri, 22 Apr 2016 14:13:51 +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 0A904687ED; Fri, 22 Apr 2016 14:13:49 +0000 (UTC) Received: from mail-lf0-f41.google.com (mail-lf0-f41.google.com [209.85.215.41]) by lists.linaro.org (Postfix) with ESMTPS id 005F562E10 for ; Fri, 22 Apr 2016 14:13:46 +0000 (UTC) Received: by mail-lf0-f41.google.com with SMTP id c126so80173380lfb.2 for ; Fri, 22 Apr 2016 07:13:46 -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=P95smH1O06uTYl3oiOimx7OLPDUCsDaN/R85X4xGSJ7W7buMC1UaAUAfuEe7enRDU8 LJjmuwKxvoRD0hITdgHYzIU4Bfrkahrkbaf2ub0rVk1IUdtGGPm5l0IEKlq/WEHYEr+6 EXJjlD9fesezJCuRBZnc6TdLDSf18Aza2Xpk9JfTr6UxcPrBwIIRwjM9GriODSsqM2Db VFyQM1F+CQtlP4RYlr+t0qmbDNoQGqYIFYzpPPOZU2QM+FQqd9D5zFfPPqZ3Ia7/wY7U WH7AxkPSYmxa3M4E1IwP8l+I9T7aT1FHuoyDTqXQywj48bIdM9N0rB7JCqNKQrxUPg7n IF7g== X-Gm-Message-State: AOPr4FWWUNtcuSOos9DXJPU6JyWk82aVC/UysTTD6V+QqCha501zTIy79EI9Tyv3BDnK5uYQYqk= X-Received: by 10.25.21.68 with SMTP id l65mr2718127lfi.44.1461334425378; Fri, 22 Apr 2016 07:13:45 -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 t9sm1594683lfd.28.2016.04.22.07.13.44 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 22 Apr 2016 07:13:44 -0700 (PDT) From: Balakrishna Garapati To: lng-odp@lists.linaro.org Date: Fri, 22 Apr 2016 16:13:42 +0200 Message-Id: <1461334422-19761-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] 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,