linux/crypto/sm4.c

/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
 * SM4, as specified in
 * https://tools.ietf.org/id/draft-ribose-cfrg-sm4-10.html
 *
 * Copyright (C) 2018 ARM Limited or its affiliates.
 * Copyright (c) 2021 Tianjia Zhang <[email protected]>
 */

#include <linux/module.h>
#include <asm/unaligned.h>
#include <crypto/sm4.h>

static const u32 ____cacheline_aligned fk[4] =;

static const u32 ____cacheline_aligned ck[32] =;

static const u8 ____cacheline_aligned sbox[256] =;

extern const u32 crypto_sm4_fk[4] __alias();
extern const u32 crypto_sm4_ck[32] __alias();
extern const u8 crypto_sm4_sbox[256] __alias();

EXPORT_SYMBOL();
EXPORT_SYMBOL();
EXPORT_SYMBOL();

static inline u32 sm4_t_non_lin_sub(u32 x)
{}

static inline u32 sm4_key_lin_sub(u32 x)
{}

static inline u32 sm4_enc_lin_sub(u32 x)
{}

static inline u32 sm4_key_sub(u32 x)
{}

static inline u32 sm4_enc_sub(u32 x)
{}

static inline u32 sm4_round(u32 x0, u32 x1, u32 x2, u32 x3, u32 rk)
{}


/**
 * sm4_expandkey - Expands the SM4 key as described in GB/T 32907-2016
 * @ctx:	The location where the computed key will be stored.
 * @in_key:	The supplied key.
 * @key_len:	The length of the supplied key.
 *
 * Returns 0 on success. The function fails only if an invalid key size (or
 * pointer) is supplied.
 */
int sm4_expandkey(struct sm4_ctx *ctx, const u8 *in_key,
			  unsigned int key_len)
{}
EXPORT_SYMBOL_GPL();

/**
 * sm4_crypt_block - Encrypt or decrypt a single SM4 block
 * @rk:		The rkey_enc for encrypt or rkey_dec for decrypt
 * @out:	Buffer to store output data
 * @in: 	Buffer containing the input data
 */
void sm4_crypt_block(const u32 *rk, u8 *out, const u8 *in)
{}
EXPORT_SYMBOL_GPL();

MODULE_DESCRIPTION();
MODULE_LICENSE();