From patchwork Thu Jun 12 15:01:50 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 31833 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f199.google.com (mail-ie0-f199.google.com [209.85.223.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 691FC2054B for ; Thu, 12 Jun 2014 15:02:08 +0000 (UTC) Received: by mail-ie0-f199.google.com with SMTP id rd18sf6667842iec.6 for ; Thu, 12 Jun 2014 08:02:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=fxbWKX0ryY1ocdWNsBCZz6rtpHes6hq5lpgEs1dUB/s=; b=SoDKO9rCghTrSkNAFv+OGqUYt1n40QXImvYF3qa44Rnw5WpSIbxtZDG9yPNPLKTOMI iwc3CKNvewzGfC+L+Z/drBbSDQAicFXRHG0jX+35HTxJ44nUrndBK4xB4ZYA1psbvEz7 Y3OTtvGokEbkM2HUZ6E+zsmfFm+WDRx5P4WGyCYRPgpXO8Hh4rcP+cab6abOHXxxIKAD x5JpPqarHrrTuz51mRbdtndteeyRgmmZqC6es93YHR5EVrWjOQ5EQQ2p2ffFyshi73uV vtMt39pdrLdwhWDfoXqTJPigdDRQNsGCNYdDeEMXZY9b5YMEYBz3L4SXXlXElM5CW41O xlig== X-Gm-Message-State: ALoCoQnJD0KWOYkNYt0GPi8XMVCTIM7PgjIoEys44zQPpzWAaJCL3VmuNsy919+FbemgoFm3zAmH X-Received: by 10.50.67.37 with SMTP id k5mr2208193igt.5.1402585327927; Thu, 12 Jun 2014 08:02:07 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.98.225 with SMTP id o88ls2951514qge.88.gmail; Thu, 12 Jun 2014 08:02:07 -0700 (PDT) X-Received: by 10.52.190.138 with SMTP id gq10mr901691vdc.47.1402585327743; Thu, 12 Jun 2014 08:02:07 -0700 (PDT) Received: from mail-vc0-f180.google.com (mail-vc0-f180.google.com [209.85.220.180]) by mx.google.com with ESMTPS id b8si403581vcf.7.2014.06.12.08.02.07 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 12 Jun 2014 08:02:07 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.180 as permitted sender) client-ip=209.85.220.180; Received: by mail-vc0-f180.google.com with SMTP id im17so922246vcb.39 for ; Thu, 12 Jun 2014 08:02:07 -0700 (PDT) X-Received: by 10.52.139.101 with SMTP id qx5mr8533878vdb.17.1402585327674; Thu, 12 Jun 2014 08:02:07 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.54.6 with SMTP id vs6csp410188vcb; Thu, 12 Jun 2014 08:02:07 -0700 (PDT) X-Received: by 10.66.66.12 with SMTP id b12mr21160959pat.147.1402585326875; Thu, 12 Jun 2014 08:02:06 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id js5si41767471pbc.250.2014.06.12.08.02.06; Thu, 12 Jun 2014 08:02:06 -0700 (PDT) Received-SPF: none (google.com: linux-crypto-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755999AbaFLPCF (ORCPT ); Thu, 12 Jun 2014 11:02:05 -0400 Received: from mail-we0-f176.google.com ([74.125.82.176]:62313 "EHLO mail-we0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755992AbaFLPCE (ORCPT ); Thu, 12 Jun 2014 11:02:04 -0400 Received: by mail-we0-f176.google.com with SMTP id u56so1401298wes.7 for ; Thu, 12 Jun 2014 08:01:56 -0700 (PDT) X-Received: by 10.194.174.168 with SMTP id bt8mr62969041wjc.72.1402585316495; Thu, 12 Jun 2014 08:01:56 -0700 (PDT) Received: from ards-macbook-pro.local ([92.69.202.131]) by mx.google.com with ESMTPSA id w6sm5199545eef.20.2014.06.12.08.01.55 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 12 Jun 2014 08:01:55 -0700 (PDT) From: Ard Biesheuvel To: linux-crypto@vger.kernel.org, herbert@gondor.apana.org.au Cc: Ard Biesheuvel Subject: [PATCH] crypto: add 4 more test vectors for GHASH Date: Thu, 12 Jun 2014 17:01:50 +0200 Message-Id: <1402585310-1377-1-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.8.3.2 Sender: linux-crypto-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ard.biesheuvel@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.180 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , This adds 4 test vectors for GHASH (of which one for chunked mode), making a total of 5. Signed-off-by: Ard Biesheuvel --- crypto/testmgr.h | 49 +++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 45 insertions(+), 4 deletions(-) diff --git a/crypto/testmgr.h b/crypto/testmgr.h index 69d0dd8ef27e..126b6f9531b2 100644 --- a/crypto/testmgr.h +++ b/crypto/testmgr.h @@ -1807,18 +1807,59 @@ static struct hash_testvec tgr128_tv_template[] = { }, }; -#define GHASH_TEST_VECTORS 1 +#define GHASH_TEST_VECTORS 5 static struct hash_testvec ghash_tv_template[] = { { - - .key = "\xdf\xa6\xbf\x4d\xed\x81\xdb\x03\xff\xca\xff\x95\xf8\x30\xf0\x61", + .key = "\xdf\xa6\xbf\x4d\xed\x81\xdb\x03" + "\xff\xca\xff\x95\xf8\x30\xf0\x61", .ksize = 16, - .plaintext = "\x95\x2b\x2a\x56\xa5\x60\x04a\xc0\xb3\x2b\x66\x56\xa0\x5b\x40\xb6", + .plaintext = "\x95\x2b\x2a\x56\xa5\x60\x04a\xc0" + "\xb3\x2b\x66\x56\xa0\x5b\x40\xb6", .psize = 16, .digest = "\xda\x53\xeb\x0a\xd2\xc5\x5b\xb6" "\x4f\xc4\x80\x2c\xc3\xfe\xda\x60", + }, { + .key = "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b" + "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b", + .ksize = 16, + .plaintext = "what do ya want for nothing?", + .psize = 28, + .digest = "\x3e\x1f\x5c\x4d\x65\xf0\xef\xce" + "\x0d\x61\x06\x27\x66\x51\xd5\xe2", + .np = 2, + .tap = {14, 14} + }, { + .key = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" + "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", + .ksize = 16, + .plaintext = "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd" + "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd" + "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd" + "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd", + .psize = 50, + .digest = "\xfb\x49\x8a\x36\xe1\x96\xe1\x96" + "\xe1\x96\xe1\x96\xe1\x96\xe1\x96", + }, { + .key = "\xda\x53\xeb\x0a\xd2\xc5\x5b\xb6" + "\x4f\xc4\x80\x2c\xc3\xfe\xda\x60", + .ksize = 16, + .plaintext = "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd" + "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd" + "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd" + "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd", + .psize = 50, + .digest = "\x2b\x5c\x0c\x7f\x52\xd1\x60\xc2" + "\x49\xed\x6e\x32\x7a\xa9\xbe\x08", + }, { + .key = "\x95\x2b\x2a\x56\xa5\x60\x04a\xc0" + "\xb3\x2b\x66\x56\xa0\x5b\x40\xb6", + .ksize = 16, + .plaintext = "Test With Truncation", + .psize = 20, + .digest = "\xf8\x94\x87\x2a\x4b\x63\x99\x28" + "\x23\xf7\x93\xf7\x19\xf5\x96\xd9", }, };