linux/arch/x86/crypto/sm4_aesni_avx_glue.c

/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
 * SM4 Cipher Algorithm, AES-NI/AVX optimized.
 * as specified in
 * https://tools.ietf.org/id/draft-ribose-cfrg-sm4-10.html
 *
 * Copyright (c) 2021, Alibaba Group.
 * Copyright (c) 2021 Tianjia Zhang <[email protected]>
 */

#include <linux/module.h>
#include <linux/crypto.h>
#include <linux/kernel.h>
#include <asm/simd.h>
#include <crypto/internal/simd.h>
#include <crypto/internal/skcipher.h>
#include <crypto/sm4.h>
#include "sm4-avx.h"

#define SM4_CRYPT8_BLOCK_SIZE

asmlinkage void sm4_aesni_avx_crypt4(const u32 *rk, u8 *dst,
				const u8 *src, int nblocks);
asmlinkage void sm4_aesni_avx_crypt8(const u32 *rk, u8 *dst,
				const u8 *src, int nblocks);
asmlinkage void sm4_aesni_avx_ctr_enc_blk8(const u32 *rk, u8 *dst,
				const u8 *src, u8 *iv);
asmlinkage void sm4_aesni_avx_cbc_dec_blk8(const u32 *rk, u8 *dst,
				const u8 *src, u8 *iv);

static int sm4_skcipher_setkey(struct crypto_skcipher *tfm, const u8 *key,
			unsigned int key_len)
{}

static int ecb_do_crypt(struct skcipher_request *req, const u32 *rkey)
{}

int sm4_avx_ecb_encrypt(struct skcipher_request *req)
{}
EXPORT_SYMBOL_GPL();

int sm4_avx_ecb_decrypt(struct skcipher_request *req)
{}
EXPORT_SYMBOL_GPL();

int sm4_cbc_encrypt(struct skcipher_request *req)
{}
EXPORT_SYMBOL_GPL();

int sm4_avx_cbc_decrypt(struct skcipher_request *req,
			unsigned int bsize, sm4_crypt_func func)
{}
EXPORT_SYMBOL_GPL();

static int cbc_decrypt(struct skcipher_request *req)
{}

int sm4_avx_ctr_crypt(struct skcipher_request *req,
			unsigned int bsize, sm4_crypt_func func)
{}
EXPORT_SYMBOL_GPL();

static int ctr_crypt(struct skcipher_request *req)
{}

static struct skcipher_alg sm4_aesni_avx_skciphers[] =;

static struct simd_skcipher_alg *
simd_sm4_aesni_avx_skciphers[ARRAY_SIZE(sm4_aesni_avx_skciphers)];

static int __init sm4_init(void)
{}

static void __exit sm4_exit(void)
{}

module_init();
module_exit(sm4_exit);

MODULE_LICENSE();
MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_ALIAS_CRYPTO();
MODULE_ALIAS_CRYPTO();