xref: /openbmc/linux/crypto/aria_generic.c (revision 35344cf3)
1a9b0838dSTaehee Yoo // SPDX-License-Identifier: GPL-2.0-or-later
2a9b0838dSTaehee Yoo /*
3a9b0838dSTaehee Yoo  * Cryptographic API.
4a9b0838dSTaehee Yoo  *
5a9b0838dSTaehee Yoo  * ARIA Cipher Algorithm.
6a9b0838dSTaehee Yoo  *
7a9b0838dSTaehee Yoo  * Documentation of ARIA can be found in RFC 5794.
8a9b0838dSTaehee Yoo  * Copyright (c) 2022 Taehee Yoo <ap420073@gmail.com>
9a9b0838dSTaehee Yoo  *
10a9b0838dSTaehee Yoo  * Information for ARIA
11a9b0838dSTaehee Yoo  *     http://210.104.33.10/ARIA/index-e.html (English)
12a9b0838dSTaehee Yoo  *     http://seed.kisa.or.kr/ (Korean)
13a9b0838dSTaehee Yoo  *
14a9b0838dSTaehee Yoo  * Public domain version is distributed above.
15a9b0838dSTaehee Yoo  */
16a9b0838dSTaehee Yoo 
17a9b0838dSTaehee Yoo #include <crypto/aria.h>
18a9b0838dSTaehee Yoo 
19a9b0838dSTaehee Yoo static const u32 key_rc[20] = {
20a9b0838dSTaehee Yoo 	0x517cc1b7, 0x27220a94, 0xfe13abe8, 0xfa9a6ee0,
21a9b0838dSTaehee Yoo 	0x6db14acc, 0x9e21c820, 0xff28b1d5, 0xef5de2b0,
22a9b0838dSTaehee Yoo 	0xdb92371d, 0x2126e970, 0x03249775, 0x04e8c90e,
23a9b0838dSTaehee Yoo 	0x517cc1b7, 0x27220a94, 0xfe13abe8, 0xfa9a6ee0,
24a9b0838dSTaehee Yoo 	0x6db14acc, 0x9e21c820, 0xff28b1d5, 0xef5de2b0
25a9b0838dSTaehee Yoo };
26a9b0838dSTaehee Yoo 
aria_set_encrypt_key(struct aria_ctx * ctx,const u8 * in_key,unsigned int key_len)27a9b0838dSTaehee Yoo static void aria_set_encrypt_key(struct aria_ctx *ctx, const u8 *in_key,
28a9b0838dSTaehee Yoo 				 unsigned int key_len)
29a9b0838dSTaehee Yoo {
30a9b0838dSTaehee Yoo 	const __be32 *key = (const __be32 *)in_key;
31a9b0838dSTaehee Yoo 	u32 w0[4], w1[4], w2[4], w3[4];
32a9b0838dSTaehee Yoo 	u32 reg0, reg1, reg2, reg3;
33a9b0838dSTaehee Yoo 	const u32 *ck;
34a9b0838dSTaehee Yoo 	int rkidx = 0;
35a9b0838dSTaehee Yoo 
36a9b0838dSTaehee Yoo 	ck = &key_rc[(key_len - 16) / 2];
37a9b0838dSTaehee Yoo 
38a9b0838dSTaehee Yoo 	w0[0] = be32_to_cpu(key[0]);
39a9b0838dSTaehee Yoo 	w0[1] = be32_to_cpu(key[1]);
40a9b0838dSTaehee Yoo 	w0[2] = be32_to_cpu(key[2]);
41a9b0838dSTaehee Yoo 	w0[3] = be32_to_cpu(key[3]);
42a9b0838dSTaehee Yoo 
43a9b0838dSTaehee Yoo 	reg0 = w0[0] ^ ck[0];
44a9b0838dSTaehee Yoo 	reg1 = w0[1] ^ ck[1];
45a9b0838dSTaehee Yoo 	reg2 = w0[2] ^ ck[2];
46a9b0838dSTaehee Yoo 	reg3 = w0[3] ^ ck[3];
47a9b0838dSTaehee Yoo 
48a9b0838dSTaehee Yoo 	aria_subst_diff_odd(&reg0, &reg1, &reg2, &reg3);
49a9b0838dSTaehee Yoo 
50a9b0838dSTaehee Yoo 	if (key_len > 16) {
51a9b0838dSTaehee Yoo 		w1[0] = be32_to_cpu(key[4]);
52a9b0838dSTaehee Yoo 		w1[1] = be32_to_cpu(key[5]);
53a9b0838dSTaehee Yoo 		if (key_len > 24) {
54a9b0838dSTaehee Yoo 			w1[2] = be32_to_cpu(key[6]);
55a9b0838dSTaehee Yoo 			w1[3] = be32_to_cpu(key[7]);
56a9b0838dSTaehee Yoo 		} else {
57a9b0838dSTaehee Yoo 			w1[2] = 0;
58a9b0838dSTaehee Yoo 			w1[3] = 0;
59a9b0838dSTaehee Yoo 		}
60a9b0838dSTaehee Yoo 	} else {
61a9b0838dSTaehee Yoo 		w1[0] = 0;
62a9b0838dSTaehee Yoo 		w1[1] = 0;
63a9b0838dSTaehee Yoo 		w1[2] = 0;
64a9b0838dSTaehee Yoo 		w1[3] = 0;
65a9b0838dSTaehee Yoo 	}
66a9b0838dSTaehee Yoo 
67a9b0838dSTaehee Yoo 	w1[0] ^= reg0;
68a9b0838dSTaehee Yoo 	w1[1] ^= reg1;
69a9b0838dSTaehee Yoo 	w1[2] ^= reg2;
70a9b0838dSTaehee Yoo 	w1[3] ^= reg3;
71a9b0838dSTaehee Yoo 
72a9b0838dSTaehee Yoo 	reg0 = w1[0];
73a9b0838dSTaehee Yoo 	reg1 = w1[1];
74a9b0838dSTaehee Yoo 	reg2 = w1[2];
75a9b0838dSTaehee Yoo 	reg3 = w1[3];
76a9b0838dSTaehee Yoo 
77a9b0838dSTaehee Yoo 	reg0 ^= ck[4];
78a9b0838dSTaehee Yoo 	reg1 ^= ck[5];
79a9b0838dSTaehee Yoo 	reg2 ^= ck[6];
80a9b0838dSTaehee Yoo 	reg3 ^= ck[7];
81a9b0838dSTaehee Yoo 
82a9b0838dSTaehee Yoo 	aria_subst_diff_even(&reg0, &reg1, &reg2, &reg3);
83a9b0838dSTaehee Yoo 
84a9b0838dSTaehee Yoo 	reg0 ^= w0[0];
85a9b0838dSTaehee Yoo 	reg1 ^= w0[1];
86a9b0838dSTaehee Yoo 	reg2 ^= w0[2];
87a9b0838dSTaehee Yoo 	reg3 ^= w0[3];
88a9b0838dSTaehee Yoo 
89a9b0838dSTaehee Yoo 	w2[0] = reg0;
90a9b0838dSTaehee Yoo 	w2[1] = reg1;
91a9b0838dSTaehee Yoo 	w2[2] = reg2;
92a9b0838dSTaehee Yoo 	w2[3] = reg3;
93a9b0838dSTaehee Yoo 
94a9b0838dSTaehee Yoo 	reg0 ^= ck[8];
95a9b0838dSTaehee Yoo 	reg1 ^= ck[9];
96a9b0838dSTaehee Yoo 	reg2 ^= ck[10];
97a9b0838dSTaehee Yoo 	reg3 ^= ck[11];
98a9b0838dSTaehee Yoo 
99a9b0838dSTaehee Yoo 	aria_subst_diff_odd(&reg0, &reg1, &reg2, &reg3);
100a9b0838dSTaehee Yoo 
101a9b0838dSTaehee Yoo 	w3[0] = reg0 ^ w1[0];
102a9b0838dSTaehee Yoo 	w3[1] = reg1 ^ w1[1];
103a9b0838dSTaehee Yoo 	w3[2] = reg2 ^ w1[2];
104a9b0838dSTaehee Yoo 	w3[3] = reg3 ^ w1[3];
105a9b0838dSTaehee Yoo 
106a9b0838dSTaehee Yoo 	aria_gsrk(ctx->enc_key[rkidx], w0, w1, 19);
107a9b0838dSTaehee Yoo 	rkidx++;
108a9b0838dSTaehee Yoo 	aria_gsrk(ctx->enc_key[rkidx], w1, w2, 19);
109a9b0838dSTaehee Yoo 	rkidx++;
110a9b0838dSTaehee Yoo 	aria_gsrk(ctx->enc_key[rkidx], w2, w3, 19);
111a9b0838dSTaehee Yoo 	rkidx++;
112a9b0838dSTaehee Yoo 	aria_gsrk(ctx->enc_key[rkidx], w3, w0, 19);
113a9b0838dSTaehee Yoo 
114a9b0838dSTaehee Yoo 	rkidx++;
115a9b0838dSTaehee Yoo 	aria_gsrk(ctx->enc_key[rkidx], w0, w1, 31);
116a9b0838dSTaehee Yoo 	rkidx++;
117a9b0838dSTaehee Yoo 	aria_gsrk(ctx->enc_key[rkidx], w1, w2, 31);
118a9b0838dSTaehee Yoo 	rkidx++;
119a9b0838dSTaehee Yoo 	aria_gsrk(ctx->enc_key[rkidx], w2, w3, 31);
120a9b0838dSTaehee Yoo 	rkidx++;
121a9b0838dSTaehee Yoo 	aria_gsrk(ctx->enc_key[rkidx], w3, w0, 31);
122a9b0838dSTaehee Yoo 
123a9b0838dSTaehee Yoo 	rkidx++;
124a9b0838dSTaehee Yoo 	aria_gsrk(ctx->enc_key[rkidx], w0, w1, 67);
125a9b0838dSTaehee Yoo 	rkidx++;
126a9b0838dSTaehee Yoo 	aria_gsrk(ctx->enc_key[rkidx], w1, w2, 67);
127a9b0838dSTaehee Yoo 	rkidx++;
128a9b0838dSTaehee Yoo 	aria_gsrk(ctx->enc_key[rkidx], w2, w3, 67);
129a9b0838dSTaehee Yoo 	rkidx++;
130a9b0838dSTaehee Yoo 	aria_gsrk(ctx->enc_key[rkidx], w3, w0, 67);
131a9b0838dSTaehee Yoo 
132a9b0838dSTaehee Yoo 	rkidx++;
133a9b0838dSTaehee Yoo 	aria_gsrk(ctx->enc_key[rkidx], w0, w1, 97);
134a9b0838dSTaehee Yoo 	if (key_len > 16) {
135a9b0838dSTaehee Yoo 		rkidx++;
136a9b0838dSTaehee Yoo 		aria_gsrk(ctx->enc_key[rkidx], w1, w2, 97);
137a9b0838dSTaehee Yoo 		rkidx++;
138a9b0838dSTaehee Yoo 		aria_gsrk(ctx->enc_key[rkidx], w2, w3, 97);
139a9b0838dSTaehee Yoo 
140a9b0838dSTaehee Yoo 		if (key_len > 24) {
141a9b0838dSTaehee Yoo 			rkidx++;
142a9b0838dSTaehee Yoo 			aria_gsrk(ctx->enc_key[rkidx], w3, w0, 97);
143a9b0838dSTaehee Yoo 
144a9b0838dSTaehee Yoo 			rkidx++;
145a9b0838dSTaehee Yoo 			aria_gsrk(ctx->enc_key[rkidx], w0, w1, 109);
146a9b0838dSTaehee Yoo 		}
147a9b0838dSTaehee Yoo 	}
148a9b0838dSTaehee Yoo }
149a9b0838dSTaehee Yoo 
aria_set_decrypt_key(struct aria_ctx * ctx)150a9b0838dSTaehee Yoo static void aria_set_decrypt_key(struct aria_ctx *ctx)
151a9b0838dSTaehee Yoo {
152a9b0838dSTaehee Yoo 	int i;
153a9b0838dSTaehee Yoo 
154a9b0838dSTaehee Yoo 	for (i = 0; i < 4; i++) {
155a9b0838dSTaehee Yoo 		ctx->dec_key[0][i] = ctx->enc_key[ctx->rounds][i];
156a9b0838dSTaehee Yoo 		ctx->dec_key[ctx->rounds][i] = ctx->enc_key[0][i];
157a9b0838dSTaehee Yoo 	}
158a9b0838dSTaehee Yoo 
159a9b0838dSTaehee Yoo 	for (i = 1; i < ctx->rounds; i++) {
160a9b0838dSTaehee Yoo 		ctx->dec_key[i][0] = aria_m(ctx->enc_key[ctx->rounds - i][0]);
161a9b0838dSTaehee Yoo 		ctx->dec_key[i][1] = aria_m(ctx->enc_key[ctx->rounds - i][1]);
162a9b0838dSTaehee Yoo 		ctx->dec_key[i][2] = aria_m(ctx->enc_key[ctx->rounds - i][2]);
163a9b0838dSTaehee Yoo 		ctx->dec_key[i][3] = aria_m(ctx->enc_key[ctx->rounds - i][3]);
164a9b0838dSTaehee Yoo 
165a9b0838dSTaehee Yoo 		aria_diff_word(&ctx->dec_key[i][0], &ctx->dec_key[i][1],
166a9b0838dSTaehee Yoo 			       &ctx->dec_key[i][2], &ctx->dec_key[i][3]);
167a9b0838dSTaehee Yoo 		aria_diff_byte(&ctx->dec_key[i][1],
168a9b0838dSTaehee Yoo 			       &ctx->dec_key[i][2], &ctx->dec_key[i][3]);
169a9b0838dSTaehee Yoo 		aria_diff_word(&ctx->dec_key[i][0], &ctx->dec_key[i][1],
170a9b0838dSTaehee Yoo 			       &ctx->dec_key[i][2], &ctx->dec_key[i][3]);
171a9b0838dSTaehee Yoo 	}
172a9b0838dSTaehee Yoo }
173a9b0838dSTaehee Yoo 
aria_set_key(struct crypto_tfm * tfm,const u8 * in_key,unsigned int key_len)174a9b0838dSTaehee Yoo int aria_set_key(struct crypto_tfm *tfm, const u8 *in_key, unsigned int key_len)
175a9b0838dSTaehee Yoo {
176a9b0838dSTaehee Yoo 	struct aria_ctx *ctx = crypto_tfm_ctx(tfm);
177a9b0838dSTaehee Yoo 
178a9b0838dSTaehee Yoo 	if (key_len != 16 && key_len != 24 && key_len != 32)
179a9b0838dSTaehee Yoo 		return -EINVAL;
180a9b0838dSTaehee Yoo 
181*35344cf3STaehee Yoo 	BUILD_BUG_ON(sizeof(ctx->enc_key) != 272);
182*35344cf3STaehee Yoo 	BUILD_BUG_ON(sizeof(ctx->dec_key) != 272);
183*35344cf3STaehee Yoo 	BUILD_BUG_ON(sizeof(int) != sizeof(ctx->rounds));
184*35344cf3STaehee Yoo 
185a9b0838dSTaehee Yoo 	ctx->key_length = key_len;
186a9b0838dSTaehee Yoo 	ctx->rounds = (key_len + 32) / 4;
187a9b0838dSTaehee Yoo 
188a9b0838dSTaehee Yoo 	aria_set_encrypt_key(ctx, in_key, key_len);
189a9b0838dSTaehee Yoo 	aria_set_decrypt_key(ctx);
190a9b0838dSTaehee Yoo 
191a9b0838dSTaehee Yoo 	return 0;
192a9b0838dSTaehee Yoo }
193a9b0838dSTaehee Yoo EXPORT_SYMBOL_GPL(aria_set_key);
194a9b0838dSTaehee Yoo 
__aria_crypt(struct aria_ctx * ctx,u8 * out,const u8 * in,u32 key[][ARIA_RD_KEY_WORDS])195a9b0838dSTaehee Yoo static void __aria_crypt(struct aria_ctx *ctx, u8 *out, const u8 *in,
196a9b0838dSTaehee Yoo 			 u32 key[][ARIA_RD_KEY_WORDS])
197a9b0838dSTaehee Yoo {
198a9b0838dSTaehee Yoo 	const __be32 *src = (const __be32 *)in;
199a9b0838dSTaehee Yoo 	__be32 *dst = (__be32 *)out;
200a9b0838dSTaehee Yoo 	u32 reg0, reg1, reg2, reg3;
201a9b0838dSTaehee Yoo 	int rounds, rkidx = 0;
202a9b0838dSTaehee Yoo 
203a9b0838dSTaehee Yoo 	rounds = ctx->rounds;
204a9b0838dSTaehee Yoo 
205a9b0838dSTaehee Yoo 	reg0 = be32_to_cpu(src[0]);
206a9b0838dSTaehee Yoo 	reg1 = be32_to_cpu(src[1]);
207a9b0838dSTaehee Yoo 	reg2 = be32_to_cpu(src[2]);
208a9b0838dSTaehee Yoo 	reg3 = be32_to_cpu(src[3]);
209a9b0838dSTaehee Yoo 
210a9b0838dSTaehee Yoo 	aria_add_round_key(key[rkidx], &reg0, &reg1, &reg2, &reg3);
211a9b0838dSTaehee Yoo 	rkidx++;
212a9b0838dSTaehee Yoo 
213a9b0838dSTaehee Yoo 	aria_subst_diff_odd(&reg0, &reg1, &reg2, &reg3);
214a9b0838dSTaehee Yoo 	aria_add_round_key(key[rkidx], &reg0, &reg1, &reg2, &reg3);
215a9b0838dSTaehee Yoo 	rkidx++;
216a9b0838dSTaehee Yoo 
217a9b0838dSTaehee Yoo 	while ((rounds -= 2) > 0) {
218a9b0838dSTaehee Yoo 		aria_subst_diff_even(&reg0, &reg1, &reg2, &reg3);
219a9b0838dSTaehee Yoo 		aria_add_round_key(key[rkidx], &reg0, &reg1, &reg2, &reg3);
220a9b0838dSTaehee Yoo 		rkidx++;
221a9b0838dSTaehee Yoo 
222a9b0838dSTaehee Yoo 		aria_subst_diff_odd(&reg0, &reg1, &reg2, &reg3);
223a9b0838dSTaehee Yoo 		aria_add_round_key(key[rkidx], &reg0, &reg1, &reg2, &reg3);
224a9b0838dSTaehee Yoo 		rkidx++;
225a9b0838dSTaehee Yoo 	}
226a9b0838dSTaehee Yoo 
227a9b0838dSTaehee Yoo 	reg0 = key[rkidx][0] ^ make_u32((u8)(x1[get_u8(reg0, 0)]),
228a9b0838dSTaehee Yoo 					(u8)(x2[get_u8(reg0, 1)] >> 8),
229a9b0838dSTaehee Yoo 					(u8)(s1[get_u8(reg0, 2)]),
230a9b0838dSTaehee Yoo 					(u8)(s2[get_u8(reg0, 3)]));
231a9b0838dSTaehee Yoo 	reg1 = key[rkidx][1] ^ make_u32((u8)(x1[get_u8(reg1, 0)]),
232a9b0838dSTaehee Yoo 					(u8)(x2[get_u8(reg1, 1)] >> 8),
233a9b0838dSTaehee Yoo 					(u8)(s1[get_u8(reg1, 2)]),
234a9b0838dSTaehee Yoo 					(u8)(s2[get_u8(reg1, 3)]));
235a9b0838dSTaehee Yoo 	reg2 = key[rkidx][2] ^ make_u32((u8)(x1[get_u8(reg2, 0)]),
236a9b0838dSTaehee Yoo 					(u8)(x2[get_u8(reg2, 1)] >> 8),
237a9b0838dSTaehee Yoo 					(u8)(s1[get_u8(reg2, 2)]),
238a9b0838dSTaehee Yoo 					(u8)(s2[get_u8(reg2, 3)]));
239a9b0838dSTaehee Yoo 	reg3 = key[rkidx][3] ^ make_u32((u8)(x1[get_u8(reg3, 0)]),
240a9b0838dSTaehee Yoo 					(u8)(x2[get_u8(reg3, 1)] >> 8),
241a9b0838dSTaehee Yoo 					(u8)(s1[get_u8(reg3, 2)]),
242a9b0838dSTaehee Yoo 					(u8)(s2[get_u8(reg3, 3)]));
243a9b0838dSTaehee Yoo 
244a9b0838dSTaehee Yoo 	dst[0] = cpu_to_be32(reg0);
245a9b0838dSTaehee Yoo 	dst[1] = cpu_to_be32(reg1);
246a9b0838dSTaehee Yoo 	dst[2] = cpu_to_be32(reg2);
247a9b0838dSTaehee Yoo 	dst[3] = cpu_to_be32(reg3);
248a9b0838dSTaehee Yoo }
249a9b0838dSTaehee Yoo 
aria_encrypt(void * _ctx,u8 * out,const u8 * in)250a9b0838dSTaehee Yoo void aria_encrypt(void *_ctx, u8 *out, const u8 *in)
251a9b0838dSTaehee Yoo {
252a9b0838dSTaehee Yoo 	struct aria_ctx *ctx = (struct aria_ctx *)_ctx;
253a9b0838dSTaehee Yoo 
254a9b0838dSTaehee Yoo 	__aria_crypt(ctx, out, in, ctx->enc_key);
255a9b0838dSTaehee Yoo }
256a9b0838dSTaehee Yoo EXPORT_SYMBOL_GPL(aria_encrypt);
257a9b0838dSTaehee Yoo 
aria_decrypt(void * _ctx,u8 * out,const u8 * in)258a9b0838dSTaehee Yoo void aria_decrypt(void *_ctx, u8 *out, const u8 *in)
259a9b0838dSTaehee Yoo {
260a9b0838dSTaehee Yoo 	struct aria_ctx *ctx = (struct aria_ctx *)_ctx;
261a9b0838dSTaehee Yoo 
262a9b0838dSTaehee Yoo 	__aria_crypt(ctx, out, in, ctx->dec_key);
263a9b0838dSTaehee Yoo }
264a9b0838dSTaehee Yoo EXPORT_SYMBOL_GPL(aria_decrypt);
265a9b0838dSTaehee Yoo 
__aria_encrypt(struct crypto_tfm * tfm,u8 * out,const u8 * in)266a9b0838dSTaehee Yoo static void __aria_encrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in)
267a9b0838dSTaehee Yoo {
268a9b0838dSTaehee Yoo 	struct aria_ctx *ctx = crypto_tfm_ctx(tfm);
269a9b0838dSTaehee Yoo 
270a9b0838dSTaehee Yoo 	__aria_crypt(ctx, out, in, ctx->enc_key);
271a9b0838dSTaehee Yoo }
272a9b0838dSTaehee Yoo 
__aria_decrypt(struct crypto_tfm * tfm,u8 * out,const u8 * in)273a9b0838dSTaehee Yoo static void __aria_decrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in)
274a9b0838dSTaehee Yoo {
275a9b0838dSTaehee Yoo 	struct aria_ctx *ctx = crypto_tfm_ctx(tfm);
276a9b0838dSTaehee Yoo 
277a9b0838dSTaehee Yoo 	__aria_crypt(ctx, out, in, ctx->dec_key);
278a9b0838dSTaehee Yoo }
279a9b0838dSTaehee Yoo 
280a9b0838dSTaehee Yoo static struct crypto_alg aria_alg = {
281a9b0838dSTaehee Yoo 	.cra_name		=	"aria",
282a9b0838dSTaehee Yoo 	.cra_driver_name	=	"aria-generic",
283a9b0838dSTaehee Yoo 	.cra_priority		=	100,
284a9b0838dSTaehee Yoo 	.cra_flags		=	CRYPTO_ALG_TYPE_CIPHER,
285a9b0838dSTaehee Yoo 	.cra_blocksize		=	ARIA_BLOCK_SIZE,
286a9b0838dSTaehee Yoo 	.cra_ctxsize		=	sizeof(struct aria_ctx),
287a9b0838dSTaehee Yoo 	.cra_alignmask		=	3,
288a9b0838dSTaehee Yoo 	.cra_module		=	THIS_MODULE,
289a9b0838dSTaehee Yoo 	.cra_u			=	{
290a9b0838dSTaehee Yoo 		.cipher = {
291a9b0838dSTaehee Yoo 			.cia_min_keysize	=	ARIA_MIN_KEY_SIZE,
292a9b0838dSTaehee Yoo 			.cia_max_keysize	=	ARIA_MAX_KEY_SIZE,
293a9b0838dSTaehee Yoo 			.cia_setkey		=	aria_set_key,
294a9b0838dSTaehee Yoo 			.cia_encrypt		=	__aria_encrypt,
295a9b0838dSTaehee Yoo 			.cia_decrypt		=	__aria_decrypt
296a9b0838dSTaehee Yoo 		}
297a9b0838dSTaehee Yoo 	}
298a9b0838dSTaehee Yoo };
299a9b0838dSTaehee Yoo 
aria_init(void)300a9b0838dSTaehee Yoo static int __init aria_init(void)
301a9b0838dSTaehee Yoo {
302a9b0838dSTaehee Yoo 	return crypto_register_alg(&aria_alg);
303a9b0838dSTaehee Yoo }
304a9b0838dSTaehee Yoo 
aria_fini(void)305a9b0838dSTaehee Yoo static void __exit aria_fini(void)
306a9b0838dSTaehee Yoo {
307a9b0838dSTaehee Yoo 	crypto_unregister_alg(&aria_alg);
308a9b0838dSTaehee Yoo }
309a9b0838dSTaehee Yoo 
310a9b0838dSTaehee Yoo subsys_initcall(aria_init);
311a9b0838dSTaehee Yoo module_exit(aria_fini);
312a9b0838dSTaehee Yoo 
313a9b0838dSTaehee Yoo MODULE_DESCRIPTION("ARIA Cipher Algorithm");
314a9b0838dSTaehee Yoo MODULE_LICENSE("GPL");
315a9b0838dSTaehee Yoo MODULE_AUTHOR("Taehee Yoo <ap420073@gmail.com>");
316a9b0838dSTaehee Yoo MODULE_ALIAS_CRYPTO("aria");
317a9b0838dSTaehee Yoo MODULE_ALIAS_CRYPTO("aria-generic");
318