Linux cryptographic layer development
 help / color / mirror / Atom feed
From: Stephan Mueller <smueller@chronox.de>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Linux Crypto Mailing List <linux-crypto@vger.kernel.org>
Subject: Re: [PATCH 0/14] crypto: aead - Phase oute seqniv
Date: Mon, 13 Jul 2015 11:09:34 +0200	[thread overview]
Message-ID: <4183187.0RpMVHFSDO@tauon.atsec.com> (raw)
In-Reply-To: <20150711023918.GB24197@gondor.apana.org.au>

Am Samstag, 11. Juli 2015, 10:39:18 schrieb Herbert Xu:

Hi Herbert,

>Weird.  The C version does the very same check:
>
>static int crypto_rfc4106_decrypt(struct aead_request *req)
>{
>        if (req->assoclen != 16 && req->assoclen != 20)
>                return -EINVAL;

I rechecked my test code: I accidentally only used gcm(aes) instead of 
rfc4106(gcm(aes)) for validating the C code. Using rfc4106(gcm(aes-asm)), I 
get the same error. Sorry for the inconsistent description.

Based on the patch to the testmgr.h test vectors for RFC4106, I include the IV 
inbetween the AD and the plaintext.

That code now works with rfc4106(gcm(aes)). But using that code now fails with 
the "regular" GCM implementation as well as CCM. The regular GCM 
implementation works when not providing the IV as part of the SGL/set_ad. Is 
that difference between "regular" AEAD and RFC4106 AEAD intended?

Apart from the GCM vs RFC4106 invocation, the code seemingly requires to 
provide the IV twice -- once with the buffer/set_ad and once with the 
set_crypt call. Is that intended? Providing the IV twice is visible in the 
testmgr.h patch where .assoc now includes the previous .assoc plus the IV data 
which is also set in .iv.

Thanks
Stephan

  reply	other threads:[~2015-07-13  9:09 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-08 23:13 [PATCH 0/14] crypto: aead - Phase oute seqniv Herbert Xu
2015-07-08 23:17 ` [PATCH 1/14] crypto: api - Add instance free function to crypto_type Herbert Xu
2015-07-08 23:17 ` [PATCH 2/14] crypto: aead - Add type-safe function for freeing instances Herbert Xu
2015-07-08 23:17 ` [PATCH 3/14] crypto: pcrypt - Propagate new AEAD implementation flag Herbert Xu
2015-07-08 23:17 ` [PATCH 4/14] crypto: cryptd " Herbert Xu
2015-07-08 23:17 ` [PATCH 5/14] crypto: echainiv - Fix encryption convention Herbert Xu
2015-07-08 23:17 ` [PATCH 6/14] crypto: seqiv - Replace seqniv with seqiv Herbert Xu
2015-07-08 23:17 ` [PATCH 7/14] crypto: aead - Propagate new AEAD implementation flag for IV generators Herbert Xu
2015-07-08 23:17 ` [PATCH 8/14] crypto: testmgr - Disable rfc4106 test and convert test vectors Herbert Xu
2015-07-08 23:17 ` [PATCH 9/14] crypto: tcrypt - Add support for new IV convention Herbert Xu
2015-07-09  7:59   ` Stephan Mueller
2015-07-09  8:00     ` Herbert Xu
2015-07-08 23:17 ` [PATCH 10/14] crypto: aesni - Use " Herbert Xu
2015-07-08 23:17 ` [PATCH 11/14] crypto: gcm " Herbert Xu
2015-07-08 23:17 ` [PATCH 12/14] crypto: nx " Herbert Xu
2015-07-09  6:19   ` Stephan Mueller
2015-07-09  6:56     ` Herbert Xu
2015-07-09  7:07       ` Stephan Mueller
2015-07-09  7:11         ` Herbert Xu
2015-07-08 23:17 ` [PATCH 13/14] crypto: caam " Herbert Xu
2015-07-08 23:17 ` [PATCH 14/14] crypto: testmgr - Reenable rfc4106 test Herbert Xu
2015-07-09 10:19 ` [PATCH 0/14] crypto: aead - Phase oute seqniv Stephan Mueller
2015-07-09 11:38   ` Stephan Mueller
2015-07-10 13:39     ` Herbert Xu
2015-07-10 17:57       ` Stephan Mueller
2015-07-11  2:39         ` Herbert Xu
2015-07-13  9:09           ` Stephan Mueller [this message]
2015-07-13  9:13             ` Herbert Xu
2015-07-13 11:29               ` Stephan Mueller
2015-07-10 13:38   ` Herbert Xu
2015-07-10 18:46     ` Stephan Mueller
2015-07-11  2:37       ` Herbert Xu

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=4183187.0RpMVHFSDO@tauon.atsec.com \
    --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