Re: [PATCH RFC v3 1/3] crypto: add PKE API

From: Tadeusz Struk
Date: Thu Jun 04 2015 - 13:23:15 EST


Hi Herbert,
On 06/03/2015 11:49 PM, Herbert Xu wrote:
> Because the caller is going to be allocating memory for the output,
> we need to provide a way for them to know how much memory to
> allocate.
>
> This presumably will depend on the key size.
>
> So something like
>
> int (*maxsize)(struct crypto_akcipher *tfm);
>
> is needed.
>
> You should also provide setkey here. You can't just save a pointer
> to the key. The transform must hold the key physically as the
> original may go away. It should also ensure that the key is
> actually valid for the transform.
>
> base already has ctx so you should get rid of ctx and move base
> to the end of the struct.

right, will do that.
Thanks for quick response.




--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/