-
Notifications
You must be signed in to change notification settings - Fork 840
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ARIA Cipher CMake support with code review changes (+commit squash)
- Loading branch information
Showing
9 changed files
with
248 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -424,3 +424,4 @@ user_settings_asm.h | |
|
||
# MagicCrypto (ARIA Cipher) | ||
MagicCrypto | ||
/out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
# wolfSSL CMake notes | ||
|
||
The root of the wolfSSL repo contains a [CMakeLists.txt](./CMakeLists.txt) that can be used to compile the | ||
[examples](examples/README.md). | ||
|
||
In the simplest form: | ||
|
||
```bash | ||
# create a root directory for wolfssl repo | ||
git clone https://github.com/wolfSSL/wolfssl.git | ||
cd wolfssl | ||
./autogen.sh | ||
./configure --enable-all | ||
``` | ||
|
||
See the [documentation](https://www.wolfssl.com/documentation/manuals/wolfssl/chapter02.html) for more details | ||
on the various `./configure` options. | ||
|
||
## Build CMake Examples for Linux | ||
|
||
|
||
```bash | ||
# From the root of the wolfSSL repo: | ||
|
||
mkdir -p out | ||
pushd out | ||
cmake .. | ||
cmake --build . | ||
|
||
# View the available ciphers with: | ||
./examples/client/client -e | ||
popd | ||
``` | ||
|
||
## Build CMake Examples for Windows | ||
|
||
```bash | ||
# From the root of the wolfSSL repo: | ||
|
||
|
||
mkdir -p out | ||
pushd out | ||
cmake .. | ||
cmake --build . | ||
|
||
# View the available ciphers with: | ||
./examples/client/client -e | ||
popd | ||
``` | ||
|
||
## ARIA cipher suite | ||
|
||
The ARIA cipher needs a 3rd party source binary, typically called `MagicCrypto.tar.gz`. | ||
|
||
When debugging, these environment variables may be helpful: | ||
|
||
#### Enable ARIA Cipher for Linux Examples | ||
|
||
```bash | ||
# From the root of the wolfSSL repo: | ||
|
||
# set to your path | ||
export ARIA_DIR=/mnt/c/workspace/MagicCrypto | ||
|
||
mkdir -p out | ||
pushd out | ||
cmake .. | ||
cmake --build . | ||
|
||
# View the available ciphers with: | ||
./examples/client/client -e | ||
popd | ||
``` | ||
|
||
#### Enable ARIA Cipher for Windows Examples | ||
|
||
Unzip your `MagicCrypto.tar.gz`, shown here for `C:\workspace\MagicCrypto` | ||
|
||
```bash | ||
# set to your path | ||
export ARIA_DIR=c:\\workspace\\MagicCrypto | ||
|
||
mkdir -p out | ||
pushd out | ||
cmake .. | ||
cmake --build . | ||
|
||
# View the available ciphers with: | ||
./examples/client/client -e | ||
popd | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# wolfSSL CMake | ||
|
||
This directory contains some supplementary functions for the [CMakeLists.txt](../CMakeLists.txt) in the root. | ||
|
||
See also the [README_cmake.md](../README_cmake.md) file. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
EXTRA_DIST += cmake/Config.cmake.in | ||
EXTRA_DIST += cmake/config.in | ||
EXTRA_DIST += cmake/functions.cmake | ||
EXTRA_DIST += cmake/modules/FindARIA.cmake | ||
EXTRA_DIST += cmake/modules/FindOQS.cmake | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# Filename: FindARIA.cmake | ||
# | ||
# Usage: | ||
# find_package(ARIA [REQUIRED] [QUIET]) | ||
# | ||
# Once done this will define: | ||
# ARIA_FOUND - system has ARIA MAgicCrypt0 | ||
# ARIA_INCLUDE_DIR - the include directory containing ARIA | ||
# ARIA_LIBRARY - the path to the libARIA library | ||
# | ||
|
||
set(ARIA_INCLUDE_DIR) | ||
set(ARIA_LIB_FILE) | ||
|
||
# when debugging cmake, ARIA_DIR environment variable can be manually set here: | ||
# set(ENV{ARIA_DIR} "/mnt/c/workspace/MagicCrypto") | ||
# set(ENV{ARIA_DIR} "c:\\workspace\\MagicCrypto") | ||
|
||
# Make sure we have a ARIA_DIR encironment variable with the path to MagicCrypto | ||
if ("$ENV{ARIA_DIR}" STREQUAL "") | ||
message(ERROR "ERROR: FindARIA.cmake missing ARIA_DIR value") | ||
message(STATUS "Please set ARIA_DIR environment variable path to your MagicCrypto") | ||
else() | ||
set(ARIA_INCLUDE_DIR "$ENV{ARIA_DIR}/include") | ||
message(STATUS "FindARIA.cmake found ARIA_INCLUDE_DIR = $ENV{ARIA_DIR}") | ||
# set(ARIA_LIBRARY "$ENV{ARIA_INCLUDE_DIR}/lib") | ||
endif() | ||
|
||
# Check that the appropriate files exist | ||
find_path(ARIA_INCLUDE_DIR NAMES "mcapi.h" ) | ||
|
||
if (EXISTS "${ARIA_INCLUDE_DIR}/mcapi.h") | ||
# message("Found ${ARIA_INCLUDE_DIR}/mcapi.h") | ||
else() | ||
message(ERROR "File does not exist at ${ARIA_INCLUDE_DIR}/mcapi.h") | ||
endif() | ||
|
||
if(EXISTS "${ARIA_INCLUDE_DIR}/mcapi_error.h") | ||
# message("Found ${ARIA_INCLUDE_DIR}/mcapi_error.h") | ||
else() | ||
message(ERROR "File does not exist at ${ARIA_INCLUDE_DIR}/mcapi_error.h") | ||
endif() | ||
|
||
if(EXISTS "${ARIA_INCLUDE_DIR}/mcapi_type.h") | ||
# message("Found ${ARIA_INCLUDE_DIR}/mcapi_type.h") | ||
else() | ||
message(ERROR "File does not exist at $ARIA_INCLUDE_DIR/mcapi_type.h") | ||
endif() | ||
|
||
# find_library(ARIA_LIBRARY | ||
# NAMES "libMagicCrypto.so" # this is not the library name, nor is it "MagicCrypto" | ||
# HINTS "$ENV{ARIA_DIR}/lib/libMagicCrypto.so") | ||
|
||
if(EXISTS "$ENV{ARIA_DIR}/lib/libMagicCrypto.so") | ||
set(ARIA_LIBRARY "MagicCrypto") | ||
set(ARIA_LIB_FILE "$ENV{ARIA_DIR}/lib/libMagicCrypto.so") | ||
# message(STATUS "ARIA Check: found libMagicCrypto.so via file exists") | ||
endif() | ||
|
||
mark_as_advanced(ARIA_INCLUDE_DIR ARIA_LIBRARY) | ||
|
||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(ARIA DEFAULT_MSG ARIA_INCLUDE_DIR ARIA_LIBRARY) | ||
|
||
# message(STATUS "") | ||
# message(STATUS "ARIA Check: FindARIA.cmake") | ||
# message(STATUS "ARIA Check: ARIA_INCLUDE_DIR: ${ARIA_INCLUDE_DIR}") | ||
# message(STATUS "ARIA Check: ARIA_LIBRARY: ${ARIA_LIBRARY}") | ||
# message(STATUS "ARIA Check: ARIA_FOUND: ${ARIA_FOUND}") | ||
# message(STATUS "ARIA Check: CMAKE_CURRENT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters