Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 329704
b: refs/heads/master
c: f4b0277
h: refs/heads/master
v: v3
  • Loading branch information
Jussi Kivilinna authored and Herbert Xu committed Aug 1, 2012
1 parent 205e16b commit 5e8f4d5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 34 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: 648b2a102d268d41d8116abde9081327c1be82e8
refs/heads/master: f4b0277e7ef435733b888a62cf9c4c12b219e7c5
39 changes: 6 additions & 33 deletions trunk/crypto/wp512.c
Original file line number Diff line number Diff line change
Expand Up @@ -1119,7 +1119,7 @@ static int wp256_final(struct shash_desc *desc, u8 *out)
return 0;
}

static struct shash_alg wp512 = {
static struct shash_alg wp_algs[3] = { {
.digestsize = WP512_DIGEST_SIZE,
.init = wp512_init,
.update = wp512_update,
Expand All @@ -1131,9 +1131,7 @@ static struct shash_alg wp512 = {
.cra_blocksize = WP512_BLOCK_SIZE,
.cra_module = THIS_MODULE,
}
};

static struct shash_alg wp384 = {
}, {
.digestsize = WP384_DIGEST_SIZE,
.init = wp512_init,
.update = wp512_update,
Expand All @@ -1145,9 +1143,7 @@ static struct shash_alg wp384 = {
.cra_blocksize = WP512_BLOCK_SIZE,
.cra_module = THIS_MODULE,
}
};

static struct shash_alg wp256 = {
}, {
.digestsize = WP256_DIGEST_SIZE,
.init = wp512_init,
.update = wp512_update,
Expand All @@ -1159,39 +1155,16 @@ static struct shash_alg wp256 = {
.cra_blocksize = WP512_BLOCK_SIZE,
.cra_module = THIS_MODULE,
}
};
} };

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

ret = crypto_register_shash(&wp512);

if (ret < 0)
goto out;

ret = crypto_register_shash(&wp384);
if (ret < 0)
{
crypto_unregister_shash(&wp512);
goto out;
}

ret = crypto_register_shash(&wp256);
if (ret < 0)
{
crypto_unregister_shash(&wp512);
crypto_unregister_shash(&wp384);
}
out:
return ret;
return crypto_register_shashes(wp_algs, ARRAY_SIZE(wp_algs));
}

static void __exit wp512_mod_fini(void)
{
crypto_unregister_shash(&wp512);
crypto_unregister_shash(&wp384);
crypto_unregister_shash(&wp256);
crypto_unregister_shashes(wp_algs, ARRAY_SIZE(wp_algs));
}

MODULE_ALIAS("wp384");
Expand Down

0 comments on commit 5e8f4d5

Please sign in to comment.