@@ -24,16 +24,6 @@ static DEFINE_SPINLOCK(crypto_default_null_skcipher_lock);
24
24
static struct crypto_sync_skcipher * crypto_default_null_skcipher ;
25
25
static int crypto_default_null_skcipher_refcnt ;
26
26
27
- static int null_compress (struct crypto_tfm * tfm , const u8 * src ,
28
- unsigned int slen , u8 * dst , unsigned int * dlen )
29
- {
30
- if (slen > * dlen )
31
- return - EINVAL ;
32
- memcpy (dst , src , slen );
33
- * dlen = slen ;
34
- return 0 ;
35
- }
36
-
37
27
static int null_init (struct shash_desc * desc )
38
28
{
39
29
return 0 ;
@@ -121,7 +111,7 @@ static struct skcipher_alg skcipher_null = {
121
111
.decrypt = null_skcipher_crypt ,
122
112
};
123
113
124
- static struct crypto_alg null_algs [] = { {
114
+ static struct crypto_alg cipher_null = {
125
115
.cra_name = "cipher_null" ,
126
116
.cra_driver_name = "cipher_null-generic" ,
127
117
.cra_flags = CRYPTO_ALG_TYPE_CIPHER ,
@@ -134,19 +124,8 @@ static struct crypto_alg null_algs[] = { {
134
124
.cia_setkey = null_setkey ,
135
125
.cia_encrypt = null_crypt ,
136
126
.cia_decrypt = null_crypt } }
137
- }, {
138
- .cra_name = "compress_null" ,
139
- .cra_driver_name = "compress_null-generic" ,
140
- .cra_flags = CRYPTO_ALG_TYPE_COMPRESS ,
141
- .cra_blocksize = NULL_BLOCK_SIZE ,
142
- .cra_ctxsize = 0 ,
143
- .cra_module = THIS_MODULE ,
144
- .cra_u = { .compress = {
145
- .coa_compress = null_compress ,
146
- .coa_decompress = null_compress } }
147
- } };
127
+ };
148
128
149
- MODULE_ALIAS_CRYPTO ("compress_null" );
150
129
MODULE_ALIAS_CRYPTO ("digest_null" );
151
130
MODULE_ALIAS_CRYPTO ("cipher_null" );
152
131
@@ -202,7 +181,7 @@ static int __init crypto_null_mod_init(void)
202
181
{
203
182
int ret = 0 ;
204
183
205
- ret = crypto_register_algs ( null_algs , ARRAY_SIZE ( null_algs ) );
184
+ ret = crypto_register_alg ( & cipher_null );
206
185
if (ret < 0 )
207
186
goto out ;
208
187
@@ -219,14 +198,14 @@ static int __init crypto_null_mod_init(void)
219
198
out_unregister_shash :
220
199
crypto_unregister_shash (& digest_null );
221
200
out_unregister_algs :
222
- crypto_unregister_algs ( null_algs , ARRAY_SIZE ( null_algs ) );
201
+ crypto_unregister_alg ( & cipher_null );
223
202
out :
224
203
return ret ;
225
204
}
226
205
227
206
static void __exit crypto_null_mod_fini (void )
228
207
{
229
- crypto_unregister_algs ( null_algs , ARRAY_SIZE ( null_algs ) );
208
+ crypto_unregister_alg ( & cipher_null );
230
209
crypto_unregister_shash (& digest_null );
231
210
crypto_unregister_skcipher (& skcipher_null );
232
211
}
0 commit comments