-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
17d28e2
commit 2c6c86a
Showing
1,255 changed files
with
336,862 additions
and
1 deletion.
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,71 @@ | ||
cmake_minimum_required(VERSION 3.1) | ||
project(ProxyLib) | ||
include(${CMAKE_ROOT}/Modules/ExternalProject.cmake) | ||
|
||
set(MBED_TLS_VERSION 2.7.5) | ||
|
||
ExternalProject_Add(mbed_tls | ||
URL https://github.com/ARMmbed/mbedtls/archive/mbedtls-${MBED_TLS_VERSION}.tar.gz | ||
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/mbed_tls | ||
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_CURRENT_BINARY_DIR}/mbed_tls/build | ||
CMAKE_CACHE_ARGS -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=true | ||
) | ||
ExternalProject_Get_Property(mbed_tls install_dir) | ||
|
||
set(CMAKE_CXX_STANDARD 11) | ||
set(CMAKE_POSITION_INDEPENDENT_CODE ON) | ||
include_directories(src src/include ${install_dir}/build/include include ${gtest_SOURCE_DIR}/include ${gtest_SOURCE_DIR}) | ||
|
||
set(PROXYLIB_SOURCES | ||
src/Context.cpp | ||
src/BigNumber.cpp | ||
src/ErrorWrapper.cpp | ||
src/Point.cpp | ||
src/helpers.cpp | ||
src/Proxy_C.cpp) | ||
|
||
set(PROJECT_TESTS ${PROJECT_NAME}_tests) | ||
add_library(${PROJECT_NAME} ${PROXYLIB_SOURCES}) | ||
target_link_libraries(${PROJECT_NAME}) | ||
add_dependencies(${PROJECT_NAME} mbed_tls) | ||
|
||
add_custom_target(lib ALL | ||
COMMAND ar -x ${install_dir}/build/lib/libmbedcrypto.a | ||
COMMAND ar -x $<TARGET_FILE:${PROJECT_NAME}> | ||
COMMAND ar -qc $<TARGET_FILE:${PROJECT_NAME}> *.o | ||
COMMAND rm -f *.o | ||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR} | ||
DEPENDS mbed_tls ${PROJECT_NAME} | ||
) | ||
|
||
enable_testing() | ||
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -j4) | ||
|
||
add_executable(big_number_test | ||
src/tests/big_number_test.cpp | ||
src/tests/test_main.cpp | ||
) | ||
|
||
# Standard linking to gtest stuff. | ||
target_link_libraries(big_number_test gtest gtest_main ${PROJECT_NAME} pthread) | ||
|
||
add_test(big_number_test big_number_test) | ||
|
||
add_executable(re_encryption_test | ||
src/tests/re_encryption_test.cpp | ||
src/tests/test_main.cpp | ||
) | ||
|
||
# Standard linking to gtest stuff. | ||
target_link_libraries(re_encryption_test gtest gtest_main ${PROJECT_NAME} pthread) | ||
|
||
add_test(c_interface_test c_interface_test) | ||
|
||
add_executable(c_interface_test | ||
src/tests/c_interface_test.cpp | ||
src/tests/test_main.cpp | ||
) | ||
|
||
# Standard linking to gtest stuff. | ||
target_link_libraries(c_interface_test gtest gtest_main ${PROJECT_NAME} pthread) | ||
|
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 +1,34 @@ | ||
# Proxy-ReEncryption-JSProxy-ReEncryption-CPP | ||
# KMSChain for C++ | ||
|
||
We provide "Encryption & Key Management" service in operation with open sourced libraries with support for Javascript, Python, Go, Rust, Java, C++ languages. | ||
|
||
Our goal is to enable developers to build ’privacy by design’, end-to-end secured applications, without any technical complexities. | ||
|
||
This C++ library is our main low level algorithmic implementation, which is embedded in all our other SDK libraries and web services. | ||
|
||
# C Interface | ||
Most of the programming languages and low level API's don't have C++ integration capability, so for being platform and programing | ||
language agnostic, we are providing low level C interface for using KMSChain's encryption on any platform and with any programming language. | ||
|
||
[`inculde/CryptoMagic_C.h`](inculde/CryptoMagic_C.h) is a single header file which contains all our API functions for having fully functional | ||
proxy re-encryption and key management system for your application. | ||
|
||
```cpp | ||
#include "CryptoMagic_C.h" | ||
.... | ||
.... | ||
cryptomagic_init(); | ||
void * cm = cryptomagic_new(); | ||
..... | ||
..... | ||
cryptomagic_clean(cm); | ||
``` | ||
As a low level interface, we are providing memory allocation and de-allocation functions for each object. | ||
# Building | ||
For building project as a static library, you will need to `install OpenSSL`, because currently we are using OpenSSL as a cryptographic backend. | ||
```bash | ||
mkdir build | ||
cd build && cmake .. | ||
make | ||
``` |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.