VirtualBox

source: vbox/trunk/src/libs/openssl-3.1.3/include/crypto/aria.h@ 102210

Last change on this file since 102210 was 101211, checked in by vboxsync, 16 months ago

openssl-3.1.3: Applied and adjusted our OpenSSL changes to 3.1.2. bugref:10527

File size: 1.7 KB
Line 
1/*
2 * Copyright 2006-2021 The OpenSSL Project Authors. All Rights Reserved.
3 * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
4 *
5 * Licensed under the Apache License 2.0 (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
11 /* Copyright (c) 2017 National Security Research Institute. All rights reserved. */
12
13#ifndef OSSL_CRYPTO_ARIA_H
14# define OSSL_CRYPTO_ARIA_H
15# ifndef RT_WITHOUT_PRAGMA_ONCE /* VBOX */
16# pragma once
17# endif /* VBOX */
18
19# include <openssl/opensslconf.h>
20
21# ifdef OPENSSL_NO_ARIA
22# error ARIA is disabled.
23# endif
24
25# define ARIA_ENCRYPT 1
26# define ARIA_DECRYPT 0
27
28# define ARIA_BLOCK_SIZE 16 /* Size of each encryption/decryption block */
29# define ARIA_MAX_KEYS 17 /* Number of keys needed in the worst case */
30
31typedef union {
32 unsigned char c[ARIA_BLOCK_SIZE];
33 unsigned int u[ARIA_BLOCK_SIZE / sizeof(unsigned int)];
34} ARIA_u128;
35
36typedef unsigned char ARIA_c128[ARIA_BLOCK_SIZE];
37
38struct aria_key_st {
39 ARIA_u128 rd_key[ARIA_MAX_KEYS];
40 unsigned int rounds;
41};
42typedef struct aria_key_st ARIA_KEY;
43
44
45int ossl_aria_set_encrypt_key(const unsigned char *userKey, const int bits,
46 ARIA_KEY *key);
47int ossl_aria_set_decrypt_key(const unsigned char *userKey, const int bits,
48 ARIA_KEY *key);
49
50void ossl_aria_encrypt(const unsigned char *in, unsigned char *out,
51 const ARIA_KEY *key);
52
53#endif
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette