From: Nicolas Royer Subject: [PATCH 4/5] crypto: Atmel TDES driver: add support for latest release of the IP (0x700) Date: Tue, 6 Nov 2012 17:33:01 +0100 Message-ID: <1352219581-30489-1-git-send-email-nicolas@eukrea.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Cc: herbert@gondor.apana.org.au, nicolas.ferre@atmel.com, linux-crypto@vger.kernel.org, eric@eukrea.com, plagnioj@jcrosoft.com, davem@davemloft.net, linux-arm-kernel@lists.infradead.org, Nicolas Royer To: linux-kernel@vger.kernel.org Return-path: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org List-Id: linux-crypto.vger.kernel.org VXBkYXRlIGZyb20gcHJldmlvdXMgSVAgcmVsZWFzZSAoMHg2MDApOgogLSBhZGQgRE1BIHN1cHBv cnQgKHByZXZpb3VzIElQIHJlbGVhc2UgdXNlIFBEQykKClNpZ25lZC1vZmYtYnk6IE5pY29sYXMg Um95ZXIgPG5pY29sYXNAZXVrcmVhLmNvbT4KQWNrZWQtYnk6IE5pY29sYXMgRmVycmUgPG5pY29s YXMuZmVycmVAYXRtZWwuY29tPgpBY2tlZC1ieTogRXJpYyBCw6luYXJkIDxlcmljQGV1a3JlYS5j b20+ClRlc3RlZC1ieTogRXJpYyBCw6luYXJkIDxlcmljQGV1a3JlYS5jb20+Ci0tLQogZHJpdmVy cy9jcnlwdG8vYXRtZWwtdGRlcy1yZWdzLmggfCAgICAyICsKIGRyaXZlcnMvY3J5cHRvL2F0bWVs LXRkZXMuYyAgICAgIHwgIDM5NCArKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKystLS0t LQogMiBmaWxlcyBjaGFuZ2VkLCAzNDMgaW5zZXJ0aW9ucygrKSwgNTMgZGVsZXRpb25zKC0pCgpk aWZmIC0tZ2l0IGEvZHJpdmVycy9jcnlwd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