Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 157950
b: refs/heads/master
c: 619a6eb
h: refs/heads/master
v: v3
  • Loading branch information
Herbert Xu committed Jul 8, 2009
1 parent 106fa05 commit 00982cb
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7d6f56400a695af497a8b7c23ea0ff9c3d9d99f4
refs/heads/master: 619a6ebd2547f3a8ec2fbc5245daaa1f2056eb32
26 changes: 25 additions & 1 deletion trunk/crypto/shash.c
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ struct crypto_shash *crypto_alloc_shash(const char *alg_name, u32 type,
}
EXPORT_SYMBOL_GPL(crypto_alloc_shash);

int crypto_register_shash(struct shash_alg *alg)
static int shash_prepare_alg(struct shash_alg *alg)
{
struct crypto_alg *base = &alg->base;

Expand All @@ -491,6 +491,17 @@ int crypto_register_shash(struct shash_alg *alg)
base->cra_type = &crypto_shash_type;
base->cra_flags &= ~CRYPTO_ALG_TYPE_MASK;
base->cra_flags |= CRYPTO_ALG_TYPE_SHASH;
return 0;
}

int crypto_register_shash(struct shash_alg *alg)
{
struct crypto_alg *base = &alg->base;
int err;

err = shash_prepare_alg(alg);
if (err)
return err;

return crypto_register_alg(base);
}
Expand All @@ -502,6 +513,19 @@ int crypto_unregister_shash(struct shash_alg *alg)
}
EXPORT_SYMBOL_GPL(crypto_unregister_shash);

int shash_register_instance(struct crypto_template *tmpl,
struct shash_instance *inst)
{
int err;

err = shash_prepare_alg(&inst->alg);
if (err)
return err;

return crypto_register_instance(tmpl, shash_crypto_instance(inst));
}
EXPORT_SYMBOL_GPL(shash_register_instance);

void shash_free_instance(struct crypto_instance *inst)
{
crypto_drop_spawn(crypto_instance_ctx(inst));
Expand Down
3 changes: 2 additions & 1 deletion trunk/include/crypto/internal/hash.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ int crypto_hash_walk_first_compat(struct hash_desc *hdesc,

int crypto_register_shash(struct shash_alg *alg);
int crypto_unregister_shash(struct shash_alg *alg);

int shash_register_instance(struct crypto_template *tmpl,
struct shash_instance *inst);
void shash_free_instance(struct crypto_instance *inst);

int crypto_init_shash_spawn(struct crypto_shash_spawn *spawn,
Expand Down

0 comments on commit 00982cb

Please sign in to comment.