From patchwork Mon Oct 12 16:53:46 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin Labbe X-Patchwork-Id: 7377821 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: X-Original-To: patchwork-linux-crypto@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 E25E59F1D5 for ; Mon, 12 Oct 2015 16:55:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0DD73208AF for ; Mon, 12 Oct 2015 16:55:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2175E2075A for ; Mon, 12 Oct 2015 16:55:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752201AbbJLQyv (ORCPT ); Mon, 12 Oct 2015 12:54:51 -0400 Received: from mail-wi0-f180.google.com ([209.85.212.180]:33677 "EHLO mail-wi0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752129AbbJLQyh (ORCPT ); Mon, 12 Oct 2015 12:54:37 -0400 Received: by wicge5 with SMTP id ge5so25417992wic.0; Mon, 12 Oct 2015 09:54:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=st/ewWdvDmqNZVt8qSVzoE0vMf6r5A8dte28s8No2KQ=; b=ahiTWySFn3frLO5zKu4vodyvo3qLneBtKrzvsNEgUVsQitrv4MYV6z2+u7+WRZwNlD uuiNOOvK1/KochHQihEL9hgFqy2ZjwuHz3EZGW9LbroCLUU2MC9AeyRFE8TXZX+91baw NsurO57ihw9Em/EYUxW0kc17ZkyVFc7hyLh04PWaCqXIls808+/5HpaAKI7i02XlKoNT eQhCkX57alm6weRWld0zFidg2/B0scRFqK963y9GcPOdFutSXNvMOu+8NNaGw93xf2Vb 1AeTLeRNeySJBdjY3nCm3caKX2W1iRyNs/fWQwLK8nSgNxipHNZqcKd9C2uKqIfJzt8Y oAeA== X-Received: by 10.180.81.228 with SMTP id d4mr16339313wiy.38.1444668876391; Mon, 12 Oct 2015 09:54:36 -0700 (PDT) Received: from Red.local (ANice-651-1-429-185.w83-201.abo.wanadoo.fr. [83.201.253.185]) by smtp.googlemail.com with ESMTPSA id s16sm11548506wik.16.2015.10.12.09.54.35 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 12 Oct 2015 09:54:36 -0700 (PDT) From: LABBE Corentin To: herbert@gondor.apana.org.au, davem@davemloft.net, thomas.lendacky@amd.com, geert+renesas@glider.be, ulf.hansson@linaro.org, wsa@the-dreams.de, keescook@chromium.org, maxime.ripard@free-electrons.com Cc: linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, LABBE Corentin Subject: [PATCH 8/8] crypto: testmgr: Use the xxx_zero_message_hash from headers Date: Mon, 12 Oct 2015 18:53:46 +0200 Message-Id: <1444668826-6531-9-git-send-email-clabbe.montjoie@gmail.com> X-Mailer: git-send-email 2.4.9 In-Reply-To: <1444668826-6531-1-git-send-email-clabbe.montjoie@gmail.com> References: <1444668826-6531-1-git-send-email-clabbe.montjoie@gmail.com> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 Since md5/shaxxx headers have hash for zero message length, just use them. Signed-off-by: LABBE Corentin --- crypto/testmgr.h | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/crypto/testmgr.h b/crypto/testmgr.h index 03b2f19..9585854 100644 --- a/crypto/testmgr.h +++ b/crypto/testmgr.h @@ -367,8 +367,7 @@ static struct hash_testvec md4_tv_template [] = { static struct hash_testvec md5_tv_template[] = { { - .digest = "\xd4\x1d\x8c\xd9\x8f\x00\xb2\x04" - "\xe9\x80\x09\x98\xec\xf8\x42\x7e", + .digest = md5_zero_message_hash, }, { .plaintext = "a", .psize = 1, @@ -713,8 +712,7 @@ static struct hash_testvec sha1_tv_template[] = { { .plaintext = "", .psize = 0, - .digest = "\xda\x39\xa3\xee\x5e\x6b\x4b\x0d\x32\x55" - "\xbf\xef\x95\x60\x18\x90\xaf\xd8\x07\x09", + .digest = sha1_zero_message_hash, }, { .plaintext = "abc", .psize = 3, @@ -905,10 +903,7 @@ static struct hash_testvec sha224_tv_template[] = { { .plaintext = "", .psize = 0, - .digest = "\xd1\x4a\x02\x8c\x2a\x3a\x2b\xc9" - "\x47\x61\x02\xbb\x28\x82\x34\xc4" - "\x15\xa2\xb0\x1f\x82\x8e\xa6\x2a" - "\xc5\xb3\xe4\x2f", + .digest = sha224_zero_message_hash, }, { .plaintext = "abc", .psize = 3, @@ -1079,10 +1074,7 @@ static struct hash_testvec sha256_tv_template[] = { { .plaintext = "", .psize = 0, - .digest = "\xe3\xb0\xc4\x42\x98\xfc\x1c\x14" - "\x9a\xfb\xf4\xc8\x99\x6f\xb9\x24" - "\x27\xae\x41\xe4\x64\x9b\x93\x4c" - "\xa4\x95\x99\x1b\x78\x52\xb8\x55", + .digest = sha256_zero_message_hash, }, { .plaintext = "abc", .psize = 3,