linux/crypto/crypto_null.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Cryptographic API.
 *
 * Null algorithms, aka Much Ado About Nothing.
 *
 * These are needed for IPsec, and may be useful in general for
 * testing & debugging.
 *
 * The null cipher is compliant with RFC2410.
 *
 * Copyright (c) 2002 James Morris <[email protected]>
 */

#include <crypto/null.h>
#include <crypto/internal/hash.h>
#include <crypto/internal/skcipher.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/mm.h>
#include <linux/string.h>

static DEFINE_MUTEX(crypto_default_null_skcipher_lock);
static struct crypto_sync_skcipher *crypto_default_null_skcipher;
static int crypto_default_null_skcipher_refcnt;

static int null_compress(struct crypto_tfm *tfm, const u8 *src,
			 unsigned int slen, u8 *dst, unsigned int *dlen)
{}

static int null_init(struct shash_desc *desc)
{}

static int null_update(struct shash_desc *desc, const u8 *data,
		       unsigned int len)
{}

static int null_final(struct shash_desc *desc, u8 *out)
{}

static int null_digest(struct shash_desc *desc, const u8 *data,
		       unsigned int len, u8 *out)
{}

static int null_hash_setkey(struct crypto_shash *tfm, const u8 *key,
			    unsigned int keylen)
{}

static int null_skcipher_setkey(struct crypto_skcipher *tfm, const u8 *key,
				unsigned int keylen)
{}

static int null_setkey(struct crypto_tfm *tfm, const u8 *key,
		       unsigned int keylen)
{}

static void null_crypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src)
{}

static int null_skcipher_crypt(struct skcipher_request *req)
{}

static struct shash_alg digest_null =;

static struct skcipher_alg skcipher_null =;

static struct crypto_alg null_algs[] =;

MODULE_ALIAS_CRYPTO();
MODULE_ALIAS_CRYPTO();
MODULE_ALIAS_CRYPTO();

struct crypto_sync_skcipher *crypto_get_default_null_skcipher(void)
{}
EXPORT_SYMBOL_GPL();

void crypto_put_default_null_skcipher(void)
{}
EXPORT_SYMBOL_GPL();

static int __init crypto_null_mod_init(void)
{}

static void __exit crypto_null_mod_fini(void)
{}

subsys_initcall(crypto_null_mod_init);
module_exit(crypto_null_mod_fini);

MODULE_LICENSE();
MODULE_DESCRIPTION();