From patchwork Tue Nov 6 21:00:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vitaly Chikunov X-Patchwork-Id: 10671393 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C01591709 for ; Tue, 6 Nov 2018 21:01:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B04A62B249 for ; Tue, 6 Nov 2018 21:01:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A3A162B259; Tue, 6 Nov 2018 21:01:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C7B7D2B249 for ; Tue, 6 Nov 2018 21:01:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726739AbeKGG2c (ORCPT ); Wed, 7 Nov 2018 01:28:32 -0500 Received: from vmicros1.altlinux.org ([194.107.17.57]:53762 "EHLO vmicros1.altlinux.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726724AbeKGG2c (ORCPT ); Wed, 7 Nov 2018 01:28:32 -0500 Received: from imap.altlinux.org (imap.altlinux.org [194.107.17.38]) by vmicros1.altlinux.org (Postfix) with ESMTP id 79E7172CC62; Wed, 7 Nov 2018 00:01:22 +0300 (MSK) Received: from beacon.altlinux.org (unknown [185.6.174.98]) by imap.altlinux.org (Postfix) with ESMTPSA id D3B2B4A4A29; Wed, 7 Nov 2018 00:01:21 +0300 (MSK) From: Vitaly Chikunov To: Herbert Xu , "David S. Miller" , Mimi Zohar , Vitaly Chikunov , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Cc: linux-integrity@vger.kernel.org Subject: [PATCH v4 0/3] crypto: streebog - add Streebog hash function Date: Wed, 7 Nov 2018 00:00:00 +0300 Message-Id: <20181106210008.11241-1-vt@altlinux.org> X-Mailer: git-send-email 2.11.0 Sender: linux-integrity-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-integrity@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add GOST/IETF Streebog hash function (GOST R 34.11-2012, RFC 6986) generic hash transformation with appropriate testmgr and tcrypt tests and vectors. Streebog Hash Function (GOST R 34.11-2012, RFC 6986) is one of the Russian cryptographic standard algorithms (called GOST algorithms). Intended user is the IMA subsystem, which does not need any particular patching besides adding the hash names into Hash Info arrays, this is also done in this patchset. References: https://tc26.ru/upload/iblock/fed/feddbb4d26b685903faa2ba11aea43f6.pdf https://tools.ietf.org/html/rfc6986 Tested using testmgr and tcrypt on (LE) x86_64, arm, arm64, and (BE) s390x in qemu. Changes from v1: - Fix of big-endian problem in add512. - More architectures are tested, including big-endian and 32-bit. Changes from v2: - Register hash in Hash Info for use by IMA. - Add hmac() tests. Changes from v3: - Remove not needed includes, and register, inline, const, ULL, and __aligned specifiers. - Covert define macros into functions. - Use block size define instead of a number. - Rename algorithm names sb256, sb512 to streebog256, streebog512. - Rename bufsize to a more meaningful name (fillsize). - Prefix all static functions names with streebog_. Vitaly Chikunov (3): crypto: streebog - add Streebog hash function crypto: streebog - register Streebog in hash info for IMA crypto: streebog - add Streebog test vectors crypto/Kconfig | 12 + crypto/Makefile | 1 + crypto/hash_info.c | 4 + crypto/streebog_generic.c | 1140 ++++++++++++++++++++++++++++++++++++++++ crypto/tcrypt.c | 37 ++ crypto/testmgr.c | 24 + crypto/testmgr.h | 116 ++++ include/crypto/hash_info.h | 1 + include/crypto/streebog.h | 34 ++ include/uapi/linux/hash_info.h | 2 + 10 files changed, 1371 insertions(+) create mode 100644 crypto/streebog_generic.c create mode 100644 include/crypto/streebog.h