Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp6392434ybi; Wed, 29 May 2019 07:13:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqxhddOdmxh9AHfOiIM7WaJCTjOvQWzZXnBVBEFlL7QlqE0pmfcfISMDjX5GMCfX4PoiXyBD X-Received: by 2002:aa7:808d:: with SMTP id v13mr118455003pff.198.1559139183678; Wed, 29 May 2019 07:13:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559139183; cv=none; d=google.com; s=arc-20160816; b=zhJkbnPP/sBEuVVac6sYtSq2THzmvETAHMrPKz9UGisQtd/KkjsJQN4CUS2G5WjoKd UONQC4lK7h1wzzB2GLQFLocajZDUFKfsmvcLYmK+7fn6JJKcozbinW+3z2AnLMzOkGBZ 6wHf4KNtRnfvCfgiSB3q1B696nL13dBQ54svl7h/VZ32XcfNNQwheSNovrglvrcZBS/s a588dT9MhiojagWgLoVv0W4jhHLdlt172C0kWo5OjX8dsvpQTv7Zpr4zXWg88L9vU9yS qpBKtXOZhFafVwMnOL2CYKaKJk6wvLciRLK0buLnBX1u3J3owd6qO9Zx9BaMWO25bDOw 5Wug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:cc:date:message-id:subject :mime-version:content-transfer-encoding:from; bh=9UoL7z+bciGhlsLNJeD4b61KNHEMneh7fnI2cBitryI=; b=CLyhwXZAugYOeyb79thgxWNqZo37NAEg/Kga00nADaMc3QSdwJrgYIyb5HL6oBnd0+ 8xrGUYf6mHLqTFqnnlDYBWJDzgQb7k0w0fPQdp5v5xrB+X5tU2FunvHZHaDkDwnVJNuJ pDAR4LaB7WOeHmI7vYbdt+RE2MlKQoBz5dAKqOJGvoVrr3Q+OOGIuMwNUgTtl9ZLrUHw s9j7zlaW2/n+2vdLqwra5W2oY3civrq5nW+MW2tAyYEBw8g/BsaiVemAWYvJoWvyzNjy Zcp8xtm64XBEWcKe3x34A1vE8WxL3O4zNwfnBhYXesEtkrE+IO4zwvzSB8giq+f3Hojw Kezg== 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 s9si24491869pgp.9.2019.05.29.07.12.37; Wed, 29 May 2019 07:13:03 -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 S1727119AbfE2OKj convert rfc822-to-8bit (ORCPT + 99 others); Wed, 29 May 2019 10:10:39 -0400 Received: from lilium.sigma-star.at ([109.75.188.150]:40630 "EHLO lilium.sigma-star.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727086AbfE2OKj (ORCPT ); Wed, 29 May 2019 10:10:39 -0400 X-Greylist: delayed 349 seconds by postgrey-1.27 at vger.kernel.org; Wed, 29 May 2019 10:10:38 EDT Received: from localhost (localhost [127.0.0.1]) by lilium.sigma-star.at (Postfix) with ESMTP id 1382E1809AD97; Wed, 29 May 2019 16:04:49 +0200 (CEST) From: David Gstir Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8BIT Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Can an ahash driver be used through shash API? Message-Id: <729A4150-93A0-456B-B7AB-6D3A446E600E@sigma-star.at> Date: Wed, 29 May 2019 16:04:47 +0200 Cc: linux-kernel@vger.kernel.org, Richard Weinberger To: Linux Crypto Mailing List X-Mailer: Apple Mail (2.3445.104.11) Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Hi! I've done some testing with hardware acceleration of hash functions and noticed that, when using the synchronous message digest API (shash), some drivers are not usable. In my case the CAAM driver for SHA256. Using the asynchronous interface (ahash), everything works as expected. Looking at the driver source, the CAAM driver only implements the ahash interface. I'm wondering if there a way to use an ahash driver through the shash interface? 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. Thanks! David