linux/include/crypto/aria.h

/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
 * Cryptographic API.
 *
 * ARIA Cipher Algorithm.
 *
 * Documentation of ARIA can be found in RFC 5794.
 * Copyright (c) 2022 Taehee Yoo <[email protected]>
 * Copyright (c) 2022 Taehee Yoo <[email protected]>
 *
 * Information for ARIA
 *     http://210.104.33.10/ARIA/index-e.html (English)
 *     http://seed.kisa.or.kr/ (Korean)
 *
 * Public domain version is distributed above.
 */

#ifndef _CRYPTO_ARIA_H
#define _CRYPTO_ARIA_H

#include <crypto/algapi.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <asm/byteorder.h>

#define ARIA_MIN_KEY_SIZE
#define ARIA_MAX_KEY_SIZE
#define ARIA_BLOCK_SIZE
#define ARIA_MAX_RD_KEYS
#define ARIA_RD_KEY_WORDS

struct aria_ctx {};

static const u32 s1[256] =;

static const u32 s2[256] =;

static const u32 x1[256] =;

static const u32 x2[256] =;

static inline u32 rotl32(u32 v, u32 r)
{}

static inline u32 rotr32(u32 v, u32 r)
{}

static inline u32 bswap32(u32 v)
{}

static inline u8 get_u8(u32 x, u32 y)
{}

static inline u32 make_u32(u8 v0, u8 v1, u8 v2, u8 v3)
{}

static inline u32 aria_m(u32 t0)
{}

/* S-Box Layer 1 + M */
static inline void aria_sbox_layer1_with_pre_diff(u32 *t0, u32 *t1, u32 *t2,
						  u32 *t3)
{}

/* S-Box Layer 2 + M */
static inline void aria_sbox_layer2_with_pre_diff(u32 *t0, u32 *t1, u32 *t2,
						  u32 *t3)
{}

/* Word-level diffusion */
static inline void aria_diff_word(u32 *t0, u32 *t1, u32 *t2, u32 *t3)
{}

/* Byte-level diffusion */
static inline void aria_diff_byte(u32 *t1, u32 *t2, u32 *t3)
{}

/* Key XOR Layer */
static inline void aria_add_round_key(u32 *rk, u32 *t0, u32 *t1, u32 *t2,
				      u32 *t3)
{}
/* Odd round Substitution & Diffusion */
static inline void aria_subst_diff_odd(u32 *t0, u32 *t1, u32 *t2, u32 *t3)
{}

/* Even round Substitution & Diffusion */
static inline void aria_subst_diff_even(u32 *t0, u32 *t1, u32 *t2, u32 *t3)
{}

/* Q, R Macro expanded ARIA GSRK */
static inline void aria_gsrk(u32 *rk, u32 *x, u32 *y, u32 n)
{}

void aria_encrypt(void *ctx, u8 *out, const u8 *in);
void aria_decrypt(void *ctx, u8 *out, const u8 *in);
int aria_set_key(struct crypto_tfm *tfm, const u8 *in_key,
		 unsigned int key_len);

#endif