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. Thanks, -- Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt -- To unsubscribe from this list: send the line "unsubscribe linux-crypto" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html