-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
227 additions
and
22 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 |
---|---|---|
@@ -0,0 +1,75 @@ | ||
name: build-macos-latest | ||
|
||
on: [push, pull_request] | ||
|
||
env: | ||
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) | ||
BUILD_TYPE: Release | ||
|
||
|
||
jobs: | ||
build: | ||
# The CMake configure and build commands are platform agnostic and should work equally | ||
# well on Windows or Mac. You can convert this to a matrix build if you need | ||
# cross-platform coverage. | ||
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix | ||
runs-on: macos-latest | ||
strategy: | ||
matrix: | ||
compiler: [gcc, clang] | ||
include: | ||
- compiler: gcc | ||
cc: gcc | ||
cxx: g++ | ||
- compiler: clang | ||
cc: clang | ||
cxx: clang++ | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: 'recursive' | ||
|
||
- name: Install libraries | ||
run: | | ||
checkPkgAndInstall() | ||
{ | ||
while [ $# -ne 0 ] | ||
do | ||
rm -f '/usr/local/bin/2to3' | ||
if brew ls --versions $1 ; then | ||
brew upgrade $1 | ||
else | ||
brew install $1 | ||
fi | ||
shift | ||
done | ||
} | ||
checkPkgAndInstall ccache cmake cunit | ||
- name: Create Build Environment | ||
# Some projects don't allow in-source building, so create a separate build directory | ||
# We'll use this as our working directory for all subsequent commands | ||
run: cmake -E make_directory ${{github.workspace}}/build | ||
|
||
- name: Configure CMake | ||
# Use a bash shell so we can use the same syntax for environment variable | ||
# access regardless of the host operating system | ||
shell: bash | ||
working-directory: ${{github.workspace}}/build | ||
# Note the current convention is to use the -S and -B options here to specify source | ||
# and build directories, but this is only available with CMake 3.13 and higher. | ||
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12 | ||
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE | ||
|
||
- name: Build | ||
working-directory: ${{github.workspace}}/build | ||
shell: bash | ||
# Execute the build. You can specify a specific target with "--target <NAME>" | ||
run: cmake --build . --config $BUILD_TYPE | ||
|
||
- name: Test | ||
working-directory: ${{github.workspace}}/build | ||
shell: bash | ||
# Execute tests defined by the CMake configuration. | ||
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail | ||
run: ctest -C $BUILD_TYPE --output-on-failure --test-dir tests |
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,63 @@ | ||
name: build-ubuntu-latest | ||
|
||
on: [push, pull_request] | ||
|
||
env: | ||
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) | ||
BUILD_TYPE: Release | ||
|
||
|
||
jobs: | ||
build: | ||
# The CMake configure and build commands are platform agnostic and should work equally | ||
# well on Windows or Mac. You can convert this to a matrix build if you need | ||
# cross-platform coverage. | ||
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
compiler: [gcc, clang] | ||
include: | ||
- compiler: gcc | ||
cc: gcc | ||
cxx: g++ | ||
- compiler: clang | ||
cc: clang | ||
cxx: clang++ | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: 'recursive' | ||
|
||
- name: Install libraries | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install ccache cmake libcunit1 libcunit1-doc libcunit1-dev | ||
- name: Create Build Environment | ||
# Some projects don't allow in-source building, so create a separate build directory | ||
# We'll use this as our working directory for all subsequent commands | ||
run: cmake -E make_directory ${{github.workspace}}/build | ||
|
||
- name: Configure CMake | ||
# Use a bash shell so we can use the same syntax for environment variable | ||
# access regardless of the host operating system | ||
shell: bash | ||
working-directory: ${{github.workspace}}/build | ||
# Note the current convention is to use the -S and -B options here to specify source | ||
# and build directories, but this is only available with CMake 3.13 and higher. | ||
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12 | ||
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE | ||
|
||
- name: Build | ||
working-directory: ${{github.workspace}}/build | ||
shell: bash | ||
# Execute the build. You can specify a specific target with "--target <NAME>" | ||
run: cmake --build . --config $BUILD_TYPE | ||
|
||
- name: Test | ||
working-directory: ${{github.workspace}}/build | ||
shell: bash | ||
# Execute tests defined by the CMake configuration. | ||
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail | ||
run: ctest -C $BUILD_TYPE --output-on-failure --test-dir tests |
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,5 +1,5 @@ | ||
/*- | ||
* Copyright (c) 2013 - 2020 Rozhuk Ivan <[email protected]> | ||
* Copyright (c) 2013-2024 Rozhuk Ivan <[email protected]> | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
|
@@ -54,10 +54,15 @@ | |
#ifdef _WINDOWS | ||
# define EINVAL ERROR_INVALID_PARAMETER | ||
#else | ||
# include <sys/param.h> | ||
# include <sys/types.h> | ||
# include <inttypes.h> | ||
#endif | ||
|
||
#ifndef nitems /* SIZEOF() */ | ||
# define nitems(__val) (sizeof(__val) / sizeof(__val[0])) | ||
#endif | ||
|
||
#include "math/elliptic_curve.h" | ||
|
||
|
||
|
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,5 +1,5 @@ | ||
/*- | ||
* Copyright (c) 2016-2023 Rozhuk Ivan <[email protected]> | ||
* Copyright (c) 2016-2024 Rozhuk Ivan <[email protected]> | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
|
@@ -60,6 +60,10 @@ | |
# include <immintrin.h> /* AVX */ | ||
#endif | ||
|
||
#ifndef nitems /* SIZEOF() */ | ||
# define nitems(__val) (sizeof(__val) / sizeof(__val[0])) | ||
#endif | ||
|
||
#if defined(_MSC_VER) || defined(__INTEL_COMPILER) | ||
# define GOST3411_2012_ALIGN(__n) __declspec(align(__n)) /* DECLSPEC_ALIGN() */ | ||
#else /* GCC/clang */ | ||
|
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,5 +1,5 @@ | ||
/*- | ||
* Copyright (c) 2003-2023 Rozhuk Ivan <[email protected]> | ||
* Copyright (c) 2003-2024 Rozhuk Ivan <[email protected]> | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
|
@@ -39,6 +39,10 @@ | |
#include <string.h> /* bcopy, bzero, memcpy, memmove, memset, strerror... */ | ||
#include <inttypes.h> | ||
|
||
#ifndef nitems /* SIZEOF() */ | ||
# define nitems(__val) (sizeof(__val) / sizeof(__val[0])) | ||
#endif | ||
|
||
static void *(*volatile md5_memset_volatile)(void*, int, size_t) = memset; | ||
#define md5_bzero(__mem, __size) md5_memset_volatile((__mem), 0x00, (__size)) | ||
|
||
|
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,5 +1,5 @@ | ||
/*- | ||
* Copyright (c) 2003-2023 Rozhuk Ivan <[email protected]> | ||
* Copyright (c) 2003-2024 Rozhuk Ivan <[email protected]> | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
|
@@ -84,6 +84,10 @@ | |
# include <immintrin.h> /* AVX */ | ||
#endif | ||
|
||
#ifndef nitems /* SIZEOF() */ | ||
# define nitems(__val) (sizeof(__val) / sizeof(__val[0])) | ||
#endif | ||
|
||
#if defined(__SHA__) && defined(__SSSE3__) && defined(__SSE4_1__) | ||
# include <shaintrin.h> | ||
# define SHA1_ENABLE_SIMD 1 | ||
|
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,5 +1,5 @@ | ||
/*- | ||
* Copyright (c) 2013-2023 Rozhuk Ivan <[email protected]> | ||
* Copyright (c) 2013-2024 Rozhuk Ivan <[email protected]> | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
|
@@ -56,6 +56,10 @@ | |
# define SHA2_ENABLE_SIMD 1 | ||
#endif | ||
|
||
#ifndef nitems /* SIZEOF() */ | ||
# define nitems(__val) (sizeof(__val) / sizeof(__val[0])) | ||
#endif | ||
|
||
#if defined(_MSC_VER) || defined(__INTEL_COMPILER) | ||
# define SHA2_ALIGN(__n) __declspec(align(__n)) /* DECLSPEC_ALIGN() */ | ||
#else /* GCC/clang */ | ||
|
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,5 +1,5 @@ | ||
/*- | ||
* Copyright (c) 2003-2023 Rozhuk Ivan <[email protected]> | ||
* Copyright (c) 2003-2024 Rozhuk Ivan <[email protected]> | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
|
@@ -29,9 +29,14 @@ | |
#ifndef __BASE64_H__ | ||
#define __BASE64_H__ | ||
|
||
#include <sys/param.h> | ||
#include <sys/types.h> | ||
#include <inttypes.h> | ||
|
||
#ifndef nitems /* SIZEOF() */ | ||
# define nitems(__val) (sizeof(__val) / sizeof(__val[0])) | ||
#endif | ||
|
||
/* | ||
* BASE64 coding: | ||
* 214 46 138 | ||
|
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
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,21 @@ | ||
|
||
############################ TARGETS SECTION ########################### | ||
|
||
# Testing binary. | ||
add_executable(test_base64 base64/main.c) | ||
add_executable(test_ecdsa ecdsa/main.c) | ||
add_executable(test_hash hash/main.c) | ||
add_executable(test_threadpool threadpool/main.c | ||
../src/threadpool/threadpool.c | ||
../src/threadpool/threadpool_msg_sys.c) | ||
target_link_libraries(test_threadpool ${CUNIT_LIBRARY} ${CMAKE_REQUIRED_LIBRARIES}) | ||
|
||
# enable testing functionality | ||
enable_testing() | ||
|
||
# define tests | ||
add_test(NAME test_base64 COMMAND $<TARGET_FILE:test_base64>) | ||
add_test(NAME test_ecdsa COMMAND $<TARGET_FILE:test_ecdsa>) | ||
add_test(NAME test_hash COMMAND $<TARGET_FILE:test_hash>) | ||
add_test(NAME test_threadpool COMMAND $<TARGET_FILE:test_threadpool>) | ||
|
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
Oops, something went wrong.