Re: [PATCH 01/19] User-space API definition

From: Miloslav Trmac
Date: Fri Sep 03 2010 - 05:38:12 EST


----- "Herbert Xu" <herbert@xxxxxxxxxxxxxxxxxxxx> wrote:
> Thanks for the updated patch-set. It does indeed fulfil some
> of the requirements raised earlier.
>
> However, as far as I can see this still does not address the
> extensibility. For example, say we want add an interface to
> allow the xoring of two arbitrary data streams using DMA offload,
> this interface would make that quite awkward.
I don't think this would be a problem:

- Expose the xoring as a crypto_tfm, with the usual crypto API string identifier
(this is supposed to be a crypto API interface, not a generic interface
to the platform DMA controller, after all).

- Check to see if the operation can be supported using the existing
attributes, add attributes if necessary.

In this case, NCR_UPDATE_INPUT_DATA can be used for the read-only
stream and NCR_UPDATE_OUTPUT_BUFFER for the read-write steram.

- If this is an entirely new crypto transform type, add support to
the session interface.

In this case, this would probably mean adding NCR_OP_COMBINE (or
something similar); SESSION_INIT would only allocate the tfm,
SESSION_UPDATE would be used for handling blocks of data as they
come and go.

The interface would have to be extended, but the extension would be completely backward-compatible and the additions to the interface would probably be smaller than the additions to the internal crypto API. Notably no new ioctl()s would be needed.
Mirek
--
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/