mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Stephan Müller" <smueller@chronox.de>
To: srikanth jampala <jsrikanth@caviumnetworks.com>
Cc: Srikanth Jampala <Jampala.Srikanth@cavium.com>,
	herbert@gondor.apana.org.au, davem@davemloft.net,
	linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org,
	George.Cherian@cavium.com, Nidadavolu.Murthy@cavium.com,
	Sreerama.Gadam@cavium.com, Ram.Kumar@cavium.com
Subject: Re: [PATCH v1 3/3] crypto: cavium - Register the CNN55XX supported crypto algorithms.
Date: Thu, 11 May 2017 14:22:30 +0200	[thread overview]
Message-ID: <2489871.hhvjNBQWWt@tauon.chronox.de> (raw)
In-Reply-To: <685383f7-6ae2-31fe-f081-2ac739343137@caviumnetworks.com>

Am Donnerstag, 11. Mai 2017, 14:18:34 CEST schrieb srikanth jampala:

Hi srikanth,

> Hi Stephan,
> 
> On Wednesday 10 May 2017 07:26 PM, Stephan Müller wrote:
> > Am Mittwoch, 10. Mai 2017, 15:06:40 CEST schrieb Srikanth Jampala:
> > 
> > Hi Srikanth,
> > 
> > In general: you are using the ablkcipher API. I think it is on its way out
> > and being replaced with skcipher.
> > 
> > Maybe it makes sense to replace it here too. It could be as simple as s/
> > ablkcipher/skcipher/g
> 
> Sure, I will do the changes accordingly.
> As per my understanding, I see the following changes,
> 1. CRYPTO_ALG_TYPE_ABLKCIPHER changed to CRYPTO_ALG_TYPE_SKCIPHER
> 2. nitrox_ablkcipher_foo() changed to nitrox_skcipher_foo()
> 
> Please let me know, any other changes I have to consider?

What about all crypto_ablkcipher* function calls / structs? Also all 
ablkcipher_request function calls/structs?
> 
> >> +static inline int nitrox_ablkcipher_setkey(struct crypto_ablkcipher
> >> *cipher,
> >> +                                          int aes_keylen, const u8 *key,
> >> +                                          unsigned int keylen)
> >> +{
> >> +       struct crypto_tfm *tfm = crypto_ablkcipher_tfm(cipher);
> >> +       struct nitrox_crypto_instance *inst = crypto_tfm_ctx(tfm);
> >> +       struct flexi_crypto_context *fctx;
> >> +       enum flexi_cipher cipher_type;
> >> +       const char *name;
> >> +
> >> +       name = crypto_tfm_alg_name(tfm);
> >> +       cipher_type = flexi_cipher_type(name);
> >> +       if (cipher_type == CIPHER_INVALID) {
> >> +               pr_err("unsupported cipher: %s\n", name);
> >> +               return -EINVAL;
> >> +       }
> >> +
> >> +       /* fill crypto context */
> >> +       fctx = inst->u.fctx;
> >> +       fctx->flags = 0;
> >> +       fctx->w0.cipher_type = cipher_type;
> >> +       fctx->w0.aes_keylen = aes_keylen;
> >> +       fctx->w0.iv_source = IV_FROM_DPTR;
> >> +       fctx->flags = cpu_to_be64(*(u64 *)&fctx->w0);
> >> +       /* copy the key to context */
> >> +       memcpy(fctx->crypto.u.key, key, keylen);
> > 
> > Could you help me finding the location where this memory is zeroized upon
> > release?
> 
> Currently, we are not zeroized the context in release.
> We are doing it at the time of allocation.

You store a key in a piece of heap memory. I guess you want to zeroize that 
key memory before releasing?


Ciao
Stephan

  reply	other threads:[~2017-05-11 12:22 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-10 13:06 [PATCH v1 0/3] Add support for Cavium CNN55XX crypto adapters Srikanth Jampala
2017-05-10 13:06 ` [PATCH v1 1/3] crypto: cavium - Add support for CNN55XX adapters Srikanth Jampala
2017-05-10 14:38   ` kbuild test robot
2017-05-10 13:06 ` [PATCH v1 2/3] crypto: cavium - Add debugfs support in CNN55XX driver Srikanth Jampala
2017-05-10 13:06 ` [PATCH v1 3/3] crypto: cavium - Register the CNN55XX supported crypto algorithms Srikanth Jampala
2017-05-10 13:56   ` Stephan Müller
2017-05-11 12:18     ` srikanth jampala
2017-05-11 12:22       ` Stephan Müller [this message]
2017-05-11 12:40         ` srikanth jampala
2017-05-30 11:58     ` [PATCH v2 0/3] Add support for Cavium CNN55XX crypto adapters Srikanth Jampala
2017-05-30 11:58       ` [PATCH v2 1/3] crypto: cavium - Add support for CNN55XX adapters Srikanth Jampala
2017-05-30 11:58       ` [PATCH v2 2/3] crypto: cavium - Add debugfs support in CNN55XX driver Srikanth Jampala
2017-05-30 11:58       ` [PATCH v2 3/3] crypto: cavium - Register the CNN55XX supported crypto algorithms Srikanth Jampala
2017-06-10  4:18       ` [PATCH v2 0/3] Add support for Cavium CNN55XX crypto adapters Herbert Xu
2017-05-10 14:43   ` [PATCH v1 3/3] crypto: cavium - Register the CNN55XX supported crypto algorithms kbuild test robot

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=2489871.hhvjNBQWWt@tauon.chronox.de \
    --to=smueller@chronox.de \
    --cc=George.Cherian@cavium.com \
    --cc=Jampala.Srikanth@cavium.com \
    --cc=Nidadavolu.Murthy@cavium.com \
    --cc=Ram.Kumar@cavium.com \
    --cc=Sreerama.Gadam@cavium.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=jsrikanth@caviumnetworks.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@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

all inboxes | Powered by JetHome®