From patchwork Thu Oct 29 15:59:25 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jarkko Sakkinen X-Patchwork-Id: 7519731 Return-Path: X-Original-To: patchwork-tpmdd-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D01E09F36A for ; Thu, 29 Oct 2015 16:00:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0C09E2080D for ; Thu, 29 Oct 2015 16:00:06 +0000 (UTC) Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1C2152080C for ; Thu, 29 Oct 2015 16:00:04 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=sfs-ml-4.v29.ch3.sourceforge.com) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1ZrpcR-0007k6-7g; Thu, 29 Oct 2015 16:00:03 +0000 Received: from sog-mx-2.v43.ch3.sourceforge.com ([172.29.43.192] helo=mx.sourceforge.net) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1ZrpcQ-0007k1-Hp for tpmdd-devel@lists.sourceforge.net; Thu, 29 Oct 2015 16:00:02 +0000 X-ACL-Warn: Received: from mga14.intel.com ([192.55.52.115]) by sog-mx-2.v43.ch3.sourceforge.com with esmtp (Exim 4.76) id 1ZrpcP-0005v9-Es for tpmdd-devel@lists.sourceforge.net; Thu, 29 Oct 2015 16:00:02 +0000 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP; 29 Oct 2015 08:59:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,214,1444719600"; d="scan'208";a="806638367" Received: from unknown (HELO localhost) ([10.252.20.230]) by orsmga001.jf.intel.com with ESMTP; 29 Oct 2015 08:59:48 -0700 From: Jarkko Sakkinen To: Peter Huewe , Marcel Selhorst , Mimi Zohar , David Howells Date: Thu, 29 Oct 2015 17:59:25 +0200 Message-Id: <1446134370-11460-2-git-send-email-jarkko.sakkinen@linux.intel.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1446134370-11460-1-git-send-email-jarkko.sakkinen@linux.intel.com> References: <1446134370-11460-1-git-send-email-jarkko.sakkinen@linux.intel.com> X-Spam-Score: -0.0 (/) X-Headers-End: 1ZrpcP-0005v9-Es Cc: Herbert Xu , "open list:ABI/API" , linux-kernel@vger.kernel.org, josh@joshtriplett.org, seth.forshee@canonical.com, linux-security-module@vger.kernel.org, tpmdd-devel@lists.sourceforge.net, keyrings@vger.kernel.org, "open list:CRYPTO API" , colin.king@canonical.com, "David S. Miller" , chris.j.arges@canonical.com Subject: [tpmdd-devel] [PATCH v1 1/4] crypto: add entry for sm3-256 X-BeenThere: tpmdd-devel@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: Tpm Device Driver maintainance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: tpmdd-devel-bounces@lists.sourceforge.net X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, HK_RANDOM_ENVFROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Added entry for sm3-256 to the following tables: * hash_algo_name * hash_digest_size Needed for TPM 2.0 trusted key sealing. Signed-off-by: Jarkko Sakkinen --- crypto/hash_info.c | 2 ++ include/crypto/hash_info.h | 3 +++ include/uapi/linux/hash_info.h | 1 + 3 files changed, 6 insertions(+) diff --git a/crypto/hash_info.c b/crypto/hash_info.c index 3e7ff46..6f3a113 100644 --- a/crypto/hash_info.c +++ b/crypto/hash_info.c @@ -31,6 +31,7 @@ const char *const hash_algo_name[HASH_ALGO__LAST] = { [HASH_ALGO_TGR_128] = "tgr128", [HASH_ALGO_TGR_160] = "tgr160", [HASH_ALGO_TGR_192] = "tgr192", + [HASH_ALGO_SM3_256] = "sm3-256", }; EXPORT_SYMBOL_GPL(hash_algo_name); @@ -52,5 +53,6 @@ const int hash_digest_size[HASH_ALGO__LAST] = { [HASH_ALGO_TGR_128] = TGR128_DIGEST_SIZE, [HASH_ALGO_TGR_160] = TGR160_DIGEST_SIZE, [HASH_ALGO_TGR_192] = TGR192_DIGEST_SIZE, + [HASH_ALGO_SM3_256] = SM3_256_DIGEST_SIZE, }; EXPORT_SYMBOL_GPL(hash_digest_size); diff --git a/include/crypto/hash_info.h b/include/crypto/hash_info.h index e1e5a3e..d86e050 100644 --- a/include/crypto/hash_info.h +++ b/include/crypto/hash_info.h @@ -34,6 +34,9 @@ #define TGR160_DIGEST_SIZE 20 #define TGR192_DIGEST_SIZE 24 +/* not defined in include/crypto/ */ +#define SM3_256_DIGEST_SIZE 32 + extern const char *const hash_algo_name[HASH_ALGO__LAST]; extern const int hash_digest_size[HASH_ALGO__LAST]; diff --git a/include/uapi/linux/hash_info.h b/include/uapi/linux/hash_info.h index ca18c45..ebf8fd8 100644 --- a/include/uapi/linux/hash_info.h +++ b/include/uapi/linux/hash_info.h @@ -31,6 +31,7 @@ enum hash_algo { HASH_ALGO_TGR_128, HASH_ALGO_TGR_160, HASH_ALGO_TGR_192, + HASH_ALGO_SM3_256, HASH_ALGO__LAST };