Skip to content

Commit 5afa31f

Browse files
committed
Filling with main files
1 parent 6f29c6c commit 5afa31f

File tree

197 files changed

+54955
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

197 files changed

+54955
-0
lines changed

launcher.sh

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
#!/bin/bash
2+
set -e
3+
set -x
4+
5+
# Set the Android API levels
6+
ANDROID_API=$1
7+
8+
# Set the target architecture
9+
# Can be android-arm, android-arm64, android-x86, android-x86 etc
10+
architecture=$2
11+
12+
if [[ "$architecture" == android-arm ]]
13+
then arcName=arm-linux-androideabi
14+
elif [[ "$architecture" == android-arm64 ]]
15+
then arcName=aarch64-linux-android
16+
elif [[ "$architecture" == android-x86 ]]
17+
then arcName=i686-linux-android
18+
elif [[ "$architecture" == android-x86_64 ]]
19+
then arcName=x86_64-linux-android
20+
else
21+
arcName="$architecture"
22+
fi
23+
24+
# Set directory
25+
SCRIPTPATH=`realpath .`
26+
export ANDROID_NDK_ROOT=$SCRIPTPATH/android-ndk-r23
27+
OPENSSL_DIR=$SCRIPTPATH/openssl
28+
29+
if ! [ -d $OPENSSL_DIR ]; then
30+
git clone https://github.com/openssl/openssl.git -b openssl-3.0.0
31+
else
32+
cd ${OPENSSL_DIR}
33+
git clean -fdx
34+
cd ${SCRIPTPATH}
35+
fi
36+
37+
# Get opessl from git
38+
# git clone https://github.com/openssl/openssl.git -b openssl-3.0.0
39+
40+
# Find the toolchain for your build machine
41+
toolchains_path=$(python3 toolchains_path.py --ndk ${ANDROID_NDK_ROOT})
42+
43+
# Configure the OpenSSL environment, refer to NOTES.ANDROID in OPENSSL_DIR
44+
# Set compiler clang, instead of gcc by default
45+
CC=clang
46+
47+
# Add toolchains bin directory to PATH
48+
PATH=$toolchains_path/bin:$PATH
49+
50+
# Create the make file
51+
cd ${OPENSSL_DIR}
52+
./Configure ${architecture} -D__ANDROID_API__=$ANDROID_API
53+
54+
# Build
55+
make -j8
56+
57+
# Copy the outputs
58+
OUTPUT_INCLUDE=$SCRIPTPATH/outputStatic/include
59+
OUTPUT_LIB=$SCRIPTPATH/outputStatic/lib/${arcName}/${ANDROID_API}
60+
mkdir -p $OUTPUT_INCLUDE
61+
mkdir -p $OUTPUT_LIB
62+
cp -RL include/openssl $OUTPUT_INCLUDE
63+
cp libcrypto.so $OUTPUT_LIB
64+
cp libcrypto.a $OUTPUT_LIB
65+
cp libssl.so $OUTPUT_LIB
66+
cp libssl.a $OUTPUT_LIB

lazzy.sh

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/bin/bash
2+
set -e
3+
set -x
4+
5+
# Set the Android API levels
6+
ANDROID_API=28
7+
8+
# Set the target architecture
9+
# Can be android-arm, android-arm64, android-x86, android-x86_64 etc
10+
architecture=android-arm64
11+
./launcher.sh $ANDROID_API $architecture
12+
13+
architecture=android-arm
14+
./launcher.sh $ANDROID_API $architecture
15+
16+
architecture=android-x86
17+
./launcher.sh $ANDROID_API $architecture
18+
19+
architecture=android-x86_64
20+
./launcher.sh $ANDROID_API $architecture
21+
22+
ANDROID_API=26
23+
24+
architecture=android-arm
25+
./launcher.sh $ANDROID_API $architecture
26+
27+
architecture=android-x86
28+
./launcher.sh $ANDROID_API $architecture
29+
30+
architecture=android-x86_64
31+
./launcher.sh $ANDROID_API $architecture
32+
33+
architecture=android-arm64
34+
./launcher.sh $ANDROID_API $architecture
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License 2.0 (the "License"). You may not use
5+
* this file except in compliance with the License. You can obtain a copy
6+
* in the file LICENSE in the source distribution or at
7+
* https://www.openssl.org/source/license.html
8+
*/
9+
10+
/*
11+
* This file is only used by HP C/C++ on VMS, and is included automatically
12+
* after each header file from this directory
13+
*/
14+
15+
/*
16+
* The C++ compiler doesn't understand these pragmas, even though it
17+
* understands the corresponding command line qualifier.
18+
*/
19+
#ifndef __cplusplus
20+
/* restore state. Must correspond to the save in __decc_include_prologue.h */
21+
# pragma names restore
22+
#endif
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
* Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License 2.0 (the "License"). You may not use
5+
* this file except in compliance with the License. You can obtain a copy
6+
* in the file LICENSE in the source distribution or at
7+
* https://www.openssl.org/source/license.html
8+
*/
9+
10+
/*
11+
* This file is only used by HP C/C++ on VMS, and is included automatically
12+
* after each header file from this directory
13+
*/
14+
15+
/*
16+
* The C++ compiler doesn't understand these pragmas, even though it
17+
* understands the corresponding command line qualifier.
18+
*/
19+
#ifndef __cplusplus
20+
/* save state */
21+
# pragma names save
22+
/* have the compiler shorten symbols larger than 31 chars to 23 chars
23+
* followed by a 8 hex char CRC
24+
*/
25+
# pragma names as_is,shortened
26+
#endif
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
/*
2+
* Copyright 2002-2020 The OpenSSL Project Authors. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License 2.0 (the "License"). You may not use
5+
* this file except in compliance with the License. You can obtain a copy
6+
* in the file LICENSE in the source distribution or at
7+
* https://www.openssl.org/source/license.html
8+
*/
9+
10+
#ifndef OPENSSL_AES_H
11+
# define OPENSSL_AES_H
12+
# pragma once
13+
14+
# include <openssl/macros.h>
15+
# ifndef OPENSSL_NO_DEPRECATED_3_0
16+
# define HEADER_AES_H
17+
# endif
18+
19+
# include <openssl/opensslconf.h>
20+
21+
# include <stddef.h>
22+
# ifdef __cplusplus
23+
extern "C" {
24+
# endif
25+
26+
# define AES_BLOCK_SIZE 16
27+
28+
# ifndef OPENSSL_NO_DEPRECATED_3_0
29+
30+
# define AES_ENCRYPT 1
31+
# define AES_DECRYPT 0
32+
33+
# define AES_MAXNR 14
34+
35+
36+
/* This should be a hidden type, but EVP requires that the size be known */
37+
struct aes_key_st {
38+
# ifdef AES_LONG
39+
unsigned long rd_key[4 * (AES_MAXNR + 1)];
40+
# else
41+
unsigned int rd_key[4 * (AES_MAXNR + 1)];
42+
# endif
43+
int rounds;
44+
};
45+
typedef struct aes_key_st AES_KEY;
46+
47+
# endif
48+
# ifndef OPENSSL_NO_DEPRECATED_3_0
49+
OSSL_DEPRECATEDIN_3_0 const char *AES_options(void);
50+
OSSL_DEPRECATEDIN_3_0
51+
int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
52+
AES_KEY *key);
53+
OSSL_DEPRECATEDIN_3_0
54+
int AES_set_decrypt_key(const unsigned char *userKey, const int bits,
55+
AES_KEY *key);
56+
OSSL_DEPRECATEDIN_3_0
57+
void AES_encrypt(const unsigned char *in, unsigned char *out,
58+
const AES_KEY *key);
59+
OSSL_DEPRECATEDIN_3_0
60+
void AES_decrypt(const unsigned char *in, unsigned char *out,
61+
const AES_KEY *key);
62+
OSSL_DEPRECATEDIN_3_0
63+
void AES_ecb_encrypt(const unsigned char *in, unsigned char *out,
64+
const AES_KEY *key, const int enc);
65+
OSSL_DEPRECATEDIN_3_0
66+
void AES_cbc_encrypt(const unsigned char *in, unsigned char *out,
67+
size_t length, const AES_KEY *key,
68+
unsigned char *ivec, const int enc);
69+
OSSL_DEPRECATEDIN_3_0
70+
void AES_cfb128_encrypt(const unsigned char *in, unsigned char *out,
71+
size_t length, const AES_KEY *key,
72+
unsigned char *ivec, int *num, const int enc);
73+
OSSL_DEPRECATEDIN_3_0
74+
void AES_cfb1_encrypt(const unsigned char *in, unsigned char *out,
75+
size_t length, const AES_KEY *key,
76+
unsigned char *ivec, int *num, const int enc);
77+
OSSL_DEPRECATEDIN_3_0
78+
void AES_cfb8_encrypt(const unsigned char *in, unsigned char *out,
79+
size_t length, const AES_KEY *key,
80+
unsigned char *ivec, int *num, const int enc);
81+
OSSL_DEPRECATEDIN_3_0
82+
void AES_ofb128_encrypt(const unsigned char *in, unsigned char *out,
83+
size_t length, const AES_KEY *key,
84+
unsigned char *ivec, int *num);
85+
86+
/* NB: the IV is _two_ blocks long */
87+
OSSL_DEPRECATEDIN_3_0
88+
void AES_ige_encrypt(const unsigned char *in, unsigned char *out,
89+
size_t length, const AES_KEY *key,
90+
unsigned char *ivec, const int enc);
91+
/* NB: the IV is _four_ blocks long */
92+
OSSL_DEPRECATEDIN_3_0
93+
void AES_bi_ige_encrypt(const unsigned char *in, unsigned char *out,
94+
size_t length, const AES_KEY *key, const AES_KEY *key2,
95+
const unsigned char *ivec, const int enc);
96+
OSSL_DEPRECATEDIN_3_0
97+
int AES_wrap_key(AES_KEY *key, const unsigned char *iv,
98+
unsigned char *out, const unsigned char *in,
99+
unsigned int inlen);
100+
OSSL_DEPRECATEDIN_3_0
101+
int AES_unwrap_key(AES_KEY *key, const unsigned char *iv,
102+
unsigned char *out, const unsigned char *in,
103+
unsigned int inlen);
104+
# endif
105+
106+
107+
# ifdef __cplusplus
108+
}
109+
# endif
110+
111+
#endif

0 commit comments

Comments
 (0)