Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1708601 > unrolled thread
| Started by | Lars Persson <lars.persson@axis.com> |
|---|---|
| First post | 2017-08-10 15:00 +0200 |
| Last post | 2017-08-10 17:00 +0200 |
| Articles | 3 — 1 participant |
Back to article view | Back to linux.kernel
[PATCH v4 0/4] crypto: add driver for Axis ARTPEC crypto accelerator Lars Persson <lars.persson@axis.com> - 2017-08-10 15:00 +0200
[PATCH v4 2/4] crypto: add crypto_(un)register_ahashes() Lars Persson <lars.persson@axis.com> - 2017-08-10 15:00 +0200
Re: [PATCH v4 2/4] crypto: add crypto_(un)register_ahashes() Lars Persson <lars.persson@axis.com> - 2017-08-10 17:00 +0200
| From | Lars Persson <lars.persson@axis.com> |
|---|---|
| Date | 2017-08-10 15:00 +0200 |
| Subject | [PATCH v4 0/4] crypto: add driver for Axis ARTPEC crypto accelerator |
| Message-ID | <ucVe9-5GH-7@gated-at.bofh.it> |
This series adds a driver for the crypto accelerator in the ARTPEC series of SoCs from Axis Communications AB. Changelog v4: - The skcipher conversion had a mistake where the algos were registered instead of unregistered at module unloading. Changelog v3: - The patch author added his Signed-off-by on patch 2. Changelog v2: - Use xts_check_key() for xts keys. - Use CRYPTO_ALG_TYPE_SKCIPHER instead of CRYPTO_ALG_TYPE_ABLKCIPHER in cra_flags. Lars Persson (3): dt-bindings: crypto: add ARTPEC crypto crypto: axis: add ARTPEC-6/7 crypto accelerator driver MAINTAINERS: Add ARTPEC crypto maintainer Rabin Vincent (1): crypto: add crypto_(un)register_ahashes() .../devicetree/bindings/crypto/artpec6-crypto.txt | 16 + MAINTAINERS | 1 + crypto/ahash.c | 29 + drivers/crypto/Kconfig | 21 + drivers/crypto/Makefile | 1 + drivers/crypto/axis/Makefile | 1 + drivers/crypto/axis/artpec6_crypto.c | 3192 ++++++++++++++++++++ include/crypto/internal/hash.h | 2 + 8 files changed, 3263 insertions(+) create mode 100644 Documentation/devicetree/bindings/crypto/artpec6-crypto.txt create mode 100644 drivers/crypto/axis/Makefile create mode 100644 drivers/crypto/axis/artpec6_crypto.c -- 2.11.0
[toc] | [next] | [standalone]
| From | Lars Persson <lars.persson@axis.com> |
|---|---|
| Date | 2017-08-10 15:00 +0200 |
| Subject | [PATCH v4 2/4] crypto: add crypto_(un)register_ahashes() |
| Message-ID | <ucVec-5GH-47@gated-at.bofh.it> |
| In reply to | #1708601 |
From: Rabin Vincent <rabinv@axis.com>
There are already helpers to (un)register multiple normal
and AEAD algos. Add one for ahashes too.
Signed-off-by: Lars Persson <larper@axis.com>
Signed-off-by: Rabin Vincent <rabinv@axis.com>
---
v4: crypto_register_skciphers was used where crypto_unregister_skciphers
was intended.
crypto/ahash.c | 29 +++++++++++++++++++++++++++++
include/crypto/internal/hash.h | 2 ++
2 files changed, 31 insertions(+)
diff --git a/crypto/ahash.c b/crypto/ahash.c
index 826cd7ab4d4a..5e8666e6ccae 100644
--- a/crypto/ahash.c
+++ b/crypto/ahash.c
@@ -588,6 +588,35 @@ int crypto_unregister_ahash(struct ahash_alg *alg)
}
EXPORT_SYMBOL_GPL(crypto_unregister_ahash);
+int crypto_register_ahashes(struct ahash_alg *algs, int count)
+{
+ int i, ret;
+
+ for (i = 0; i < count; i++) {
+ ret = crypto_register_ahash(&algs[i]);
+ if (ret)
+ goto err;
+ }
+
+ return 0;
+
+err:
+ for (--i; i >= 0; --i)
+ crypto_unregister_ahash(&algs[i]);
+
+ return ret;
+}
+EXPORT_SYMBOL_GPL(crypto_register_ahashes);
+
+void crypto_unregister_ahashes(struct ahash_alg *algs, int count)
+{
+ int i;
+
+ for (i = count - 1; i >= 0; --i)
+ crypto_unregister_ahash(&algs[i]);
+}
+EXPORT_SYMBOL_GPL(crypto_unregister_ahashes);
+
int ahash_register_instance(struct crypto_template *tmpl,
struct ahash_instance *inst)
{
diff --git a/include/crypto/internal/hash.h b/include/crypto/internal/hash.h
index f6d9af3efa45..f0b44c16e88f 100644
--- a/include/crypto/internal/hash.h
+++ b/include/crypto/internal/hash.h
@@ -76,6 +76,8 @@ static inline int crypto_ahash_walk_last(struct crypto_hash_walk *walk)
int crypto_register_ahash(struct ahash_alg *alg);
int crypto_unregister_ahash(struct ahash_alg *alg);
+int crypto_register_ahashes(struct ahash_alg *algs, int count);
+void crypto_unregister_ahashes(struct ahash_alg *algs, int count);
int ahash_register_instance(struct crypto_template *tmpl,
struct ahash_instance *inst);
void ahash_free_instance(struct crypto_instance *inst);
--
2.11.0
[toc] | [prev] | [next] | [standalone]
| From | Lars Persson <lars.persson@axis.com> |
|---|---|
| Date | 2017-08-10 17:00 +0200 |
| Subject | Re: [PATCH v4 2/4] crypto: add crypto_(un)register_ahashes() |
| Message-ID | <ucX6j-723-27@gated-at.bofh.it> |
| In reply to | #1708607 |
On 08/10/2017 02:53 PM, Lars Persson wrote: > From: Rabin Vincent <rabinv@axis.com> > > There are already helpers to (un)register multiple normal > and AEAD algos. Add one for ahashes too. > > Signed-off-by: Lars Persson <larper@axis.com> > Signed-off-by: Rabin Vincent <rabinv@axis.com> > --- > v4: crypto_register_skciphers was used where crypto_unregister_skciphers > was intended. > The v4 change comment above in fact belongs to patch 3/4 of this series. Sorry for the confusion. BR, Lars
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web