linux/crypto/ccm.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * CCM: Counter with CBC-MAC
 *
 * (C) Copyright IBM Corp. 2007 - Joy Latten <[email protected]>
 */

#include <crypto/internal/aead.h>
#include <crypto/internal/cipher.h>
#include <crypto/internal/hash.h>
#include <crypto/internal/skcipher.h>
#include <crypto/scatterwalk.h>
#include <linux/err.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/slab.h>

struct ccm_instance_ctx {};

struct crypto_ccm_ctx {};

struct crypto_rfc4309_ctx {};

struct crypto_rfc4309_req_ctx {};

struct crypto_ccm_req_priv_ctx {};

struct cbcmac_tfm_ctx {};

struct cbcmac_desc_ctx {};

static inline struct crypto_ccm_req_priv_ctx *crypto_ccm_reqctx(
	struct aead_request *req)
{}

static int set_msg_len(u8 *block, unsigned int msglen, int csize)
{}

static int crypto_ccm_setkey(struct crypto_aead *aead, const u8 *key,
			     unsigned int keylen)
{}

static int crypto_ccm_setauthsize(struct crypto_aead *tfm,
				  unsigned int authsize)
{}

static int format_input(u8 *info, struct aead_request *req,
			unsigned int cryptlen)
{}

static int format_adata(u8 *adata, unsigned int a)
{}

static int crypto_ccm_auth(struct aead_request *req, struct scatterlist *plain,
			   unsigned int cryptlen)
{}

static void crypto_ccm_encrypt_done(void *data, int err)
{}

static inline int crypto_ccm_check_iv(const u8 *iv)
{}

static int crypto_ccm_init_crypt(struct aead_request *req, u8 *tag)
{}

static int crypto_ccm_encrypt(struct aead_request *req)
{}

static void crypto_ccm_decrypt_done(void *data, int err)
{}

static int crypto_ccm_decrypt(struct aead_request *req)
{}

static int crypto_ccm_init_tfm(struct crypto_aead *tfm)
{}

static void crypto_ccm_exit_tfm(struct crypto_aead *tfm)
{}

static void crypto_ccm_free(struct aead_instance *inst)
{}

static int crypto_ccm_create_common(struct crypto_template *tmpl,
				    struct rtattr **tb,
				    const char *ctr_name,
				    const char *mac_name)
{}

static int crypto_ccm_create(struct crypto_template *tmpl, struct rtattr **tb)
{}

static int crypto_ccm_base_create(struct crypto_template *tmpl,
				  struct rtattr **tb)
{}

static int crypto_rfc4309_setkey(struct crypto_aead *parent, const u8 *key,
				 unsigned int keylen)
{}

static int crypto_rfc4309_setauthsize(struct crypto_aead *parent,
				      unsigned int authsize)
{}

static struct aead_request *crypto_rfc4309_crypt(struct aead_request *req)
{}

static int crypto_rfc4309_encrypt(struct aead_request *req)
{}

static int crypto_rfc4309_decrypt(struct aead_request *req)
{}

static int crypto_rfc4309_init_tfm(struct crypto_aead *tfm)
{}

static void crypto_rfc4309_exit_tfm(struct crypto_aead *tfm)
{}

static void crypto_rfc4309_free(struct aead_instance *inst)
{}

static int crypto_rfc4309_create(struct crypto_template *tmpl,
				 struct rtattr **tb)
{}

static int crypto_cbcmac_digest_setkey(struct crypto_shash *parent,
				     const u8 *inkey, unsigned int keylen)
{}

static int crypto_cbcmac_digest_init(struct shash_desc *pdesc)
{}

static int crypto_cbcmac_digest_update(struct shash_desc *pdesc, const u8 *p,
				       unsigned int len)
{}

static int crypto_cbcmac_digest_final(struct shash_desc *pdesc, u8 *out)
{}

static int cbcmac_init_tfm(struct crypto_tfm *tfm)
{
	struct crypto_cipher *cipher;
	struct crypto_instance *inst = (void *)tfm->__crt_alg;
	struct crypto_cipher_spawn *spawn = crypto_instance_ctx(inst);
	struct cbcmac_tfm_ctx *ctx = crypto_tfm_ctx(tfm);

	cipher = crypto_spawn_cipher(spawn);
	if (IS_ERR(cipher))
		return PTR_ERR(cipher);

	ctx->child = cipher;

	return 0;
};

static void cbcmac_exit_tfm(struct crypto_tfm *tfm)
{}

static int cbcmac_create(struct crypto_template *tmpl, struct rtattr **tb)
{}

static struct crypto_template crypto_ccm_tmpls[] =;

static int __init crypto_ccm_module_init(void)
{}

static void __exit crypto_ccm_module_exit(void)
{}

subsys_initcall(crypto_ccm_module_init);
module_exit(crypto_ccm_module_exit);

MODULE_LICENSE();
MODULE_DESCRIPTION();
MODULE_ALIAS_CRYPTO();
MODULE_ALIAS_CRYPTO();
MODULE_ALIAS_CRYPTO();
MODULE_ALIAS_CRYPTO();
MODULE_IMPORT_NS();