Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2316308ybl; Sun, 18 Aug 2019 23:32:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqz6S0J5bbXxYOXiVV59McNtfwmcc2MoNw08J2fCF5XlDBLRx+lhhxRCE+VyFyRVsF3sxKLM X-Received: by 2002:aa7:84d7:: with SMTP id x23mr399370pfn.53.1566196376990; Sun, 18 Aug 2019 23:32:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566196376; cv=none; d=google.com; s=arc-20160816; b=AYnq50OKNprehcGxEJNvu3X+vfcWELAPmDk9I/PYQ86uiSZ3mOdJxW5T6gBtUyR2Og FwcGVGDjNIBO893VvgofZmYKQr2dD7uoNWaz+tIWr191FVc64UY+RbbYSFUyQpBwOiZa Nr4e28mTn7Dd3rKEN4QuIquZq6OAUaHn6fDb09y8jZuaBI0VC0iiOpSk8u1h75KyhTJw jcvx4ApN+3p6uaSo1atYYU5LSeLklQHeAxicKP+71e1DQjfyF9eFfKYA502zOzNUfU29 vkyec7iionVAF0e0UpKXmINR4BkUOqjYwHEU2AGF7gJgiiD72SGJpL2UBhJeGDW4wIxh 9ZEA== 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=b6g/RYIhB4E3A1kfc7NHT/Ycf2jIUYpN2gI1y0BQIks=; b=HrgbKJWupfiXecI38OD2kuoetXH57kj0ZqY2SxkJlkgWOupHx8BlGOy43SpAEYn9t5 a3sl2YlStlk+yKBUY5dqxWff1obx3KFpHDh/aFSXACVpILGCYQkx9NYFs5nlr0YWdqsa R7s9t8zKHMJQEm3+x1XwdkuuqjUJKu6HRnyZwW35O0k/8i3r4ethAce34gGA/xLAu/FL PO6UJ++puGR1/4hgkjrkaNk3lMPmgitCnMhHOEKYWkluunJBqr6sz7Xs0TRU2r5OfsAL dGkVEIfXJr0VDVmdOGJR00Njr132mHuWL0CW+3puWCwO8ewGJYl8QMygW22b1mC4qC6z AewA== 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 64si9407817plw.37.2019.08.18.23.32.36; Sun, 18 Aug 2019 23:32:56 -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; 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 S1725946AbfHSGcc (ORCPT + 99 others); Mon, 19 Aug 2019 02:32:32 -0400 Received: from helcar.hmeau.com ([216.24.177.18]:57698 "EHLO fornost.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725308AbfHSGcb (ORCPT ); Mon, 19 Aug 2019 02:32:31 -0400 Received: from gondolin.me.apana.org.au ([192.168.0.6] helo=gondolin.hengli.com.au) by fornost.hmeau.com with esmtps (Exim 4.89 #2 (Debian)) id 1hzbDI-0007E9-Fk; Mon, 19 Aug 2019 16:32:20 +1000 Received: from herbert by gondolin.hengli.com.au with local (Exim 4.80) (envelope-from ) id 1hzbDG-0008Jt-7T; Mon, 19 Aug 2019 16:32:18 +1000 Date: Mon, 19 Aug 2019 16:32:18 +1000 From: Herbert Xu To: Ard Biesheuvel Cc: linux-crypto@vger.kernel.org, Eric Biggers , dm-devel@redhat.com, linux-fscrypt@vger.kernel.org, Gilad Ben-Yossef , Milan Broz Subject: Re: [PATCH v12 1/4] crypto: essiv - create wrapper template for ESSIV generation Message-ID: <20190819063218.GA31821@gondor.apana.org.au> References: <20190815192858.28125-1-ard.biesheuvel@linaro.org> <20190815192858.28125-2-ard.biesheuvel@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190815192858.28125-2-ard.biesheuvel@linaro.org> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Thu, Aug 15, 2019 at 10:28:55PM +0300, Ard Biesheuvel wrote: > > + /* Synchronous hash, e.g., "sha256" */ > + ictx->hash = crypto_alloc_shash(shash_name, 0, 0); > + if (IS_ERR(ictx->hash)) { > + err = PTR_ERR(ictx->hash); > + goto out_drop_skcipher; > + } Holding a reference to this algorithm for the life-time of the instance is not nice. How about just doing a lookup as you were doing before with crypto_alg_mod_lookup and getting the cra_name from that? Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt