@@ -24,16 +24,6 @@ static DEFINE_SPINLOCK(crypto_default_null_skcipher_lock);
2424static struct crypto_sync_skcipher * crypto_default_null_skcipher ;
2525static int crypto_default_null_skcipher_refcnt ;
2626
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-
3727static int null_init (struct shash_desc * desc )
3828{
3929 return 0 ;
@@ -121,7 +111,7 @@ static struct skcipher_alg skcipher_null = {
121111 .decrypt = null_skcipher_crypt ,
122112};
123113
124- static struct crypto_alg null_algs [] = { {
114+ static struct crypto_alg cipher_null = {
125115 .cra_name = "cipher_null" ,
126116 .cra_driver_name = "cipher_null-generic" ,
127117 .cra_flags = CRYPTO_ALG_TYPE_CIPHER ,
@@ -134,19 +124,8 @@ static struct crypto_alg null_algs[] = { {
134124 .cia_setkey = null_setkey ,
135125 .cia_encrypt = null_crypt ,
136126 .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+ };
148128
149- MODULE_ALIAS_CRYPTO ("compress_null" );
150129MODULE_ALIAS_CRYPTO ("digest_null" );
151130MODULE_ALIAS_CRYPTO ("cipher_null" );
152131
@@ -202,7 +181,7 @@ static int __init crypto_null_mod_init(void)
202181{
203182 int ret = 0 ;
204183
205- ret = crypto_register_algs ( null_algs , ARRAY_SIZE ( null_algs ) );
184+ ret = crypto_register_alg ( & cipher_null );
206185 if (ret < 0 )
207186 goto out ;
208187
@@ -219,14 +198,14 @@ static int __init crypto_null_mod_init(void)
219198out_unregister_shash :
220199 crypto_unregister_shash (& digest_null );
221200out_unregister_algs :
222- crypto_unregister_algs ( null_algs , ARRAY_SIZE ( null_algs ) );
201+ crypto_unregister_alg ( & cipher_null );
223202out :
224203 return ret ;
225204}
226205
227206static void __exit crypto_null_mod_fini (void )
228207{
229- crypto_unregister_algs ( null_algs , ARRAY_SIZE ( null_algs ) );
208+ crypto_unregister_alg ( & cipher_null );
230209 crypto_unregister_shash (& digest_null );
231210 crypto_unregister_skcipher (& skcipher_null );
232211}
0 commit comments