-struct crypto_skcipher *crypto_get_default_null_skcipher2(void)
-{
- struct crypto_skcipher *tfm;
-
- mutex_lock(&crypto_default_null_skcipher_lock);
- tfm = crypto_default_null_skcipher2;
-
- if (!tfm) {
- tfm = crypto_alloc_skcipher("ecb(cipher_null)",
- 0, CRYPTO_ALG_ASYNC);
- if (IS_ERR(tfm))
- goto unlock;
-
- crypto_default_null_skcipher2 = tfm;
- }
-
- crypto_default_null_skcipher2_refcnt++;
-
-unlock:
- mutex_unlock(&crypto_default_null_skcipher_lock);
-
- return tfm;
-}
-EXPORT_SYMBOL_GPL(crypto_get_default_null_skcipher2);
-
-void crypto_put_default_null_skcipher2(void)
-{
- mutex_lock(&crypto_default_null_skcipher_lock);
- if (!--crypto_default_null_skcipher2_refcnt) {
- crypto_free_skcipher(crypto_default_null_skcipher2);
- crypto_default_null_skcipher2 = NULL;
- }
- mutex_unlock(&crypto_default_null_skcipher_lock);
-}
-EXPORT_SYMBOL_GPL(crypto_put_default_null_skcipher2);
-