Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 329702
b: refs/heads/master
c: 6aeb49b
h: refs/heads/master
v: v3
  • Loading branch information
Jussi Kivilinna authored and Herbert Xu committed Aug 1, 2012
1 parent 473766f commit 56a7b77
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 21 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: a5e7a2dcfcf360f285db9edd479491b1e2207b4f
refs/heads/master: 6aeb49bc5a6fffe2f8ba0668cf7459b6a4b672dc
25 changes: 5 additions & 20 deletions trunk/crypto/sha256_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ static int sha256_import(struct shash_desc *desc, const void *in)
return 0;
}

static struct shash_alg sha256 = {
static struct shash_alg sha256_algs[2] = { {
.digestsize = SHA256_DIGEST_SIZE,
.init = sha256_init,
.update = sha256_update,
Expand All @@ -352,9 +352,7 @@ static struct shash_alg sha256 = {
.cra_blocksize = SHA256_BLOCK_SIZE,
.cra_module = THIS_MODULE,
}
};

static struct shash_alg sha224 = {
}, {
.digestsize = SHA224_DIGEST_SIZE,
.init = sha224_init,
.update = sha256_update,
Expand All @@ -367,29 +365,16 @@ static struct shash_alg sha224 = {
.cra_blocksize = SHA224_BLOCK_SIZE,
.cra_module = THIS_MODULE,
}
};
} };

static int __init sha256_generic_mod_init(void)
{
int ret = 0;

ret = crypto_register_shash(&sha224);

if (ret < 0)
return ret;

ret = crypto_register_shash(&sha256);

if (ret < 0)
crypto_unregister_shash(&sha224);

return ret;
return crypto_register_shashes(sha256_algs, ARRAY_SIZE(sha256_algs));
}

static void __exit sha256_generic_mod_fini(void)
{
crypto_unregister_shash(&sha224);
crypto_unregister_shash(&sha256);
crypto_unregister_shashes(sha256_algs, ARRAY_SIZE(sha256_algs));
}

module_init(sha256_generic_mod_init);
Expand Down

0 comments on commit 56a7b77

Please sign in to comment.