From: Manuel Lauss <manuel.lauss@googlemail.com>
To: Sebastian Andrzej Siewior <linux-crypto@ml.breakpoint.cc>
Cc: linux-crypto@vger.kernel.org,
Linux-MIPS <linux-mips@linux-mips.org>,
Manuel Lauss <manuel.lauss@gmail.com>
Subject: Re: [RFC PATCH] crypto: Alchemy AES engine driver
Date: Fri, 7 May 2010 10:51:37 +0200 [thread overview]
Message-ID: <r2zf861ec6f1005070151oda24db2dra284b487c47ecbbf@mail.gmail.com> (raw)
In-Reply-To: <20100507083430.GB29286@Chamillionaire.breakpoint.cc>
Hi Sebastian,
>># modprobe alchemy-aes
>>alg: skcipher: setkey failed on test 2 for ecb-aes-alchemy: flags=200000
>># modprobe tcrypt mode=10
>>alg: skcipher: setkey failed on test 3 for cbc-aes-alchemy: flags=0
>>alg: skcipher: Failed to load transform for cbc(aes): -2
>>alg: skcipher: Failed to load transform for cbc(aes): -2
>>tcrypt: one or more tests failed!
>>FATAL: Error inserting tcrypt (/lib/modules/2.6.34-rc6-db1200-00214-g9f84af9/kernel/crypto/tcrypt.ko): Unknown symbol in module, or unknown parameter (see dmesg)
>
>>The error in "test 3 for cbc-aes-alchemy" probably comes from the inability
>>to process keys larger than 128 bits.
> You have to fix this, you have to be able to handle other keys as well.
> In case your hardware does not support it, you have to handle this in
> software. Look at the geode driver, via or s390. All of them have
> fallbacks for. If you fail the self test, you driver will no be used
> afaik.
Ah, I wondered what those were used for. I'll fix the driver to use them
as well. Interestingly the algos provided are marked as tested in
/proc/crypto though. I assumed the cryptoapi knows that the hw algo
can't handle these keylengths (it didn't even call the setkeys callback
before throwing the error) and fall back on software aes instead.
>>diff --git a/drivers/crypto/alchemy-aes.c b/drivers/crypto/alchemy-aes.c
>>new file mode 100644
>>index 0000000..14e8ace
>>--- /dev/null
>>+++ b/drivers/crypto/alchemy-aes.c
>>+static int __init alchemy_aes_load(void)
>>+{
>>+ /* FIXME: hier sollte auch noch der PRId des prozessors getestet
>>+ * werden; Au1210 (0x0503xxxx) und einige Au1300 haben lt. Daten-
>>+ * blatt keine AES engine.
>>+ */
> You German right? You should handle this in SoC code. So if you figure
> out, that you have an engine here you add the device. If you don't have
> it you don't do it and the probe call won't be called. Also the module
> won't be loaded by udev.
Hm, I'll think about it.
>>+ /* need to do 8bit accesses to memory to get correct data */
>>+ __alchemy_aes_memid = au1xxx_ddma_add_device(&alchemy_aes_mem_dbdev);
>>+ if (!__alchemy_aes_memid)
>>+ return -ENODEV;
> What does it do? You don't want to add devices here. If you need
> something additional do it in SoC code and pass it via platform_data.
The dbdma code needs templates to get the memory access width right,
this adds a template for use with the AES engine. Every instance could
use the same template that's why it's registered in the module_init callback.
(see drivers/mmc/au1xmmc.c for instance; yes this is a workaround for
a shortcoming of the alchemy dbdma framework).
Thanks!
Manuel Lauss
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2010-05-07 8:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-06 15:50 [RFC PATCH] crypto: Alchemy AES engine driver Manuel Lauss
2010-05-07 8:34 ` Sebastian Andrzej Siewior
2010-05-07 8:51 ` Manuel Lauss [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=r2zf861ec6f1005070151oda24db2dra284b487c47ecbbf@mail.gmail.com \
--to=manuel.lauss@googlemail.com \
--cc=linux-crypto@ml.breakpoint.cc \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-mips@linux-mips.org \
--cc=manuel.lauss@gmail.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;
as well as URLs for NNTP newsgroup(s).