linux/crypto/lrw.c

// SPDX-License-Identifier: GPL-2.0-or-later
/* LRW: as defined by Cyril Guyot in
 *	http://grouper.ieee.org/groups/1619/email/pdf00017.pdf
 *
 * Copyright (c) 2006 Rik Snel <[email protected]>
 *
 * Based on ecb.c
 * Copyright (c) 2006 Herbert Xu <[email protected]>
 */
/* This implementation is checked against the test vectors in the above
 * document and by a test vector provided by Ken Buchanan at
 * https://www.mail-archive.com/[email protected]/msg00173.html
 *
 * The test vectors are included in the testing module tcrypt.[ch] */

#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/scatterlist.h>
#include <linux/slab.h>

#include <crypto/b128ops.h>
#include <crypto/gf128mul.h>

#define LRW_BLOCK_SIZE

struct lrw_tfm_ctx {};

struct lrw_request_ctx {};

static inline void lrw_setbit128_bbe(void *b, int bit)
{}

static int lrw_setkey(struct crypto_skcipher *parent, const u8 *key,
		      unsigned int keylen)
{}

/*
 * Returns the number of trailing '1' bits in the words of the counter, which is
 * represented by 4 32-bit words, arranged from least to most significant.
 * At the same time, increments the counter by one.
 *
 * For example:
 *
 * u32 counter[4] = { 0xFFFFFFFF, 0x1, 0x0, 0x0 };
 * int i = lrw_next_index(&counter);
 * // i == 33, counter == { 0x0, 0x2, 0x0, 0x0 }
 */
static int lrw_next_index(u32 *counter)
{}

/*
 * We compute the tweak masks twice (both before and after the ECB encryption or
 * decryption) to avoid having to allocate a temporary buffer and/or make
 * mutliple calls to the 'ecb(..)' instance, which usually would be slower than
 * just doing the lrw_next_index() calls again.
 */
static int lrw_xor_tweak(struct skcipher_request *req, bool second_pass)
{}

static int lrw_xor_tweak_pre(struct skcipher_request *req)
{}

static int lrw_xor_tweak_post(struct skcipher_request *req)
{}

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

static void lrw_init_crypt(struct skcipher_request *req)
{}

static int lrw_encrypt(struct skcipher_request *req)
{}

static int lrw_decrypt(struct skcipher_request *req)
{}

static int lrw_init_tfm(struct crypto_skcipher *tfm)
{}

static void lrw_exit_tfm(struct crypto_skcipher *tfm)
{}

static void lrw_free_instance(struct skcipher_instance *inst)
{}

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

static struct crypto_template lrw_tmpl =;

static int __init lrw_module_init(void)
{}

static void __exit lrw_module_exit(void)
{}

subsys_initcall(lrw_module_init);
module_exit(lrw_module_exit);

MODULE_LICENSE();
MODULE_DESCRIPTION();
MODULE_ALIAS_CRYPTO();
MODULE_SOFTDEP();