linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephan Mueller <smueller@chronox.de>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: linux-crypto@vger.kernel.org
Subject: Re: [PATCH v2] crypto: add key wrapping block chaining mode
Date: Mon, 27 Apr 2015 16:58:51 +0200	[thread overview]
Message-ID: <3344357.7kIb8DDjMB@tauon> (raw)
In-Reply-To: <20150427082935.GA21691@gondor.apana.org.au>

Am Montag, 27. April 2015, 16:29:35 schrieb Herbert Xu:

Hi Herbert,

>On Sun, Apr 26, 2015 at 12:08:20AM +0200, Stephan Mueller wrote:
>> This patch implements the AES key wrapping as specified in
>> NIST SP800-38F and RFC3394.
>
>This is my attempt at turning kw into a givcipher.  The encrypt
>part is complete but untested as I gave up after finding the
>reverse SG problem with your decrypt code.

Is it that easy? I was struggling to understand what to do in the alloc 
function.

Thank you very much for that hint.

>static int crypto_kw_givdecrypt(struct skcipher_givcrypt_request *req)
>{
>	int err = crypto_kw_decrypt(&req->creq);
>
>	if (err)
>		return err;
>
>	return memcmp(req->creq.info, "\xA6\xA6\xA6\xA6\xA6\xA6\xA6\xA6",
>		      SEMIBSIZE) ? -EBADMSG : 0;

This memcmp implies that the final block->A from the decrypt is memcpy'ed to 
req->creq.info. I wanted to avoid any additional memcpy calls to not hurt 
performance even more.


Ciao
Stephan

  reply	other threads:[~2015-04-27 14:58 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-25 22:07 [PATCH v2] SP800-38F / RFC3394 key wrapping Stephan Mueller
2015-04-25 22:08 ` [PATCH v2] crypto: add key wrapping block chaining mode Stephan Mueller
2015-04-27  8:26   ` Herbert Xu
2015-04-27 14:34     ` Stephan Mueller
2015-04-28  1:10       ` Herbert Xu
2015-04-28  2:35         ` Stephan Mueller
2015-04-28  2:50           ` Herbert Xu
2015-04-27  8:29   ` Herbert Xu
2015-04-27 14:58     ` Stephan Mueller [this message]
2015-04-28  1:12       ` Herbert Xu
2015-04-28  1:09 ` [PATCH v2] SP800-38F / RFC3394 key wrapping Herbert Xu
2015-04-28  2:45   ` Stephan Mueller
2015-04-28  2:54     ` Herbert Xu
2015-04-28  2:58       ` Stephan Mueller
2015-05-01  3:20         ` Herbert Xu
2015-05-01  7:27           ` Stephan Mueller
2015-05-01  7:30             ` Herbert Xu
2015-05-01 13:21               ` Stephan Mueller
2015-05-11  9:42                 ` Herbert Xu
2015-05-11 10:15                   ` Stephan Mueller

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=3344357.7kIb8DDjMB@tauon \
    --to=smueller@chronox.de \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    /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).