lkml.org 
[lkml]   [2010]   [Sep]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 01/19] User-space API definition
----- "Herbert Xu" <herbert@gondor.hengli.com.au> 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


\
 
 \ /
  Last update: 2010-09-03 11:41    [W:0.200 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site