crc32_generic.c (c39f2d9db0fd81ea20bb5cce9b3f082ca63753e2) crc32_generic.c (674f368a952c48ede71784935a799a5205b92b6c)
1/* GPL HEADER START
2 *
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 only,
7 * as published by the Free Software Foundation.
8 *

--- 46 unchanged lines hidden (view full) ---

55 * If your algorithm starts with ~0, then XOR with ~0 before you set
56 * the seed.
57 */
58static int crc32_setkey(struct crypto_shash *hash, const u8 *key,
59 unsigned int keylen)
60{
61 u32 *mctx = crypto_shash_ctx(hash);
62
1/* GPL HEADER START
2 *
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 only,
7 * as published by the Free Software Foundation.
8 *

--- 46 unchanged lines hidden (view full) ---

55 * If your algorithm starts with ~0, then XOR with ~0 before you set
56 * the seed.
57 */
58static int crc32_setkey(struct crypto_shash *hash, const u8 *key,
59 unsigned int keylen)
60{
61 u32 *mctx = crypto_shash_ctx(hash);
62
63 if (keylen != sizeof(u32)) {
64 crypto_shash_set_flags(hash, CRYPTO_TFM_RES_BAD_KEY_LEN);
63 if (keylen != sizeof(u32))
65 return -EINVAL;
64 return -EINVAL;
66 }
67 *mctx = get_unaligned_le32(key);
68 return 0;
69}
70
71static int crc32_init(struct shash_desc *desc)
72{
73 u32 *mctx = crypto_shash_ctx(desc->tfm);
74 u32 *crcp = shash_desc_ctx(desc);

--- 82 unchanged lines hidden ---
65 *mctx = get_unaligned_le32(key);
66 return 0;
67}
68
69static int crc32_init(struct shash_desc *desc)
70{
71 u32 *mctx = crypto_shash_ctx(desc->tfm);
72 u32 *crcp = shash_desc_ctx(desc);

--- 82 unchanged lines hidden ---