]> git.ipfire.org Git - thirdparty/openssl.git/blame - crypto/include/internal/aria.h
Correct Oracle copyrights & clarify.
[thirdparty/openssl.git] / crypto / include / internal / aria.h
CommitLineData
d42d0a4d
P
1/*
2 * Copyright 2006-2017 The OpenSSL Project Authors. All Rights Reserved.
5aba2b6e 3 * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
d42d0a4d
P
4 *
5 * Licensed under the OpenSSL license (the "License"). You may not use
6 * this file except in compliance with the License. You can obtain a copy
7 * in the file LICENSE in the source distribution or at
8 * https://www.openssl.org/source/license.html
9 */
10
dc99b885 11 /* Copyright (c) 2017 National Security Resarch Institute. All rights reserved. */
12
d42d0a4d
P
13#ifndef HEADER_ARIA_H
14# define HEADER_ARIA_H
15
16# include <openssl/opensslconf.h>
17
18# ifdef OPENSSL_NO_ARIA
19# error ARIA is disabled.
20# endif
21
d42d0a4d
P
22# define ARIA_ENCRYPT 1
23# define ARIA_DECRYPT 0
24
25# define ARIA_BLOCK_SIZE 16 /* Size of each encryption/decription block */
26# define ARIA_MAX_KEYS 17 /* Number of keys needed in the worst case */
27
28# ifdef __cplusplus
29extern "C" {
30# endif
31
dc99b885 32typedef union {
33 unsigned char c[ARIA_BLOCK_SIZE];
34 unsigned int u[ARIA_BLOCK_SIZE / sizeof(unsigned int)];
35} ARIA_u128;
d42d0a4d 36
f83409a6
AP
37typedef unsigned char ARIA_c128[ARIA_BLOCK_SIZE];
38
d42d0a4d 39struct aria_key_st {
d42d0a4d 40 ARIA_u128 rd_key[ARIA_MAX_KEYS];
dc99b885 41 unsigned int rounds;
d42d0a4d
P
42};
43typedef struct aria_key_st ARIA_KEY;
44
45
46int aria_set_encrypt_key(const unsigned char *userKey, const int bits,
47 ARIA_KEY *key);
48int aria_set_decrypt_key(const unsigned char *userKey, const int bits,
49 ARIA_KEY *key);
50
51void aria_encrypt(const unsigned char *in, unsigned char *out,
52 const ARIA_KEY *key);
53
54# ifdef __cplusplus
55}
56# endif
57
58#endif