Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 329700
b: refs/heads/master
c: 50fc3e8
h: refs/heads/master
v: v3
  • Loading branch information
Jussi Kivilinna authored and Herbert Xu committed Aug 1, 2012
1 parent a70c7dc commit 4b36666
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8fc229a51b0e10f4ceb794e8b99fa0a427a7ba41
refs/heads/master: 50fc3e8d2c9d1ee72c67b751e5ac5d76ebc5a12e
36 changes: 36 additions & 0 deletions trunk/crypto/shash.c
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,42 @@ int crypto_unregister_shash(struct shash_alg *alg)
}
EXPORT_SYMBOL_GPL(crypto_unregister_shash);

int crypto_register_shashes(struct shash_alg *algs, int count)
{
int i, ret;

for (i = 0; i < count; i++) {
ret = crypto_register_shash(&algs[i]);
if (ret)
goto err;
}

return 0;

err:
for (--i; i >= 0; --i)
crypto_unregister_shash(&algs[i]);

return ret;
}
EXPORT_SYMBOL_GPL(crypto_register_shashes);

int crypto_unregister_shashes(struct shash_alg *algs, int count)
{
int i, ret;

for (i = count - 1; i >= 0; --i) {
ret = crypto_unregister_shash(&algs[i]);
if (ret)
pr_err("Failed to unregister %s %s: %d\n",
algs[i].base.cra_driver_name,
algs[i].base.cra_name, ret);
}

return 0;
}
EXPORT_SYMBOL_GPL(crypto_unregister_shashes);

int shash_register_instance(struct crypto_template *tmpl,
struct shash_instance *inst)
{
Expand Down
2 changes: 2 additions & 0 deletions trunk/include/crypto/internal/hash.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ struct hash_alg_common *ahash_attr_alg(struct rtattr *rta, u32 type, u32 mask);

int crypto_register_shash(struct shash_alg *alg);
int crypto_unregister_shash(struct shash_alg *alg);
int crypto_register_shashes(struct shash_alg *algs, int count);
int crypto_unregister_shashes(struct shash_alg *algs, int count);
int shash_register_instance(struct crypto_template *tmpl,
struct shash_instance *inst);
void shash_free_instance(struct crypto_instance *inst);
Expand Down

0 comments on commit 4b36666

Please sign in to comment.