From: Tadeusz Struk <tadeusz.struk@intel.com>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: linux-crypto@vger.kernel.org, qat-linux@intel.com
Subject: Re: [PATCH v5 1/2] lib/mpi: Add mpi sgl helpers
Date: Thu, 8 Oct 2015 06:31:52 -0700 [thread overview]
Message-ID: <56167048.5080505@intel.com> (raw)
In-Reply-To: <20151008130203.GA24128@gondor.apana.org.au>
On 10/08/2015 06:02 AM, Herbert Xu wrote:
> On Thu, Oct 01, 2015 at 10:10:38PM -0700, Tadeusz Struk wrote:
>>
>> +/**
>> + * mpi_write_to_sgl() - Funnction exports MPI to an sgl (msb first)
>> + *
>> + * This function works in the same way as the mpi_read_buffer, but it
>> + * takes an sgl instead of u8 * buf.
>> + *
>> + * @a: a multi precision integer
>> + * @sgl: scatterlist to write to. Needs to be at least
>> + * mpi_get_size(a) long.
>> + * @nbytes: receives the actual length of the data written.
>> + * @sign: if not NULL, it will be set to the sign of a.
>> + *
>> + * Return: 0 on success or error code in case of error
>> + */
>> +int mpi_write_to_sgl(MPI a, struct scatterlist *sgl, unsigned *nbytes,
>> + int *sign)
>
> Where is the maximum length of sgl? You should not assume that the
> entire SG list is for you to use. So the length that you are allowed
> to use should be passed in explicitly. You can just put it into
> nbytes.
The sgl has to be big enough to take the whole integer.
What would be the point to export only part of a number?
next prev parent reply other threads:[~2015-10-08 13:34 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-02 5:10 [PATCH v5 0/2] crypto: akcipher - Changes to asymmetric key API Tadeusz Struk
2015-10-02 5:10 ` [PATCH v5 1/2] lib/mpi: Add mpi sgl helpers Tadeusz Struk
2015-10-08 13:02 ` Herbert Xu
2015-10-08 13:31 ` Tadeusz Struk [this message]
2015-10-08 13:36 ` Herbert Xu
2015-10-02 5:10 ` [PATCH v5 2/2] crypto: akcipher - Changes to asymmetric key API Tadeusz Struk
2015-10-08 13:02 ` Herbert Xu
2015-10-08 13:06 ` 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=56167048.5080505@intel.com \
--to=tadeusz.struk@intel.com \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
--cc=qat-linux@intel.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