Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1566201ybv; Sat, 8 Feb 2020 00:58:29 -0800 (PST) X-Google-Smtp-Source: APXvYqyXTTjBH7AVDVKcPR3FT50qmbyzo+auaMfXwhXh5D7wbouEmx8P3FuQOqo6rJm2XWPz6MGe X-Received: by 2002:a9d:1284:: with SMTP id g4mr2656458otg.207.1581152308693; Sat, 08 Feb 2020 00:58:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581152308; cv=none; d=google.com; s=arc-20160816; b=pDW5PgUmzFvbNO49suH142V6DYJO4/LTqnaKmXa+xcOrknk0lVlduej5/5xcTXOqv6 52n+lDrqXAUAVHhY+WIzmx7EbJkNTO6BMh5gpKYlGsuDoOXhyxNRgdD2JowbRGPq8xal 4KaMMXBcd+dWlQmvCDKSK7wCyJuq1vEd0lcqEEoLnBKnvwX4LzDIW4tCKHgTiejUNiyL yqOu8u1iwr0jE8LDYloIFc4QwJX9il++tWIsYkmtdGiJ8izIxnAJEBzn7q5hmVtWxvkv c9szuVAveFxjKKYKymG6OeF7unO0fCq9fRASSdqiRNJIY8UviATUYCXv9yB7YAdhfpu6 WMGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=KtNgD2BDHRXikAEH/O+x37ZVmYcD4fr7+HXBlmYnz6s=; b=kscO5xubVChxXJDu7Iu2eQbC6hhJnENeC11CZFPwIa0tuu0iYKUkcO0+Zoy6PKJf28 m/vUyQPi85bVnpeNMRzARGZ8cj/3WTkP5p6byWmwjcBHfekW3fGYRcGfRXlDLhfR+S48 tt1aUfirbnt/8fWEoXYLkDa8AtrNNX5L+DzHb1smjObrKIBe+F12YtT4YgfJqdPTaazF wI6nKZhwZn7ppC8ZoTdH+/+5TAybhmj1UQ4mxNxy3cIyr6VPgryXs/SpUamzwSij3o11 o5tXR9fKCwSqkm4gYcYlOlJ2alT6yMk1J6Ycrfk8K1Sv7W3XlXO80QxMcc9Ch90u/GQd wwdg== ARC-Authentication-Results: i=1; mx.google.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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g17si1261012otk.252.2020.02.08.00.58.08; Sat, 08 Feb 2020 00:58:28 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726714AbgBHI6E (ORCPT + 99 others); Sat, 8 Feb 2020 03:58:04 -0500 Received: from helcar.hmeau.com ([216.24.177.18]:52844 "EHLO deadmen.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726229AbgBHI6E (ORCPT ); Sat, 8 Feb 2020 03:58:04 -0500 Received: from gondobar.mordor.me.apana.org.au ([192.168.128.4] helo=gondobar) by deadmen.hmeau.com with esmtps (Exim 4.89 #2 (Debian)) id 1j0Lw4-0007g5-89; Sat, 08 Feb 2020 16:57:56 +0800 Received: from herbert by gondobar with local (Exim 4.89) (envelope-from ) id 1j0LvN-0002bM-Od; Sat, 08 Feb 2020 16:57:13 +0800 Date: Sat, 8 Feb 2020 16:57:13 +0800 From: Herbert Xu To: Corentin Labbe Cc: Eric Biggers , davem@davemloft.net, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [BUG] crypto: export() overran state buffer on test vector Message-ID: <20200208085713.ftuqxhatk6iioz7e@gondor.apana.org.au> References: <20200206085442.GA5585@Red> <20200207065719.GA8284@sol.localdomain> <20200207104659.GA10979@Red> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200207104659.GA10979@Red> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Fri, Feb 07, 2020 at 11:46:59AM +0100, Corentin Labbe wrote: > > My goal is to do like n2-crypto/rk3288crypto/etc..., fallback for init/update/final/finup and only do stuff with digest(). > So I have just exactly copied what they do. n2 at least is totally broken wrt import/export. The other ones would work provided that the fallback have the same statesize as the generic sha implementations. Are you not using the standard state sizes? This should probably be switched over to lib/crypto or at least shash. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt