Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp305867ybi; Thu, 1 Aug 2019 19:30:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqwZdb7zGAM4NOVf8MvoGBIpqlMeMQZ3LQ6KM+frZ2iMMUv+NH1fUMBenOCGnWsQfa6pMB3+ X-Received: by 2002:aa7:86cc:: with SMTP id h12mr49793851pfo.2.1564713004068; Thu, 01 Aug 2019 19:30:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1564713004; cv=pass; d=google.com; s=arc-20160816; b=0XajiQaqQ+qOVNZv5ltJ5JNNXwXgQKreXSD6BKga3SxFO6Ret+6YaLM7PwmjexTTCo X+Jv8/8Dixr9DNIC3nBeD4QnTUT5t6UiHzgMkQr5eUGxebI86GlNEGZ/XLujBZDIQHDP WsyV30oH85Cf+ndyY+yrwCFTrj3j2sW7C5np0JLddbYiaNu9a5Zz5AqkPMRxJYeZ+Tgh 1pHr5MySa6KLRuIdOejK5C5cx9Wvno7llW//Sx0EEzj2DgiQmRwm93a7Xud/O70jfoA3 DHPNI4vwT1SRm88KisJQCQuDyTIuBkrgKiZH+rM2oDoy6uTqsu/3XRvVuyARegcIXQ29 /izQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=5nwFhwPpZm/41poRA13bAhifEH9AncNH3+pNYzi3ED8=; b=zYMTDDb0Ws6mTobebVIF/THEgw0139fTfURhYyKNVMB57OJsPE98nj2y9P63nsUcwM bNVpfMrn6cKGZTPsSVHo+6WqjVWbzZ+3fKVzg3IZcavzmKZy/bD0fqiGadYMw2SFaEit e33QzTiSopz/qMgxSes9idrpmKnbd8MS/yR3iIk1ABDUTC2Guz4x+v7DkXGn52zFqrKr QpkCKm4/kQSqEx/6a4U9GiNTrowrfsJqBio1cqHSioguXX6yND0uETc2WuBlaR/zIXaz FstY4E0yhQHlejwgZIezkaCp16N/avefP+Rw6Cdtug0GVFNpcMrSXVjX8ch37VlQ3RS0 Q4ow== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@verimatrix.com header.s=selector2 header.b=qwk2KhKz; arc=pass (i=1 spf=pass spfdomain=verimatrix.com dkim=pass dkdomain=verimatrix.com dmarc=pass fromdomain=verimatrix.com); spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=verimatrix.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v12si1527099pgl.102.2019.08.01.19.29.49; Thu, 01 Aug 2019 19:30:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@verimatrix.com header.s=selector2 header.b=qwk2KhKz; arc=pass (i=1 spf=pass spfdomain=verimatrix.com dkim=pass dkdomain=verimatrix.com dmarc=pass fromdomain=verimatrix.com); spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=verimatrix.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731327AbfHBAYI (ORCPT + 99 others); Thu, 1 Aug 2019 20:24:08 -0400 Received: from mail-eopbgr770049.outbound.protection.outlook.com ([40.107.77.49]:9699 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729359AbfHBAYH (ORCPT ); Thu, 1 Aug 2019 20:24:07 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ofqiR0aH5P7bQwt+EWwqX35PQiOQnr/q0MpNdzBCOo8V944/C3WjzFXAbWiorKxIKCV8FzKVt1uvpfiHilyHyC1p7/X+WWStsqGTY/q6iZR0UpmYMAoKeEfVYCVZs29I8Di0peMiqoUpKWzoWeOezJcQEISrd1QWT1wDXlQaZaUaf4AWZCFIUFtMwgafdxD78vwbq2bzIHAPuq5gZTSQAsLWtiUFF2xaPUCsVdswDVVxL/H4otDiWZlvD69rL575ir/4CH5o1tRQqXC0Uc+kMODbaviK9BBGEJtz6Tykxa9IONEhxwkZtSFGSxtkhohYmvMw3AX8vJauNPWWy/wSKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5nwFhwPpZm/41poRA13bAhifEH9AncNH3+pNYzi3ED8=; b=PCRtWXiTdLWpViPslv+scHwx4XCzTlcJ7GTLNQFdgZw4+KtUoXnlHWRu9Yc+C56B31042M5kddGY5scqgJx1/WYwFN41yGrcx/umnz++sB+kByroH9Ktf1yopFmorQ1/8McwXsQYAsbU0MjtQpQ2ib4+kgU1Lf6xRBk3Xm5uBDOPesCGQePonNZleut5h9yZnY8b22kGWE3iucYEMzuXQ2hNl7pEQL0Qn4RU/5/uP2LVFoqrUZw+eCmcos4edn/spki2UsMZJFeqpTWqiCp4VnGvKMwYbs6f46VKbDlSrfk/XbCmS0jREmN45uRDI2DE1PNy+7xgLznBqZxiRv1Taw== ARC-Authentication-Results: i=1; mx.microsoft.com 1;spf=pass smtp.mailfrom=verimatrix.com;dmarc=pass action=none header.from=verimatrix.com;dkim=pass header.d=verimatrix.com;arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=verimatrix.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5nwFhwPpZm/41poRA13bAhifEH9AncNH3+pNYzi3ED8=; b=qwk2KhKzw573/Sgh2iMZy3c8BAnqgssbDKcyd0p2tvn86ZHkbiXXSvwdnLqBnpZR+mok/rhBYlRMfWLxvC3rm9eYDN656fpxO+n/sOmABenOPlF2xM0lLiOyNFHQBKWFjC8/QTwrjRbfv0dwgHN5vkeUbBIHmKaxqnNwrRn0tf4= Received: from MN2PR20MB2973.namprd20.prod.outlook.com (52.132.172.146) by MN2PR20MB3120.namprd20.prod.outlook.com (52.132.174.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2136.17; Fri, 2 Aug 2019 00:24:04 +0000 Received: from MN2PR20MB2973.namprd20.prod.outlook.com ([fe80::d96f:39b2:19f4:c7c1]) by MN2PR20MB2973.namprd20.prod.outlook.com ([fe80::d96f:39b2:19f4:c7c1%7]) with mapi id 15.20.2115.005; Fri, 2 Aug 2019 00:24:04 +0000 From: Pascal Van Leeuwen To: Corentin Labbe , "herbert@gondor.apana.org.au" , "linux-crypto@vger.kernel.org" CC: "linux-kernel@vger.kernel.org" Subject: RE: Need help with failling gcm_base(ctr,ghash-generic) selftest Thread-Topic: Need help with failling gcm_base(ctr,ghash-generic) selftest Thread-Index: AQHVSKFY6oVMoifWy0S5Dl262GlQMabm/nnw Date: Fri, 2 Aug 2019 00:24:04 +0000 Message-ID: References: <20190801194249.GA18705@Red> In-Reply-To: <20190801194249.GA18705@Red> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=pvanleeuwen@verimatrix.com; x-originating-ip: [188.204.2.113] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 4384dd67-989a-4ef9-dca2-08d716dfb981 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328)(7193020);SRVR:MN2PR20MB3120; x-ms-traffictypediagnostic: MN2PR20MB3120: x-ms-exchange-purlcount: 1 x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8273; x-forefront-prvs: 011787B9DD x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(4636009)(39850400004)(396003)(346002)(366004)(136003)(376002)(13464003)(199004)(189003)(33656002)(68736007)(6436002)(476003)(2501003)(11346002)(446003)(9686003)(14454004)(486006)(55016002)(229853002)(478600001)(66066001)(2201001)(6116002)(71200400001)(71190400001)(2906002)(25786009)(3846002)(256004)(8676002)(7696005)(4326008)(86362001)(52536014)(15974865002)(316002)(66476007)(66946007)(66446008)(102836004)(5660300002)(6246003)(64756008)(186003)(81156014)(26005)(305945005)(66556008)(53936002)(7736002)(110136005)(81166006)(6506007)(99286004)(74316002)(53546011)(8936002)(76176011)(76116006)(41533002)(142933001)(18886075002);DIR:OUT;SFP:1101;SCL:1;SRVR:MN2PR20MB3120;H:MN2PR20MB2973.namprd20.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: verimatrix.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: IB7EpWyN2rgLSCNMR3gFfaSCK/OfpXQ9JBK1YimKioHbIQga+8o+joZGQ0o78/Ts7vdt7uO6RNG7HBnCQlt65UQxrPtMlyF95qw1gzknMx3whDZmTdhn+Y5tAq5rut39wI0jj+xYoWEOm6vEC9ExsuMKreZX2blr/Q/3+01Sh/lguRdNEstsvQM1IvCQn+/4vy1I6zKPs/UQ903a/HhZbrBGyAYzbh7VVaXW/8ykOPalVape9SrJpD06vLjkAyiHNh9Aec20q2aUdR6PQ6qJkCEO6jSu41T1KcAzePKgKt8ZVHyGAn/vgZhp1LMCBsKJvEGYihE+oNtkLDR5v1hehhv3Si9vv82kNGRgUQ7KSwwnk0NK408wYxdUYwMDqK/SXzy0zekOe2LF4IB/tzACIsLhUrw0e9T8vJSarDSx2IA= Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: verimatrix.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4384dd67-989a-4ef9-dca2-08d716dfb981 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Aug 2019 00:24:04.0908 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: dcb260f9-022d-4495-8602-eae51035a0d0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: pvanleeuwen@verimatrix.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR20MB3120 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org > -----Original Message----- > From: linux-crypto-owner@vger.kernel.org On Behalf Of > Corentin Labbe > Sent: Thursday, August 1, 2019 9:43 PM > To: herbert@gondor.apana.org.au; linux-crypto@vger.kernel.org > Cc: linux-kernel@vger.kernel.org > Subject: Need help with failling gcm_base(ctr,ghash-generic) selftest >=20 > Hello >=20 > I am writing the Allwinner sun8i-ce driver and when running tcrypt I got > [ 30.201739] alg: aead: gcm_base(ctr-aes-sun8i-ce,ghash-generic) decryp= tion failed on test > vector 3; expected_error=3D0, actual_error=3D-74, cfg=3D\"random: may_sle= ep use_digest > src_divs=3D[100.0%@+2614] dst_divs=3D[5.90%@alignmask+3015, 60.56%@+3996,= 17.92%@+865, > 15.62%@+10]\" > or > The decryption reports only an -EBADMSG here, which means the decryption it= self went fine, but the authentication tag mismatched. > [ 148.613537] alg: aead: gcm_base(ctr-aes-sun8i-ce,ghash-generic) encryp= tion test failed > (wrong result) on test vector 2, cfg=3D\"random: may_sleep use_final src_= divs=3D[100.0%@+0] > iv_offset=3D20\" >=20 Can't say for sure, but considering the decrypt error, this is most likely = just a mismatch on the appended authentication tag. > Since ctr-aes-sun8i-ce is passing the ctr(aes) selftest, I dont understan= d what could be > wrong. >=20 That is possible, as this appears to be a problem with the authentication p= art, not the encryption part. So possibly a problem with the way you setup the=20 authentication key (which is actually derived from the encryption key, but = I don't know if your hardware does this autonomously, mine doesn't) and/or operatio= n? > Thanks > Regards Regards, Pascal van Leeuwen Silicon IP Architect, Multi-Protocol Engines @ Verimatrix www.insidesecure.com