LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Pascal Van Leeuwen <pvanleeuwen@insidesecure.com>
To: Richard Weinberger <richard@nod.at>,
	Stephan Mueller <smueller@chronox.de>
Cc: david <david@sigma-star.at>,
	Linux Crypto Mailing List <linux-crypto@vger.kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: RE: Can an ahash driver be used through shash API?
Date: Thu, 30 May 2019 10:02:57 +0000	[thread overview]
Message-ID: <AM6PR09MB3523027D7045FD96E9FE4C33D2180@AM6PR09MB3523.eurprd09.prod.outlook.com> (raw)
In-Reply-To: <1331220190.73461.1559161310462.JavaMail.zimbra@nod.at>

> >
> > 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? :)
> 
Well, one reason might be that asynchronous implementations are usually
hardware accelerators that rely on many operations being batch queued in
order to actually usefully accelerate anything (due to large latencies).
Which you can't do from the synchronous interface, so you'd get a slow down, 
not a speed up. 
(But some people - Ad :-) - might argue that using the accelerator may still
be useful to offload the CPU, reduce power consumption, etc.)

In any case, I didn't really know this but I'm quite happy with it. If you
want *performance*, you shouldn't end up at a h/w accelerator with a 
synchronous API. If you do want the h/w acceleration, you can always use
the asynchronous API, so nothing lost there, you do have a choice.

Regards,
Pascal van Leeuwen
Silicon IP Architect, Multi-Protocol Engines @ Inside Secure
www.insidesecure.com

      parent reply	other threads:[~2019-05-30 10:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-29 14:04 David Gstir
2019-05-29 14:18 ` Stephan Mueller
2019-05-29 20:21   ` Richard Weinberger
2019-05-30  5:38     ` Stephan Mueller
2019-05-30 10:02     ` Pascal Van Leeuwen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AM6PR09MB3523027D7045FD96E9FE4C33D2180@AM6PR09MB3523.eurprd09.prod.outlook.com \
    --to=pvanleeuwen@insidesecure.com \
    --cc=david@sigma-star.at \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=richard@nod.at \
    --cc=smueller@chronox.de \
    --subject='RE: Can an ahash driver be used through shash API?' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).