Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp6799006ybi; Wed, 29 May 2019 13:23:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqzLrWB5K+ZdBnj+ECIwCmvZz5NMNjW2e/0ueqrB3cWE1CHNUHUAqfZUIBvwEBaOXAi3Mdkl X-Received: by 2002:a17:902:a415:: with SMTP id p21mr13993409plq.46.1559161391572; Wed, 29 May 2019 13:23:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559161391; cv=none; d=google.com; s=arc-20160816; b=wKSVkKkW/bOCgnGHlvu9TMDrpqmvEOXxZaNgLWk/S5NU6+R/aX/xEDnGVWblusoQfo F+UMXP9qIE30g8y+jZCOb7ry67emVX4xyxaNwmE1DZNWErqAF+ShIFaRNvmuHF2/2ZeZ 9FSl4pWPAZluwsLB67514JQATnVEQca21vsDE0H4vcws0Ttb40Lb89VbYLyHvlKfrGqN UwbP1yrvzYXA1Jlk2MqiDYxE2yrjRxIh7SqU3mf2b+2rngnzh4O66WSyShRqvw1/BfGh ip9YpTiKRCVhn2r/0JXPbpmnDUPP0kD22Tmb0sUe7e3zD5LbSNRLV78rY9bcFjbOmu7D WGHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:thread-index:thread-topic :content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date; bh=qz4jo5zDqWx3j+TM3BgpYdCrxlL9pXzdSAuzr+OrbZA=; b=Q6bAoieKMZW+NDU/IZ/+nja09+rVY4qGTLK8ps3Maw3rQLOb0xDi5ImBHKueLTfGtu 8G2PC2I1hBlhkJ8s1icMiBB/g1xuGQWynIVahzKH9/glrp3uTtyfKIivNOKQw+Pmfk2I n1ZRgSAn2gJvFpjTeA60obGzuMOAADwH/grEhBgq54RnyNlFwpKl7lKiqb4oB1CvoO2k Q+wLhRX9zjW+U45IogCE5n3zCyAWnGVAMaDsn7Po0bjTZ0G7uMecZzH2zGiiCraYg+Ty qh2YrrmRt8tdmZMXdez56mLg99zJbQ8cuO2uFYy+OWHo/bGYQ0fkL9d0kE61I/LRsr8v fEaA== 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 j9si698209pgl.298.2019.05.29.13.22.46; Wed, 29 May 2019 13:23:11 -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 S1726547AbfE2UVx convert rfc822-to-8bit (ORCPT + 99 others); Wed, 29 May 2019 16:21:53 -0400 Received: from lithops.sigma-star.at ([195.201.40.130]:51094 "EHLO lithops.sigma-star.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725990AbfE2UVx (ORCPT ); Wed, 29 May 2019 16:21:53 -0400 Received: from localhost (localhost [127.0.0.1]) by lithops.sigma-star.at (Postfix) with ESMTP id 88A716094C2D; Wed, 29 May 2019 22:21:51 +0200 (CEST) Received: from lithops.sigma-star.at ([127.0.0.1]) by localhost (lithops.sigma-star.at [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id 24hfumFRIBin; Wed, 29 May 2019 22:21:50 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by lithops.sigma-star.at (Postfix) with ESMTP id C61C1608F45A; Wed, 29 May 2019 22:21:50 +0200 (CEST) Received: from lithops.sigma-star.at ([127.0.0.1]) by localhost (lithops.sigma-star.at [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id Kr72C4w85Hpw; Wed, 29 May 2019 22:21:50 +0200 (CEST) Received: from lithops.sigma-star.at (lithops.sigma-star.at [195.201.40.130]) by lithops.sigma-star.at (Postfix) with ESMTP id 91789608310E; Wed, 29 May 2019 22:21:50 +0200 (CEST) Date: Wed, 29 May 2019 22:21:50 +0200 (CEST) From: Richard Weinberger To: Stephan Mueller Cc: david , Linux Crypto Mailing List , linux-kernel Message-ID: <1331220190.73461.1559161310462.JavaMail.zimbra@nod.at> In-Reply-To: <4256916.YlTHG9RRyR@tauon.chronox.de> References: <729A4150-93A0-456B-B7AB-6D3A446E600E@sigma-star.at> <4256916.YlTHG9RRyR@tauon.chronox.de> Subject: Re: Can an ahash driver be used through shash API? MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT X-Originating-IP: [195.201.40.130] X-Mailer: Zimbra 8.8.8_GA_3025 (ZimbraWebClient - FF60 (Linux)/8.8.8_GA_1703) Thread-Topic: Can an ahash driver be used through shash API? Thread-Index: fv0HWCAwwyF4N+CFCRcqKsO36yU5mA== Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Stephan, ----- Ursprüngliche Mail ----- >> I've seen that it does actually work the other way around, since >> crypto_init_shash_ops_async() in crypto/shash.c takes care of translating >> calls from ahash to shash and that's how the *-generic drivers are usable >> through the ahash API. > > The crypto_alloc_shash will only identify cipher implementations that were > registered with the CRYPTO_ALG_TYPE_SHASH flag. That flag is set when a cipher > is registered using crypto_register_shash. > > Thus, ciphers registered with crypto_register_ahash will not bear this flag > and thus will not be found by the allocation function. is there a reason why we don't emulate the synchronous functionality in the crypto API layer if a driver implements only the async interface? Or is it just a matter of -ENOPATCH? :) Thanks, //richard