From patchwork Thu Oct 6 13:27:44 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Henrique Cerri X-Patchwork-Id: 678921 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 3sqYPM0ZdQz9sD5; Fri, 7 Oct 2016 00:28:07 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical-com.20150623.gappssmtp.com header.i=@canonical-com.20150623.gappssmtp.com header.b=CXbg7Alh; dkim-atps=neutral Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1bs8iR-0003Mu-Rp; Thu, 06 Oct 2016 13:28:03 +0000 Received: from mail-pa0-f46.google.com ([209.85.220.46]) by huckleberry.canonical.com with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1bs8iK-0003Lh-Fl for kernel-team@lists.ubuntu.com; Thu, 06 Oct 2016 13:27:56 +0000 Received: by mail-pa0-f46.google.com with SMTP id cd13so9140876pac.0 for ; Thu, 06 Oct 2016 06:27:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references; bh=4PFNcKFQGu8Gb9Uv+evmEqQ5kbwuaiFZV7aSchITaZU=; b=CXbg7Alh3ZVAZ65+faDf3q4SFXbHv0pZ77jh2mTpTrFtgag9Q6n/Ukiq8+6+/6Fqex tGc/0Yfj/nxBwm3xXjp+4nr87c/yY9LmtBYzw1N6g1nIehYO4EUM4NIUYIZ5MRENiZhE HG0WZpB6r1nQm6HsluER1Gl06NCPxwdNXb0Hdkv/d428cyAW/yg98eeFgZ6TAGCPxfMf gh/RxRjSTe0Ui6qk8QL8rbQVokktG2nsFUahctSBdnLbHuWJlDW0wF3yC3PrXVmaguJ0 Wnoh6VjwpFW3Rg4QzYxaKnSYXejZq5LI5bNgZMybDedBHLPvVULn3vaNn86/jpE+NVoX WFBQ== 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:in-reply-to :references; bh=4PFNcKFQGu8Gb9Uv+evmEqQ5kbwuaiFZV7aSchITaZU=; b=ARnwzu1rrrPIdSBJsWSJcaOJLx7DJHppEKb2cjfptq4DSMVZcao+Sdk6n8xmZesIwY Tj3WMgBpmSswBb1p7wSZu7DpyZ+tZ8rxbvHxrIdC7Aw8UM/cgVNkJPkw/6XHPT/ucayD P5Xzmer5uPzcpfl7VgfVNqMQSPDmajFq9orZGx/ZQuTDB8rhgC1uVxZUhDKMwFeWeLAW llXjkyZq1t6jT1Tz9/pAkwkf+sB3i133zSMZAtu2KD9iD/D1YaJlfMbpdmyNj/WN77HQ ZvZvR/zPL5Gf84hPyos44gHWxLrHudAairSx7JrvJq7QJF2FN2tYIRLGx0l2vFDkHygt ASzQ== X-Gm-Message-State: AA6/9RlwK1mp9oZSEXM11PDdSZ854dzRVJ3ygWOTqG3FSI2p8GRPOkgPMnNkTSXEHXtWaF8L X-Received: by 10.66.10.102 with SMTP id h6mr22491229pab.112.1475760474577; Thu, 06 Oct 2016 06:27:54 -0700 (PDT) Received: from localhost.localdomain (189-19-121-95.dsl.telesp.net.br. [189.19.121.95]) by smtp.gmail.com with ESMTPSA id f203sm5937608pfa.12.2016.10.06.06.27.52 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 06 Oct 2016 06:27:53 -0700 (PDT) From: Marcelo Cerri To: kernel-team@lists.ubuntu.com Subject: [Xenial][Yakkety][PATCH 1/2] crypto: ghash-generic - move common definitions to a new header file Date: Thu, 6 Oct 2016 10:27:44 -0300 Message-Id: <1475760465-20909-2-git-send-email-marcelo.cerri@canonical.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1475760465-20909-1-git-send-email-marcelo.cerri@canonical.com> References: <1475760465-20909-1-git-send-email-marcelo.cerri@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: kernel-team-bounces@lists.ubuntu.com BugLink: https://bugs.launchpad.net/bugs/1630970 Move common values and types used by ghash-generic to a new header file so drivers can directly use ghash-generic as a fallback implementation. Fixes: cc333cd68dfa ("crypto: vmx - Adding GHASH routines for VMX module") Cc: stable@vger.kernel.org Signed-off-by: Marcelo Cerri Signed-off-by: Herbert Xu (cherry picked from commit a397ba829d7f8aff4c90af3704573a28ccd61a59) Signed-off-by: Marcelo Cerri --- crypto/ghash-generic.c | 13 +------------ include/crypto/ghash.h | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+), 12 deletions(-) create mode 100644 include/crypto/ghash.h diff --git a/crypto/ghash-generic.c b/crypto/ghash-generic.c index bac7099..12ad3e3 100644 --- a/crypto/ghash-generic.c +++ b/crypto/ghash-generic.c @@ -14,24 +14,13 @@ #include #include +#include #include #include #include #include #include -#define GHASH_BLOCK_SIZE 16 -#define GHASH_DIGEST_SIZE 16 - -struct ghash_ctx { - struct gf128mul_4k *gf128; -}; - -struct ghash_desc_ctx { - u8 buffer[GHASH_BLOCK_SIZE]; - u32 bytes; -}; - static int ghash_init(struct shash_desc *desc) { struct ghash_desc_ctx *dctx = shash_desc_ctx(desc); diff --git a/include/crypto/ghash.h b/include/crypto/ghash.h new file mode 100644 index 0000000..2a61c9b --- /dev/null +++ b/include/crypto/ghash.h @@ -0,0 +1,23 @@ +/* + * Common values for GHASH algorithms + */ + +#ifndef __CRYPTO_GHASH_H__ +#define __CRYPTO_GHASH_H__ + +#include +#include + +#define GHASH_BLOCK_SIZE 16 +#define GHASH_DIGEST_SIZE 16 + +struct ghash_ctx { + struct gf128mul_4k *gf128; +}; + +struct ghash_desc_ctx { + u8 buffer[GHASH_BLOCK_SIZE]; + u32 bytes; +}; + +#endif