From: Stephan Mueller <smueller@chronox.de>
To: Michael McKay <mmckay@vmware.com>
Cc: "linux-crypto@vger.kernel.org" <linux-crypto@vger.kernel.org>
Subject: Re: Problems with cbc(aes) and do_alg0test()
Date: Thu, 25 Aug 2016 02:45:01 +0200 [thread overview]
Message-ID: <1510671.Z01xXXj6zB@positron.chronox.de> (raw)
In-Reply-To: <1887F274-344C-4810-B2DD-DD6551CC4980@vmware.com>
Am Dienstag, 23. August 2016, 22:44:39 CEST schrieb Michael McKay:
Hi Michael,
> We are writing a device driver with kernel v3.14, and trying to encrypt some
> data using the Linux kernel algorithm “cbc(aes)”. Our /proc/crypto shows
> the following is loaded: driver “cbc-aes-aesni”, module “aesni_intel”, and
> type “ablkcipher”. But crypto_has_alg() gives us an error indicating the
> algo is not loaded. So knowing we have the algo string correct, most likely
> the problem is with the two other input variables: mask or type.
> Since AESNI is in use, we have a decent guess at the types by looking at the
> .cra_flags field in aensi-Intel_glue.c (which has
> “CRYPTO_ALG_TYPE_ABLKCIPHER | CRYPTO_ALG_ASYNC”). That leaves just a few
> mask fields to guess at, but CRYPTO_ALG_TYPE_BLKCIPHER_MASK and
> CRYPTO_ALG_TYPE_MASK don’t work (not does OR’ing them together).
> What are the correct mask and type values for AESNI, and can you point me to
> any documentation? What else might we be doing wrong? Is /proc/crypto
> giving us relevant information? Thanks,
You can only use the cbc-aes-aesni code with the ablkcipher API. Using it with
the blkcipher API will not work.
So, a simple crypto_alloc_ablkcipher("cbc-aes-aesni", 0, 0) should work. If
not, what is the return code?
Ciao
Stephan
prev parent reply other threads:[~2016-08-25 6:04 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-23 22:44 Problems with cbc(aes) and do_alg0test() Michael McKay
2016-08-25 0:45 ` Stephan Mueller [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=1510671.Z01xXXj6zB@positron.chronox.de \
--to=smueller@chronox.de \
--cc=linux-crypto@vger.kernel.org \
--cc=mmckay@vmware.com \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox