From: =?UTF-8?q?Horia=20Geant=C4=83?= Subject: [RFC 7/7] crypto: caam/qi - add ablkcipher and authenc algorithms Date: Fri, 3 Mar 2017 16:52:13 +0200 Message-ID: <1488552733-20806-8-git-send-email-horia.geanta@nxp.com> References: <1488552733-20806-1-git-send-email-horia.geanta@nxp.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Cc: linux-arm-kernel@lists.infradead.org, Claudiu Manoil , Cristian Stoica , Dan Douglass , linux-crypto@vger.kernel.org, Vakul Garg , Vakul Garg , Alexandru Porosanu To: Herbert Xu , Scott Wood , Roy Pledge Return-path: In-Reply-To: <1488552733-20806-1-git-send-email-horia.geanta@nxp.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org List-Id: linux-crypto.vger.kernel.org QWRkIHN1cHBvcnQgdG8gc3VibWl0IGFibGtjaXBoZXIgYW5kIGF1dGhlbmMgYWxnb3JpdGhtcwp2 aWEgdGhlIFFJIGJhY2tlbmQ6Ci1hYmxrY2lwaGVyOgpjYmMoe2FlcyxkZXMsZGVzM19lZGV9KQpj dHIoYWVzKSwgcmZjMzY4NihjdHIoYWVzKSkKeHRzKGFlcykKLWF1dGhlbmM6CmF1dGhlbmMoaG1h YyhtZDUpLGNiYyh7YWVzLGRlcyxkZXMzX2VkZX0pKQphdXRoZW5jKGhtYWMoc2hhKiksY2JjKHth ZXMsZGVzLGRlczNfZWRlfSkpCgpjYWFtL3FpIGJlaW5nIGEgbmV3IGRyaXZlciwgbGV0J3Mgd2Fp dCBzb21lIHRpbWUgdG8gc2V0dGxlIGRvd24gd2l0aG91dAppbnRlcmZlcmluZyB3aXRoIGV4aXN0 aW5nIGNhYW0vanIgZHJpdmVyLgpBY2NvcmRpbmdseSwgZm9yIG5vdyBhbGwgY2FhbS9xaSBhbGdv cml0aG1zIChjYWFtYWxnX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