From: Miloslav Trmac Subject: Re: [PATCH 01/19] User-space API definition Date: Fri, 3 Sep 2010 05:38:00 -0400 (EDT) Message-ID: <245859135.862181283506680927.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com> References: <423332662.861981283506383923.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: linux-crypto@vger.kernel.org, Nikos Mavrogiannopoulos , Neil Horman , linux-kernel@vger.kernel.org To: Herbert Xu Return-path: Received: from mx3-phx2.redhat.com ([209.132.183.24]:56473 "EHLO mx01.colomx.prod.int.phx2.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751250Ab0ICJiG (ORCPT ); Fri, 3 Sep 2010 05:38:06 -0400 In-Reply-To: <423332662.861981283506383923.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com> Sender: linux-crypto-owner@vger.kernel.org List-ID: ----- "Herbert Xu" 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