mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Herbert Xu <herbert@gondor.apana.org.au>
To: Tadeusz Struk <tadeusz.struk@intel.com>
Cc: linux-kernel@vger.kernel.org, keescook@chromium.org,
	jwboyer@redhat.com, smueller@chronox.de, richard@nod.at,
	steved@redhat.com, qat-linux@intel.com, dhowells@redhat.com,
	linux-crypto@vger.kernel.org, james.l.morris@oracle.com,
	jkosina@suse.cz, zohar@linux.vnet.ibm.com, davem@davemloft.net,
	vgoyal@redhat.com
Subject: Re: [PATCH RFC v6 1/3] crypto: add PKE API
Date: Tue, 16 Jun 2015 16:19:25 +0800	[thread overview]
Message-ID: <20150616081925.GA23347@gondor.apana.org.au> (raw)
In-Reply-To: <20150616080159.447.30041.stgit@tstruk-mobl1>

On Tue, Jun 16, 2015 at 01:01:59AM -0700, Tadeusz Struk wrote:
>
> @@ -28,6 +28,7 @@ crypto_hash-y += shash.o
>  obj-$(CONFIG_CRYPTO_HASH2) += crypto_hash.o
>  
>  obj-$(CONFIG_CRYPTO_PCOMP2) += pcompress.o
> +obj-$(CONFIG_CRYPTO_AKCIPHER) += akcipher.o

s/AKCIPHER/AKCIPHER2/

> +/**
> + * struct akcipher_request - public key request
> + *
> + * @base:	Common attributes for async crypto requests
> + * @src:	Pointer to memory containing the input parameters
> + *		The format of the parameter(s) is expeted to be Octet String
> + * @dst:	Pointer to memory whare the result will be stored
> + * @src_len:	Size of the input parameter
> + * @dst_len:	Size of the output buffer. It needs to be at leaset
> + *		as big as the expected result depending	on the operation
> + *		After operation it will be updated with the acctual size of the
> + *		result. In case of error, where the dst_len was insufficient,
> + *		it will be updated to the size required for the operation.
> + * @result_len: If not NULL this will be updated by the implementation to
> + *		reflect the acctual size of the result

result_len is still here.

> + * @__ctx:	Start of private context data
> + */
> +struct akcipher_request {
> +	struct crypto_async_request base;
> +	void *src;
> +	void *dst;
> +	unsigned int src_len;
> +	unsigned int *dst_len;

dst_len doesn't need to be a pointer.  A simple int will do.

> +static inline int crypto_akcipher_encrypt(struct akcipher_request *req)
> +{
> +	struct crypto_akcipher *tfm = __crypto_akcipher_tfm(req->base.tfm);

You should add a reqtfm helper like crypto_aead_reqtfm so that
implementors don't need to do this ugly __crypto_akcipher_tfm.

In fact you already have that helper so you just need to use it.

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

  reply	other threads:[~2015-06-16  8:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-16  8:01 [PATCH RFC v6 0/3] crypto: Introduce Public Key Encryption API Tadeusz Struk
2015-06-16  8:01 ` [PATCH RFC v6 1/3] crypto: add PKE API Tadeusz Struk
2015-06-16  8:19   ` Herbert Xu [this message]
2015-06-16  8:02 ` [PATCH RFC v6 2/3] crypto: rsa: add a new rsa generic implementation Tadeusz Struk
2015-06-16  8:41   ` Herbert Xu
2015-06-16  8:02 ` [PATCH RFC v6 3/3] crypto: add tests vectors for RSA Tadeusz Struk

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=20150616081925.GA23347@gondor.apana.org.au \
    --to=herbert@gondor.apana.org.au \
    --cc=davem@davemloft.net \
    --cc=dhowells@redhat.com \
    --cc=james.l.morris@oracle.com \
    --cc=jkosina@suse.cz \
    --cc=jwboyer@redhat.com \
    --cc=keescook@chromium.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=qat-linux@intel.com \
    --cc=richard@nod.at \
    --cc=smueller@chronox.de \
    --cc=steved@redhat.com \
    --cc=tadeusz.struk@intel.com \
    --cc=vgoyal@redhat.com \
    --cc=zohar@linux.vnet.ibm.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

all inboxes | Powered by JetHome®