Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1320070 > unrolled thread

[PATCH] crypto: aead - move aead_request_cast helper to aead.h

Started byTadeusz Struk <tadeusz.struk@intel.com>
First post2016-01-27 23:20 +0100
Last post2016-02-01 17:30 +0100
Articles 4 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] crypto: aead - move aead_request_cast helper to aead.h Tadeusz Struk <tadeusz.struk@intel.com> - 2016-01-27 23:20 +0100
    Re: [PATCH] crypto: aead - move aead_request_cast helper to aead.h Herbert Xu <herbert@gondor.apana.org.au> - 2016-02-01 10:50 +0100
      Re: [PATCH] crypto: aead - move aead_request_cast helper to aead.h Tadeusz Struk <tadeusz.struk@intel.com> - 2016-02-01 17:00 +0100
        Re: [PATCH] crypto: aead - move aead_request_cast helper to aead.h Herbert Xu <herbert@gondor.apana.org.au> - 2016-02-01 17:30 +0100

#1320070 — [PATCH] crypto: aead - move aead_request_cast helper to aead.h

FromTadeusz Struk <tadeusz.struk@intel.com>
Date2016-01-27 23:20 +0100
Subject[PATCH] crypto: aead - move aead_request_cast helper to aead.h
Message-ID<qVGBs-20k-27@gated-at.bofh.it>
Move the helper function to common header for everybody to use.

Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
---
 drivers/crypto/atmel-aes.c |    6 ------
 include/crypto/aead.h      |    6 ++++++
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/crypto/atmel-aes.c b/drivers/crypto/atmel-aes.c
index 6dd3317..949af89 100644
--- a/drivers/crypto/atmel-aes.c
+++ b/drivers/crypto/atmel-aes.c
@@ -369,12 +369,6 @@ static inline size_t atmel_aes_padlen(size_t len, size_t block_size)
 	return len ? block_size - len : 0;
 }
 
-static inline struct aead_request *
-aead_request_cast(struct crypto_async_request *req)
-{
-	return container_of(req, struct aead_request, base);
-}
-
 static struct atmel_aes_dev *atmel_aes_find_dev(struct atmel_aes_base_ctx *ctx)
 {
 	struct atmel_aes_dev *aes_dd = NULL;
diff --git a/include/crypto/aead.h b/include/crypto/aead.h
index 84d13b1..2de15fc 100644
--- a/include/crypto/aead.h
+++ b/include/crypto/aead.h
@@ -304,6 +304,12 @@ static inline struct crypto_aead *crypto_aead_reqtfm(struct aead_request *req)
 	return __crypto_aead_cast(req->base.tfm);
 }
 
+static inline struct aead_request *aead_request_cast(
+					struct crypto_async_request *req)
+{
+	return container_of(req, struct aead_request, base);
+}
+
 /**
  * crypto_aead_encrypt() - encrypt plaintext
  * @req: reference to the aead_request handle that holds all information

[toc] | [next] | [standalone]


#1322949

FromHerbert Xu <herbert@gondor.apana.org.au>
Date2016-02-01 10:50 +0100
Message-ID<qXjho-Ev-7@gated-at.bofh.it>
In reply to#1320070
On Wed, Jan 27, 2016 at 02:09:16PM -0800, Tadeusz Struk wrote:
> Move the helper function to common header for everybody to use.
> 
> Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>

This should go into internal/aead.h if at all.  Longer term we
should look for ways to do away with direct uses of crypto_async_request.

Thanks,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

[toc] | [prev] | [next] | [standalone]


#1323269

FromTadeusz Struk <tadeusz.struk@intel.com>
Date2016-02-01 17:00 +0100
Message-ID<qXp3s-50K-11@gated-at.bofh.it>
In reply to#1322949
On 02/01/2016 01:46 AM, Herbert Xu wrote:
>> Move the helper function to common header for everybody to use.
>> > 
>> > Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
> This should go into internal/aead.h if at all.

Yes, I though about it, but I followed skcipher. The skcipher_request_cast()
helper is in crypto/skcipher.h not in crypto/internal/skcipher.h
Shouldn't this be consistent?
Thanks,

-- 
TS

[toc] | [prev] | [next] | [standalone]


#1323299

FromHerbert Xu <herbert@gondor.apana.org.au>
Date2016-02-01 17:30 +0100
Message-ID<qXpwu-5xp-5@gated-at.bofh.it>
In reply to#1323269
On Mon, Feb 01, 2016 at 07:46:59AM -0800, Tadeusz Struk wrote:
>
> Yes, I though about it, but I followed skcipher. The skcipher_request_cast()
> helper is in crypto/skcipher.h not in crypto/internal/skcipher.h
> Shouldn't this be consistent?

Yes it should be moved into internal as well.

Cheers,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web