crypto: algif_akcipher user space interface

This patch adds the AF_ALG interface to user space.

The akcipher kernel crypto API uses linear buffers (instead of the
scatter lists for the other AF_ALG interfaces). To handle such linear
buffer, the interface handler uses an internal buffer to operate on
data. The buffer has the size required by the asymmetric cipher
implementation and usually is identical to the modulus.

The algif_akcipher interface provides a sendmsg as well as a sendpage
interface.

As requested by RFC3447, the maximum buffer size for input data to
either encryption, decryption, sig gen, sig ver is equal to the size
of the modulus. The buffer size has an absolute limit of PAGE_SIZE
to catch errors in an underlying asym cipher implementation.

CC: Tadeusz Struk <tadeusz.struk@intel.com>
Signed-off-by: Stephan Mueller <smueller@chronox.de>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
1 file changed