VirtualBox

source: vbox/trunk/src/libs/openssl-3.0.1/include/crypto/aria.h@ 94082

Last change on this file since 94082 was 94082, checked in by vboxsync, 3 years ago

libs/openssl-3.0.1: started applying and adjusting our OpenSSL changes to 3.0.1. bugref:10128

File size: 1.5 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# pragma once
16
17# include <openssl/opensslconf.h>
18
19# ifdef OPENSSL_NO_ARIA
20# error ARIA is disabled.
21# endif
22
23# define ARIA_ENCRYPT 1
24# define ARIA_DECRYPT 0
25
26# define ARIA_BLOCK_SIZE 16 /* Size of each encryption/decryption block */
27# define ARIA_MAX_KEYS 17 /* Number of keys needed in the worst case */
28
29typedef union {
30 unsigned char c[ARIA_BLOCK_SIZE];
31 unsigned int u[ARIA_BLOCK_SIZE / sizeof(unsigned int)];
32} ARIA_u128;
33
34typedef unsigned char ARIA_c128[ARIA_BLOCK_SIZE];
35
36struct aria_key_st {
37 ARIA_u128 rd_key[ARIA_MAX_KEYS];
38 unsigned int rounds;
39};
40typedef struct aria_key_st ARIA_KEY;
41
42
43int ossl_aria_set_encrypt_key(const unsigned char *userKey, const int bits,
44 ARIA_KEY *key);
45int ossl_aria_set_decrypt_key(const unsigned char *userKey, const int bits,
46 ARIA_KEY *key);
47
48void ossl_aria_encrypt(const unsigned char *in, unsigned char *out,
49 const ARIA_KEY *key);
50
51#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