arc4.c (5800571960234f9d1f1011bf135799b2014d4268) arc4.c (d6ebf5286f8f94a254a8c90d4b9f2a8b076a8634)
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * Cryptographic API
4 *
5 * ARC4 Cipher Algorithm
6 *
7 * Jon Oberheide <jon@oberheide.org>
1/*
2 * Cryptographic API
3 *
4 * ARC4 Cipher Algorithm
5 *
6 * Jon Oberheide <jon@oberheide.org>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
8 */
9
10#include <crypto/algapi.h>
11#include <crypto/arc4.h>
12#include <crypto/internal/skcipher.h>
13#include <linux/init.h>
14#include <linux/module.h>
15

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

105 err = skcipher_walk_done(&walk, 0);
106 }
107
108 return err;
109}
110
111static struct crypto_alg arc4_cipher = {
112 .cra_name = "arc4",
13 */
14
15#include <crypto/algapi.h>
16#include <crypto/arc4.h>
17#include <crypto/internal/skcipher.h>
18#include <linux/init.h>
19#include <linux/module.h>
20

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

110 err = skcipher_walk_done(&walk, 0);
111 }
112
113 return err;
114}
115
116static struct crypto_alg arc4_cipher = {
117 .cra_name = "arc4",
118 .cra_driver_name = "arc4-generic",
113 .cra_flags = CRYPTO_ALG_TYPE_CIPHER,
114 .cra_blocksize = ARC4_BLOCK_SIZE,
115 .cra_ctxsize = sizeof(struct arc4_ctx),
116 .cra_module = THIS_MODULE,
117 .cra_u = {
118 .cipher = {
119 .cia_min_keysize = ARC4_MIN_KEY_SIZE,
120 .cia_max_keysize = ARC4_MAX_KEY_SIZE,
121 .cia_setkey = arc4_set_key,
122 .cia_encrypt = arc4_crypt_one,
123 .cia_decrypt = arc4_crypt_one,
124 },
125 },
126};
127
128static struct skcipher_alg arc4_skcipher = {
129 .base.cra_name = "ecb(arc4)",
119 .cra_flags = CRYPTO_ALG_TYPE_CIPHER,
120 .cra_blocksize = ARC4_BLOCK_SIZE,
121 .cra_ctxsize = sizeof(struct arc4_ctx),
122 .cra_module = THIS_MODULE,
123 .cra_u = {
124 .cipher = {
125 .cia_min_keysize = ARC4_MIN_KEY_SIZE,
126 .cia_max_keysize = ARC4_MAX_KEY_SIZE,
127 .cia_setkey = arc4_set_key,
128 .cia_encrypt = arc4_crypt_one,
129 .cia_decrypt = arc4_crypt_one,
130 },
131 },
132};
133
134static struct skcipher_alg arc4_skcipher = {
135 .base.cra_name = "ecb(arc4)",
136 .base.cra_driver_name = "ecb(arc4)-generic",
130 .base.cra_priority = 100,
131 .base.cra_blocksize = ARC4_BLOCK_SIZE,
132 .base.cra_ctxsize = sizeof(struct arc4_ctx),
133 .base.cra_module = THIS_MODULE,
134 .min_keysize = ARC4_MIN_KEY_SIZE,
135 .max_keysize = ARC4_MAX_KEY_SIZE,
136 .setkey = arc4_set_key_skcipher,
137 .encrypt = ecb_arc4_crypt,

--- 30 unchanged lines hidden ---
137 .base.cra_priority = 100,
138 .base.cra_blocksize = ARC4_BLOCK_SIZE,
139 .base.cra_ctxsize = sizeof(struct arc4_ctx),
140 .base.cra_module = THIS_MODULE,
141 .min_keysize = ARC4_MIN_KEY_SIZE,
142 .max_keysize = ARC4_MAX_KEY_SIZE,
143 .setkey = arc4_set_key_skcipher,
144 .encrypt = ecb_arc4_crypt,

--- 30 unchanged lines hidden ---