Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • car/libdap-crypto
1 result
Show changes
Commits on Source (88)
Showing
with 1884 additions and 1238 deletions
cmake_minimum_required(VERSION 3.0) cmake_minimum_required(VERSION 3.0)
project (dap_crypto) project (dap_crypto)
# fix implicit declaration warnings # fix implicit declaration warnings
add_definitions ("-D_GNU_SOURCE") add_definitions ("-D_GNU_SOURCE")
if(NOT SUBMODULES_NO_BUILD)
#set(CMAKE_C_FLAGS "-std=c11 -O2 -Wall -Wextra -fPIC -fno-pie -no-pie -fno-ident ")
#set(CMAKE_ASM_FLAGS "-std=c11 -O2 -Wall -Wextra -fPIC -fno-pie -no-pie -fno-ident ") # Check whether we're on a 32-bit or 64-bit system
#set(CMAKE_C_FLAGS "-std=c11 -O3 -Wall -Wextra -fPIC -fno-pie -no-pie -fno-ident -ffast-math -ftree-vectorize -mfpmath=sse -mmmx -msse2 -fno-asynchronous-unwind-tables -ffunction-sections -Wl,--gc-sections -Wl,--strip-all") if(CMAKE_SIZEOF_VOID_P EQUAL "8")
#set(CMAKE_ASM_FLAGS "-std=c11 -O3 -Wall -Wextra -fPIC -fno-pie -no-pie -fno-ident -ffast-math -ftree-vectorize -mfpmath=sse -mmmx -msse2 -fno-asynchronous-unwind-tables -ffunction-sections -Wl,--gc-sections -Wl,--strip-all") set(DEFAULT_BUILD_64 ON)
#set(CMAKE_C_FLAGS "-static -Wall -O3 -fno-ident -ffast-math -ftree-vectorize -mfpmath=sse -mmmx -msse2 -fno-asynchronous-unwind-tables -ffunction-sections -Wl,--gc-sections -Wl,--strip-all") else()
#set(CMAKE_ASM_FLAGS "-static -Wall -O3 -fno-ident -ffast-math -ftree-vectorize -mfpmath=sse -mmmx -msse2 -fno-asynchronous-unwind-tables -ffunction-sections -Wl,--gc-sections -Wl,--strip-all") set(DEFAULT_BUILD_64 OFF)
endif()
if(NOT (${SUBMODULES_NO_BUILD} MATCHES ON)) option(BUILD_64 "Build for 64-bit? 'OFF' builds for 32-bit." ${DEFAULT_BUILD_64})
# Check whether we're on a 32-bit or 64-bit system
if(CMAKE_SIZEOF_VOID_P EQUAL "8") set(_CCOPT "-Wall -O2 -pg -fPIC -fno-pie -no-pie")
set(DEFAULT_BUILD_64 ON) set(_LOPT "-pg")
else() SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -pg")
set(DEFAULT_BUILD_64 OFF) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_CCOPT}")
endif() set(CMAKE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS} ${_LOPT}")
option(BUILD_64 "Build for 64-bit? 'OFF' builds for 32-bit." ${DEFAULT_BUILD_64})
if (NOT (TARGET dap_core))
add_definitions ("-DDAP_SERVER") add_subdirectory(libdap)
add_definitions ("-DNODE_NETNAME=\"kelvin\"") endif()
endif()
set(_CCOPT "-Wall -O2 -pg -fPIC -fno-pie -no-pie")
set(_LOPT "-pg") file( GLOB CRYPTO_SRCS
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -pg") src/*.c
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_CCOPT}") src/rand/*.c
set(CMAKE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS} ${_LOPT}") src/iaes/*.c
src/oaes/*.c
if (NOT (TARGET dap_core)) src/blowfish/*.c
add_subdirectory(libdap) src/GOST/*.c
endif() src/salsa2012/*.c
endif() src/seed/*.c
src/sha3/*.c
file( GLOB CRYPTO_SRCS src/msrln/*.c
src/*.c src/defeo_scheme/*.c
src/rand/*.c src/sig_bliss/*.c
src/iaes/*.c src/sig_tesla/*.c
src/oaes/*.c src/sig_picnic/*.c
src/sha3/*.c src/sig_dilithium/*.c
src/msrln/*.c src/ringct20/*.c
src/defeo_scheme/*.c )
src/sig_bliss/*.c
src/sig_tesla/*.c file( GLOB CRYPTO_HEADERS
src/sig_picnic/*.c src/*.h
src/sig_dilithium/*.c src/rand/*.h
) src/iaes/*.h
src/oaes/*.h
file( GLOB CRYPTO_HEADERS src/blowfish/*.h
src/*.h src/GOST/*.h
src/rand/*.h src/salsa2012/*.h
src/iaes/*.h src/seed/*.h
src/oaes/*.h src/sha3/*.h
src/sha3/*.h src/msrln/*.h
src/msrln/*.h src/defeo_scheme/*.h
src/defeo_scheme/*.h src/sig_bliss/*.h
src/sig_bliss/*.h src/sig_tesla/*.h
src/sig_tesla/*.h src/sig_picnic/*.h
src/sig_picnic/*.h src/sig_dilithium/*.h
src/sig_dilithium/*.h src/ringct20/*.h
include/*.h include/*.h
) )
enable_language(ASM) enable_language(ASM)
file( GLOB XKCP_SRCS file( GLOB XKCP_SRCS
src/XKCP/lib/high/Keccak/FIPS202/KeccakHash.c #src/XKCP/lib/high/Keccak/FIPS202/KeccakHash.c
src/XKCP/lib/high/Keccak/KeccakSpongeWidth1600.c #src/XKCP/lib/high/Keccak/KeccakSpongeWidth1600.c
src/XKCP/lib/high/Keccak/SP800-185/SP800-185.c src/XKCP/lib/high/Keccak/SP800-185/SP800-185.c
src/XKCP/lib/high/Keccak/FIPS202/SimpleFIPS202.c src/XKCP/lib/high/Keccak/FIPS202/SimpleFIPS202.c
) )
if(WIN32) if(WIN32)
if(BUILD_64) if(BUILD_64)
file( GLOB XKCP_SRCS2 src/XKCP/lib/low/KeccakP-1600/OptimizedAsmX86-64/KeccakP-1600-x86-64-gas.s ) #file( GLOB XKCP_SRCS2 src/XKCP/lib/low/KeccakP-1600/OptimizedAsmX86-64/KeccakP-1600-x86-64-gas.s ) - SIGSEGV on MinGW
else() file( GLOB XKCP_SRCS2 src/XKCP/lib/low/KeccakP-1600/Compact64/KeccakP-1600-compact64.c )
file( GLOB XKCP_SRCS2 src/XKCP/lib/low/KeccakP-1600/Inplace32BI/KeccakP-1600-inplace32BI.c ) else()
endif() file( GLOB XKCP_SRCS2 src/XKCP/lib/low/KeccakP-1600/Inplace32BI/KeccakP-1600-inplace32BI.c )
endif() endif()
endif()
if(UNIX)
if(BUILD_64) if(UNIX)
file( GLOB XKCP_SRCS2 src/XKCP/lib/low/KeccakP-1600/OptimizedAsmX86-64/KeccakP-1600-x86-64-gas.s ) if(BUILD_64)
else() file( GLOB XKCP_SRCS2 src/XKCP/lib/low/KeccakP-1600/OptimizedAsmX86-64/KeccakP-1600-x86-64-gas.s )
file( GLOB XKCP_SRCS2 src/XKCP/lib/low/KeccakP-1600/Inplace32BI/KeccakP-1600-inplace32BI.c ) else()
endif() file( GLOB XKCP_SRCS2 src/XKCP/lib/low/KeccakP-1600/Inplace32BI/KeccakP-1600-inplace32BI.c )
endif() endif()
endif()
add_library(${PROJECT_NAME} STATIC ${CRYPTO_SRCS} ${XKCP_SRCS} ${XKCP_SRCS2} ${CRYPTO_HEADERS} )
add_library(${PROJECT_NAME} STATIC ${CRYPTO_SRCS} ${XKCP_SRCS} ${XKCP_SRCS2} ${CRYPTO_HEADERS} )
target_include_directories(dap_crypto PRIVATE src/rand src/iaes src/oaes sha3 src/msrln src/defeo_scheme src/sig_bliss src/sig_tesla src/sig_picnic src/sig_dilithium src include)
target_include_directories(dap_crypto INTERFACE src/ src/sha3 include/) target_include_directories(dap_crypto PRIVATE src/rand src/iaes src/oaes src/sha3 src/msrln src/defeo_scheme src/sig_bliss src/sig_tesla src/sig_picnic src/sig_dilithium src include)
target_include_directories(dap_crypto INTERFACE src/ src/sha3 include/)
target_include_directories(dap_crypto INTERFACE
src/XKCP/lib/common target_include_directories(dap_crypto PUBLIC
src/XKCP/lib/low/common src/XKCP/lib/common
src/XKCP/lib/high/Keccak src/XKCP/lib/low/common
src/XKCP/lib/high/common src/XKCP/lib/high/Keccak
src/XKCP/lib/high/Keccak/FIPS202 src/XKCP/lib/high/common
src/XKCP/lib/high/Keccak/SP800-185 src/XKCP/lib/high/Keccak/FIPS202
src/XKCP/lib/low/KeccakP-1600/Optimized src/XKCP/lib/high/Keccak/SP800-185
) src/XKCP/lib/low/KeccakP-1600/Optimized
)
target_include_directories(dap_crypto PRIVATE
src/XKCP/lib/common if(WIN32)
src/XKCP/lib/low/common if(BUILD_64)
src/XKCP/lib/high/Keccak
src/XKCP/lib/high/common #target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600/OptimizedAsmX86-64)
src/XKCP/lib/high/Keccak/FIPS202 target_include_directories(dap_crypto PUBLIC src/XKCP/lib/low/KeccakP-1600/Compact64)
src/XKCP/lib/high/Keccak/SP800-185
src/XKCP/lib/low/KeccakP-1600/Optimized if (__AVX__)
) target_include_directories(dap_crypto PUBLIC src/XKCP/lib/low/KeccakP-1600-times4/SIMD256)
target_include_directories(dap_crypto PUBLIC src/XKCP/lib/low/KeccakP-1600-times4/SIMD512/AVX2ufull)
if(WIN32) target_include_directories(dap_crypto PUBLIC src/XKCP/lib/low/KeccakP-1600-times8/FallbackOn4)
if(BUILD_64) elseif(__AVX2__)
target_include_directories(dap_crypto PUBLIC src/XKCP/lib/low/KeccakP-1600-times2/SIMD512)
#target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600/OptimizedAsmX86-64) target_include_directories(dap_crypto PUBLIC src/XKCP/lib/low/KeccakP-1600-times2/SIMD512/AVX512ufull)
target_include_directories(dap_crypto PUBLIC src/XKCP/lib/low/KeccakP-1600/OptimizedAsmX86-64) target_include_directories(dap_crypto PUBLIC src/XKCP/lib/low/KeccakP-1600-times4/SIMD512)
target_include_directories(dap_crypto PUBLIC src/XKCP/lib/low/KeccakP-1600-times4/SIMD512/AVX512ufull)
if(__AVX2__) target_include_directories(dap_crypto PUBLIC src/XKCP/lib/low/KeccakP-1600-times8/SIMD512)
target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times2/SIMD512) target_include_directories(dap_crypto PUBLIC src/XKCP/lib/low/KeccakP-1600-times8/SIMD512/AVX512ufull)
target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times2/SIMD512/AVX512ufull) elseif(__SSE4_1__)
target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times2/SIMD512) target_include_directories(dap_crypto PUBLIC src/XKCP/lib/low/KeccakP-1600-times2/SIMD128)
target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times2/SIMD512/AVX512ufull) target_include_directories(dap_crypto PUBLIC src/XKCP/lib/low/KeccakP-1600-times2/SIMD128/SSE2ufull)
elseif(__SSE4_1__) target_include_directories(dap_crypto PUBLIC src/XKCP/lib/low/KeccakP-1600-times4/FallbackOn2)
target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times2/SIMD128) target_include_directories(dap_crypto PUBLIC src/XKCP/lib/low/KeccakP-1600-times8/FallbackOn2)
target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times2/SIMD128/SSE2ufull) else()
target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times2/SIMD128) target_include_directories(dap_crypto PUBLIC src/XKCP/lib/low/KeccakP-1600-times2/FallbackOn1)
target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times2/SIMD128/SSE2ufull) target_include_directories(dap_crypto PUBLIC src/XKCP/lib/low/KeccakP-1600-times4/FallbackOn1)
else() target_include_directories(dap_crypto PUBLIC src/XKCP/lib/low/KeccakP-1600-times8/FallbackOn1)
target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times2/FallbackOn1) endif()
target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times2/FallbackOn1)
endif() else()
target_include_directories(dap_crypto PUBLIC src/XKCP/lib/low/KeccakP-1600/Inplace32BI)
if(__AVX2__)
target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times4/SIMD512) if (__AVX__)
target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times4/SIMD512/AVX512ufull) target_include_directories(dap_crypto PUBLIC src/XKCP/lib/low/KeccakP-1600-times4/SIMD256)
target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times4/SIMD512) target_include_directories(dap_crypto PUBLIC src/XKCP/lib/low/KeccakP-1600-times4/SIMD512/AVX2ufull)
target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times4/SIMD512/AVX512ufull) target_include_directories(dap_crypto PUBLIC src/XKCP/lib/low/KeccakP-1600-times8/FallbackOn4)
elseif(__AVX__) elseif(__AVX2__)
target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times4/SIMD256) target_include_directories(dap_crypto PUBLIC src/XKCP/lib/low/KeccakP-1600-times2/SIMD512)
target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times4/SIMD512/AVX2ufull) target_include_directories(dap_crypto PUBLIC src/XKCP/lib/low/KeccakP-1600-times2/SIMD512/AVX512ufull)
target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times4/SIMD256) target_include_directories(dap_crypto PUBLIC src/XKCP/lib/low/KeccakP-1600-times4/SIMD512)
target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times4/SIMD512/AVX2ufull) target_include_directories(dap_crypto PUBLIC src/XKCP/lib/low/KeccakP-1600-times4/SIMD512/AVX512ufull)
elseif(__SSE4_1__) target_include_directories(dap_crypto PUBLIC src/XKCP/lib/low/KeccakP-1600-times8/SIMD512)
target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times4/FallbackOn2) target_include_directories(dap_crypto PUBLIC src/XKCP/lib/low/KeccakP-1600-times8/SIMD512/AVX512ufull)
target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times4/FallbackOn2) elseif(__SSE4_1__)
else() target_include_directories(dap_crypto PUBLIC src/XKCP/lib/low/KeccakP-1600-times2/SIMD128)
target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times4/FallbackOn1) target_include_directories(dap_crypto PUBLIC src/XKCP/lib/low/KeccakP-1600-times2/SIMD128/SSE2ufull)
target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times4/FallbackOn1) target_include_directories(dap_crypto PUBLIC src/XKCP/lib/low/KeccakP-1600-times4/FallbackOn2)
endif() target_include_directories(dap_crypto PUBLIC src/XKCP/lib/low/KeccakP-1600-times8/FallbackOn2)
else()
if(__AVX2__) target_include_directories(dap_crypto PUBLIC src/XKCP/lib/low/KeccakP-1600-times2/FallbackOn1)
target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times8/SIMD512) target_include_directories(dap_crypto PUBLIC src/XKCP/lib/low/KeccakP-1600-times4/FallbackOn1)
target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times8/SIMD512/AVX512ufull) target_include_directories(dap_crypto PUBLIC src/XKCP/lib/low/KeccakP-1600-times8/FallbackOn1)
target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times8/SIMD512) endif()
target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times8/SIMD512/AVX512ufull) endif()
elseif(__AVX__) endif()
target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times8/FallbackOn4)
target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times8/FallbackOn4) if(UNIX)
elseif(__SSE4_1__) if(BUILD_64)
target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times8/FallbackOn2) target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600/OptimizedAsmX86-64)
target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times8/FallbackOn2) target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600/OptimizedAsmX86-64)
else()
target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times8/FallbackOn1) if(__AVX2__)
target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times8/FallbackOn1) target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times2/SIMD512)
endif() target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times2/SIMD512/AVX512ufull)
target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times2/SIMD512)
else() target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times2/SIMD512/AVX512ufull)
target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600/Inplace32BI) elseif(__SSE4_1__)
target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600/Inplace32BI) target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times2/SIMD128)
target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times2/SIMD128/SSE2ufull)
if(__AVX2__) target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times2/SIMD128)
target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times2/SIMD512) target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times2/SIMD128/SSE2ufull)
target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times2/SIMD512/AVX512ufull) else()
target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times2/SIMD512) target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times2/FallbackOn1)
target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times2/SIMD512/AVX512ufull) target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times2/FallbackOn1)
elseif(__SSE4_1__) endif()
target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times2/SIMD128)
target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times2/SIMD128/SSE2ufull) if(__AVX2__)
target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times2/SIMD128) target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times4/SIMD512)
target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times2/SIMD128/SSE2ufull) target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times4/SIMD512/AVX512ufull)
else() target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times4/SIMD512)
target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times2/FallbackOn1) target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times4/SIMD512/AVX512ufull)
target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times2/FallbackOn1) elseif(__AVX__)
endif() target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times4/SIMD256)
target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times4/SIMD512/AVX2ufull)
if(__AVX2__) target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times4/SIMD256)
target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times4/SIMD512) target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times4/SIMD512/AVX2ufull)
target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times4/SIMD512/AVX512ufull) elseif(__SSE4_1__)
target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times4/SIMD512) target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times4/FallbackOn2)
target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times4/SIMD512/AVX512ufull) target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times4/FallbackOn2)
elseif(__AVX__) else()
target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times4/SIMD256) target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times4/FallbackOn1)
target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times4/SIMD512/AVX2ufull) target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times4/FallbackOn1)
target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times4/SIMD256) endif()
target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times4/SIMD512/AVX2ufull)
elseif(__SSE4_1__) if(__AVX2__)
target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times4/FallbackOn2) target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times8/SIMD512)
target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times4/FallbackOn2) target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times8/SIMD512/AVX512ufull)
else() target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times8/SIMD512)
target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times4/FallbackOn1) target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times8/SIMD512/AVX512ufull)
target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times4/FallbackOn1) elseif(__AVX__)
endif() target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times8/FallbackOn4)
target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times8/FallbackOn4)
if(__AVX2__) elseif(__SSE4_1__)
target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times8/SIMD512) target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times8/FallbackOn2)
target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times8/SIMD512/AVX512ufull) target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times8/FallbackOn2)
target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times8/SIMD512) else()
target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times8/SIMD512/AVX512ufull) target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times8/FallbackOn1)
elseif(__AVX__) target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times8/FallbackOn1)
target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times8/FallbackOn4) endif()
target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times8/FallbackOn4)
elseif(__SSE4_1__) else()
target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times8/FallbackOn2) target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600/Inplace32BI)
target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times8/FallbackOn2) target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600/Inplace32BI)
else()
target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times8/FallbackOn1) if(__AVX2__)
target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times8/FallbackOn1) target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times2/SIMD512)
endif() target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times2/SIMD512/AVX512ufull)
target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times2/SIMD512)
endif() target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times2/SIMD512/AVX512ufull)
endif() elseif(__SSE4_1__)
target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times2/SIMD128)
if(UNIX) target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times2/SIMD128/SSE2ufull)
if(BUILD_64) target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times2/SIMD128)
target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600/OptimizedAsmX86-64) target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times2/SIMD128/SSE2ufull)
target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600/OptimizedAsmX86-64) else()
target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times2/FallbackOn1)
if(__AVX2__) target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times2/FallbackOn1)
target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times2/SIMD512) endif()
target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times2/SIMD512/AVX512ufull)
target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times2/SIMD512) if(__AVX2__)
target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times2/SIMD512/AVX512ufull) target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times4/SIMD512)
elseif(__SSE4_1__) target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times4/SIMD512/AVX512ufull)
target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times2/SIMD128) target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times4/SIMD512)
target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times2/SIMD128/SSE2ufull) target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times4/SIMD512/AVX512ufull)
target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times2/SIMD128) elseif(__AVX__)
target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times2/SIMD128/SSE2ufull) target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times4/SIMD256)
else() target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times4/SIMD512/AVX2ufull)
target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times2/FallbackOn1) target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times4/SIMD256)
target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times2/FallbackOn1) target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times4/SIMD512/AVX2ufull)
endif() elseif(__SSE4_1__)
target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times4/FallbackOn2)
if(__AVX2__) target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times4/FallbackOn2)
target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times4/SIMD512) else()
target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times4/SIMD512/AVX512ufull) target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times4/FallbackOn1)
target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times4/SIMD512) target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times4/FallbackOn1)
target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times4/SIMD512/AVX512ufull) endif()
elseif(__AVX__)
target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times4/SIMD256) if(__AVX2__)
target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times4/SIMD512/AVX2ufull) target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times8/SIMD512)
target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times4/SIMD256) target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times8/SIMD512/AVX512ufull)
target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times4/SIMD512/AVX2ufull) target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times8/SIMD512)
elseif(__SSE4_1__) target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times8/SIMD512/AVX512ufull)
target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times4/FallbackOn2) elseif(__AVX__)
target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times4/FallbackOn2) target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times8/FallbackOn4)
else() target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times8/FallbackOn4)
target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times4/FallbackOn1) elseif(__SSE4_1__)
target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times4/FallbackOn1) target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times8/FallbackOn2)
endif() target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times8/FallbackOn2)
else()
if(__AVX2__) target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times8/FallbackOn1)
target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times8/SIMD512) target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times8/FallbackOn1)
target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times8/SIMD512/AVX512ufull) endif()
target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times8/SIMD512)
target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times8/SIMD512/AVX512ufull) endif()
elseif(__AVX__) endif()
target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times8/FallbackOn4)
target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times8/FallbackOn4) if(WIN32)
elseif(__SSE4_1__) target_link_libraries(dap_crypto dap_core)
target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times8/FallbackOn2) endif()
target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times8/FallbackOn2)
else() if(UNIX)
target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times8/FallbackOn1) target_link_libraries(dap_crypto dap_core m)
target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times8/FallbackOn1) endif()
endif()
else() if(BUILD_CRYPTO_TESTS)
target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600/Inplace32BI) enable_testing()
target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600/Inplace32BI) add_subdirectory(test)
endif()
if(__AVX2__)
target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times2/SIMD512)
target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times2/SIMD512/AVX512ufull)
target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times2/SIMD512)
target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times2/SIMD512/AVX512ufull)
elseif(__SSE4_1__)
target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times2/SIMD128)
target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times2/SIMD128/SSE2ufull)
target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times2/SIMD128)
target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times2/SIMD128/SSE2ufull)
else()
target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times2/FallbackOn1)
target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times2/FallbackOn1)
endif()
if(__AVX2__)
target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times4/SIMD512)
target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times4/SIMD512/AVX512ufull)
target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times4/SIMD512)
target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times4/SIMD512/AVX512ufull)
elseif(__AVX__)
target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times4/SIMD256)
target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times4/SIMD512/AVX2ufull)
target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times4/SIMD256)
target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times4/SIMD512/AVX2ufull)
elseif(__SSE4_1__)
target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times4/FallbackOn2)
target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times4/FallbackOn2)
else()
target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times4/FallbackOn1)
target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times4/FallbackOn1)
endif()
if(__AVX2__)
target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times8/SIMD512)
target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times8/SIMD512/AVX512ufull)
target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times8/SIMD512)
target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times8/SIMD512/AVX512ufull)
elseif(__AVX__)
target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times8/FallbackOn4)
target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times8/FallbackOn4)
elseif(__SSE4_1__)
target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times8/FallbackOn2)
target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times8/FallbackOn2)
else()
target_include_directories(dap_crypto INTERFACE src/XKCP/lib/low/KeccakP-1600-times8/FallbackOn1)
target_include_directories(dap_crypto PRIVATE src/XKCP/lib/low/KeccakP-1600-times8/FallbackOn1)
endif()
endif()
endif()
if(WIN32)
target_link_libraries(dap_crypto dap_core)
endif()
if(UNIX)
target_link_libraries(dap_crypto dap_core m)
endif()
if(BUILD_CRYPTO_TESTS)
enable_testing()
add_subdirectory(test)
endif()
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.11.2, 2020-04-29T10:52:27. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
<value type="QByteArray">{11b3ace2-edb6-4ae7-8e1b-fce9fa91893f}</value>
</data>
<data>
<variable>ProjectExplorer.Project.ActiveTarget</variable>
<value type="int">0</value>
</data>
<data>
<variable>ProjectExplorer.Project.EditorSettings</variable>
<valuemap type="QVariantMap">
<value type="bool" key="EditorConfiguration.AutoIndent">true</value>
<value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
<value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value>
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
<value type="QString" key="language">Cpp</value>
<valuemap type="QVariantMap" key="value">
<value type="QByteArray" key="CurrentPreferences">CppGlobal</value>
</valuemap>
</valuemap>
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
<value type="QString" key="language">QmlJS</value>
<valuemap type="QVariantMap" key="value">
<value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value>
</valuemap>
</valuemap>
<value type="int" key="EditorConfiguration.CodeStyle.Count">2</value>
<value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value>
<value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
<value type="int" key="EditorConfiguration.IndentSize">4</value>
<value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
<value type="int" key="EditorConfiguration.MarginColumn">80</value>
<value type="bool" key="EditorConfiguration.MouseHiding">true</value>
<value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
<value type="int" key="EditorConfiguration.PaddingMode">1</value>
<value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
<value type="bool" key="EditorConfiguration.ShowMargin">false</value>
<value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
<value type="bool" key="EditorConfiguration.SmartSelectionChanging">true</value>
<value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
<value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
<value type="int" key="EditorConfiguration.TabSize">8</value>
<value type="bool" key="EditorConfiguration.UseGlobal">true</value>
<value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
<value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
<value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
<value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
<value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.PluginSettings</variable>
<valuemap type="QVariantMap">
<valuelist type="QVariantList" key="ClangCodeModel.CustomCommandLineKey">
<value type="QString">-fno-delayed-template-parsing</value>
</valuelist>
<value type="bool" key="ClangCodeModel.UseGlobalConfig">true</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.Target.0</variable>
<valuemap type="QVariantMap">
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 5.14.2 MinGW 32-bit</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 5.14.2 MinGW 32-bit</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.qt5.5142.win32_mingw73_kit</value>
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
<valuelist type="QVariantList" key="CMake.Configuration">
<value type="QString">BUILD_CRYPTO_TESTS:BOOL=ON</value>
<value type="QString">CMAKE_BUILD_TYPE:STRING=Debug</value>
<value type="QString">CMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx}</value>
<value type="QString">CMAKE_C_COMPILER:STRING=%{Compiler:Executable:C}</value>
<value type="QString">CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX}</value>
<value type="QString">QT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable}</value>
</valuelist>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">C:/qt_proj/build-libdap-crypto_new-Desktop_Qt_5_14_2_MinGW_32_bit-Debug</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
<value type="QString">all</value>
</valuelist>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
<value type="QString">clean</value>
</valuelist>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
<valuelist type="QVariantList" key="CMake.Configuration">
<value type="QString">CMAKE_BUILD_TYPE:STRING=Release</value>
<value type="QString">CMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx}</value>
<value type="QString">CMAKE_C_COMPILER:STRING=%{Compiler:Executable:C}</value>
<value type="QString">CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX}</value>
<value type="QString">QT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable}</value>
</valuelist>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">C:/qt_proj/build-libdap-crypto_new-Desktop_Qt_5_14_2_MinGW_32_bit-Release</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
<value type="QString">all</value>
</valuelist>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
<value type="QString">clean</value>
</valuelist>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Release</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2">
<valuelist type="QVariantList" key="CMake.Configuration">
<value type="QString">CMAKE_BUILD_TYPE:STRING=RelWithDebInfo</value>
<value type="QString">CMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx}</value>
<value type="QString">CMAKE_C_COMPILER:STRING=%{Compiler:Executable:C}</value>
<value type="QString">CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX}</value>
<value type="QString">QT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable}</value>
</valuelist>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">C:/qt_proj/build-libdap-crypto_new-Desktop_Qt_5_14_2_MinGW_32_bit-RelWithDebInfo</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
<value type="QString">all</value>
</valuelist>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
<value type="QString">clean</value>
</valuelist>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Release with Debug Information</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.3">
<valuelist type="QVariantList" key="CMake.Configuration">
<value type="QString">CMAKE_BUILD_TYPE:STRING=MinSizeRel</value>
<value type="QString">CMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx}</value>
<value type="QString">CMAKE_C_COMPILER:STRING=%{Compiler:Executable:C}</value>
<value type="QString">CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX}</value>
<value type="QString">QT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable}</value>
</valuelist>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">C:/qt_proj/build-libdap-crypto_new-Desktop_Qt_5_14_2_MinGW_32_bit-MinSizeRel</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
<value type="QString">all</value>
</valuelist>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
<value type="QString">clean</value>
</valuelist>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Minimum Size Release</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">4</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Deploy</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
<value type="QString" key="Analyzer.Perf.CallgraphMode">dwarf</value>
<valuelist type="QVariantList" key="Analyzer.Perf.Events">
<value type="QString">cpu-cycles</value>
</valuelist>
<valuelist type="QVariantList" key="Analyzer.Perf.ExtraArguments"/>
<value type="int" key="Analyzer.Perf.Frequency">250</value>
<valuelist type="QVariantList" key="Analyzer.Perf.RecordArguments">
<value type="QString">-e</value>
<value type="QString">cpu-cycles</value>
<value type="QString">--call-graph</value>
<value type="QString">dwarf,4096</value>
<value type="QString">-F</value>
<value type="QString">250</value>
</valuelist>
<value type="QString" key="Analyzer.Perf.SampleMode">-F</value>
<value type="bool" key="Analyzer.Perf.Settings.UseGlobalSettings">true</value>
<value type="int" key="Analyzer.Perf.StackSize">4096</value>
<value type="bool" key="Analyzer.QmlProfiler.AggregateTraces">false</value>
<value type="bool" key="Analyzer.QmlProfiler.FlushEnabled">false</value>
<value type="uint" key="Analyzer.QmlProfiler.FlushInterval">1000</value>
<value type="QString" key="Analyzer.QmlProfiler.LastTraceFile"></value>
<value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value>
<valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
<value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
<value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
<value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
<value type="QString" key="Analyzer.Valgrind.KCachegrindExecutable">kcachegrind</value>
<value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value>
<value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
<valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
<value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value>
<value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
<value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value>
<value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
<value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
<valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
<value type="int">0</value>
<value type="int">1</value>
<value type="int">2</value>
<value type="int">3</value>
<value type="int">4</value>
<value type="int">5</value>
<value type="int">6</value>
<value type="int">7</value>
<value type="int">8</value>
<value type="int">9</value>
<value type="int">10</value>
<value type="int">11</value>
<value type="int">12</value>
<value type="int">13</value>
<value type="int">14</value>
</valuelist>
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">crypto-test</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeRunConfiguration.crypto-test</value>
<value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey">crypto-test</value>
<value type="QString" key="RunConfiguration.Arguments"></value>
<value type="bool" key="RunConfiguration.Arguments.multi">false</value>
<value type="QString" key="RunConfiguration.OverrideDebuggerStartup"></value>
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
<value type="bool" key="RunConfiguration.UseLibrarySearchPath">true</value>
<value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
<value type="QString" key="RunConfiguration.WorkingDirectory"></value>
<value type="QString" key="RunConfiguration.WorkingDirectory.default"></value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.1">
<value type="QString" key="Analyzer.Perf.CallgraphMode">dwarf</value>
<valuelist type="QVariantList" key="Analyzer.Perf.Events">
<value type="QString">cpu-cycles</value>
</valuelist>
<valuelist type="QVariantList" key="Analyzer.Perf.ExtraArguments"/>
<value type="int" key="Analyzer.Perf.Frequency">250</value>
<valuelist type="QVariantList" key="Analyzer.Perf.RecordArguments">
<value type="QString">-e</value>
<value type="QString">cpu-cycles</value>
<value type="QString">--call-graph</value>
<value type="QString">dwarf,4096</value>
<value type="QString">-F</value>
<value type="QString">250</value>
</valuelist>
<value type="QString" key="Analyzer.Perf.SampleMode">-F</value>
<value type="bool" key="Analyzer.Perf.Settings.UseGlobalSettings">true</value>
<value type="int" key="Analyzer.Perf.StackSize">4096</value>
<value type="bool" key="Analyzer.QmlProfiler.AggregateTraces">false</value>
<value type="bool" key="Analyzer.QmlProfiler.FlushEnabled">false</value>
<value type="uint" key="Analyzer.QmlProfiler.FlushInterval">1000</value>
<value type="QString" key="Analyzer.QmlProfiler.LastTraceFile"></value>
<value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value>
<valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
<value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
<value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
<value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
<value type="QString" key="Analyzer.Valgrind.KCachegrindExecutable">kcachegrind</value>
<value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value>
<value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
<valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
<value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value>
<value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
<value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value>
<value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
<value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
<valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
<value type="int">0</value>
<value type="int">1</value>
<value type="int">2</value>
<value type="int">3</value>
<value type="int">4</value>
<value type="int">5</value>
<value type="int">6</value>
<value type="int">7</value>
<value type="int">8</value>
<value type="int">9</value>
<value type="int">10</value>
<value type="int">11</value>
<value type="int">12</value>
<value type="int">13</value>
<value type="int">14</value>
</valuelist>
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">crypto_cert_test</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeRunConfiguration.crypto_cert_test</value>
<value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey">crypto_cert_test</value>
<value type="QString" key="RunConfiguration.Arguments"></value>
<value type="bool" key="RunConfiguration.Arguments.multi">false</value>
<value type="QString" key="RunConfiguration.OverrideDebuggerStartup"></value>
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
<value type="bool" key="RunConfiguration.UseLibrarySearchPath">true</value>
<value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
<value type="QString" key="RunConfiguration.WorkingDirectory"></value>
<value type="QString" key="RunConfiguration.WorkingDirectory.default"></value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.RunConfigurationCount">2</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.TargetCount</variable>
<value type="int">1</value>
</data>
<data>
<variable>ProjectExplorer.Project.Updater.FileVersion</variable>
<value type="int">22</value>
</data>
<data>
<variable>Version</variable>
<value type="int">22</value>
</data>
</qtcreator>
# libdap # libdap
Deus Applications Prototypes: core library Deus Applications Prototypes: core library
[![Build Status](https://travis-ci.com/kelvinblockchain/libdap.svg?branch=master)](https://travis-ci.com/kelvinblockchain/libdap) [![Build Status](https://travis-ci.com/cellframe/libdap.svg?branch=master)](https://travis-ci.com/cellframe/libdap)
## Build and Run tests: ## Build and Run tests:
``` ```
......
/*
* Authors:
* Dmitriy A. Gearasimov <gerasimov.dmitriy@demlabs.net>
* DeM Labs Inc. https://demlabs.net
* CellFrame https://cellframe.net
* Sources https://gitlab.demlabs.net/cellframe
* Copyright (c) 2017-2019
* All rights reserved.
This file is part of CellFrame SDK the open source project
CellFrame SDK is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
CellFrame SDK is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with any CellFrame SDK based project. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "dap_sign.h"
#include "dap_pkey.h"
#include "dap_enc.h"
#include "dap_enc_key.h"
#define DAP_CERT_ITEM_NAME_MAX 40
typedef struct dap_cert {
dap_enc_key_t * enc_key;
char name[DAP_CERT_ITEM_NAME_MAX];
void * _pvt;
char * metadata;
} dap_cert_t;
#ifdef __cplusplus
extern "C" {
#endif
int dap_cert_init();
dap_cert_t * dap_cert_new(const char * a_name);
size_t dap_cert_parse_str_list(const char * a_certs_str, dap_cert_t *** a_certs, size_t * a_certs_size);
dap_cert_t * dap_cert_generate(const char * a_cert_name,const char * a_file_path,dap_enc_key_type_t a_key_type );
dap_cert_t * dap_cert_generate_mem_with_seed(const char * a_cert_name, dap_enc_key_type_t a_key_type,
const void* a_seed, size_t a_seed_size);
dap_cert_t * dap_cert_generate_mem(const char * a_cert_name, dap_enc_key_type_t a_key_type );
dap_cert_t * dap_cert_add_file(const char * a_cert_name,const char *a_folder_path);
int dap_cert_save_to_folder(dap_cert_t * a_cert, const char *a_file_dir_path);
const char* dap_cert_get_folder(int a_n_folder_path);
void dap_cert_add_folder(const char *a_folder_path);
void dap_cert_dump(dap_cert_t * a_cert);
dap_pkey_t * dap_cert_to_pkey(dap_cert_t * a_cert);
dap_cert_t * dap_cert_find_by_name(const char * a_cert_name);
dap_sign_t * dap_cert_sign(dap_cert_t * a_cert, const void * a_data, size_t a_data_size, size_t a_output_size_wished );
int dap_cert_compare_with_sign (dap_cert_t * a_cert,const dap_sign_t * a_sign);
size_t dap_cert_sign_output_size(dap_cert_t * a_cert, size_t a_size_wished);
//int dap_cert_sign_output(dap_cert_t * a_cert, const void * a_data, size_t a_data_size
// , void * a_output , size_t a_output_size);
int dap_cert_add_cert_sign(dap_cert_t * a_cert, dap_cert_t * a_cert_signer);
size_t dap_cert_count_cert_sign(dap_cert_t * a_cert);
void dap_cert_deinit();
void dap_cert_delete(dap_cert_t * a_cert);
void dap_cert_delete_by_name(const char * a_cert_name);
#ifdef __cplusplus
}
#endif
/*
* Authors:
* Dmitriy A. Gearasimov <gerasimov.dmitriy@demlabs.net>
* DeM Labs Inc. https://demlabs.net https:/gitlab.com/demlabs
* Kelvin Project https://github.com/kelvinblockchain
* Copyright (c) 2017-2018
* All rights reserved.
This file is part of DAP (Deus Applications Prototypes) the open source project
DAP (Deus Applicaions Prototypes) is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DAP is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with any DAP based project. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <stdint.h>
#include "dap_common.h"
#include "dap_cert.h"
// Magic .dapcert signature
#define dap_cert_FILE_HDR_SIGN 0x0F300C4711E29380
#define dap_cert_FILE_VERSION 1
// Default certificate with private key and optionaly some signs
#define dap_cert_FILE_TYPE_PRIVATE 0x00
// Default certificate with public key and optionaly some signs
#define dap_cert_FILE_TYPE_PUBLIC 0xf0
typedef struct dap_cert_file_hdr
{
uint64_t sign;
int version;
uint8_t type;
dap_sign_type_t sign_type;
uint64_t data_size;
uint64_t data_pvt_size;
uint64_t metadata_size;
time_t ts_last_used;
} DAP_ALIGN_PACKED dap_cert_file_hdr_t;
typedef struct dap_cert_file{
dap_cert_file_hdr_t hdr;
uint8_t data[];
}DAP_ALIGN_PACKED dap_cert_file_t;
#ifdef __cplusplus
extern "C" {
#endif
int dap_cert_file_save(dap_cert_t * a_cert, const char * a_cert_file_path);
uint8_t* dap_cert_mem_save(dap_cert_t * a_cert, uint32_t *a_cert_size_out);
dap_cert_t* dap_cert_file_load(const char * a_cert_file_path);
dap_cert_t* dap_cert_mem_load(const void * a_data, size_t a_data_size);
#ifdef __cplusplus
}
#endif
#ifndef __CRYPTO_COMMON_H__ #ifndef __CRYPTO_COMMON_H__
#define __CRYPTO_COMMON_H__ #define __CRYPTO_COMMON_H__
// For C++ // For C++
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#include <stdint.h> #include <stdint.h>
#include <stdbool.h> #include <stdbool.h>
#include <stddef.h> #include <stddef.h>
#include "dap_common.h" #include "dap_common.h"
#include "sha3/fips202.h" #include "sha3/fips202.h"
#include "KeccakHash.h" //#include "KeccakHash.h"
#include "SimpleFIPS202.h" //#include "SimpleFIPS202.h"
#include "SP800-185.h" //#include "SP800-185.h"
#include "rand/dap_rand.h" #include "rand/dap_rand.h"
// Definition of operating system // Definition of operating system
#define OS_WIN 1 #define OS_WIN 1
#define OS_LINUX 2 #define OS_LINUX 2
#define OS_MACOS 3 #define OS_MACOS 3
#if defined(_WIN32) // Microsoft Windows OS #if defined(_WIN32) // Microsoft Windows OS
#define OS_TARGET OS_WIN #define OS_TARGET OS_WIN
#elif defined(__linux__) // Linux OS #elif defined(__linux__) // Linux OS
#define OS_TARGET OS_LINUX #define OS_TARGET OS_LINUX
#elif defined(__APPLE__) // MACOS #elif defined(__APPLE__) // MACOS
#define OS_TARGET OS_MACOS #define OS_TARGET OS_MACOS
#else #else
#error -- "Unsupported OS" #error -- "Unsupported OS"
#endif #endif
// Definition of compiler // Definition of compiler
#define COMPILER_VC 1 #define COMPILER_VC 1
#define COMPILER_GCC 2 #define COMPILER_GCC 2
#define COMPILER_CLANG 3 #define COMPILER_CLANG 3
#if defined(_MSC_VER) // Microsoft Visual C compiler #if defined(_MSC_VER) // Microsoft Visual C compiler
#define COMPILER COMPILER_VC #define COMPILER COMPILER_VC
#elif defined(__GNUC__) // GNU GCC compiler #elif defined(__GNUC__) // GNU GCC compiler
#define COMPILER COMPILER_GCC #define COMPILER COMPILER_GCC
#elif defined(__clang__) // Clang compiler #elif defined(__clang__) // Clang compiler
#define COMPILER COMPILER_CLANG #define COMPILER COMPILER_CLANG
#else #else
#error -- "Unsupported COMPILER" #error -- "Unsupported COMPILER"
#endif #endif
// Definition of the targeted architecture and basic data types // Definition of the targeted architecture and basic data types
#define TARGET_AMD64 1 #define TARGET_AMD64 1
#define TARGET_x86 2 #define TARGET_x86 2
#define TARGET_ARM 3 #define TARGET_ARM 3
#define TARGET_ARM64 4 #define TARGET_ARM64 4
#if (defined(__x86_64__) || defined(__x86_64) || defined(__arch64__) || defined(_M_AMD64) || defined(_M_X64) || defined(_WIN64) || !defined(__LP64__)) #if (defined(__x86_64__) || defined(__x86_64) || defined(__arch64__) || defined(_M_AMD64) || defined(_M_X64) || defined(_WIN64) || !defined(__LP64__))
#define _AMD64_ #define _AMD64_
#elif (defined(__aarch64__)) #elif (defined(__aarch64__))
#define _ARM64_ #define _ARM64_
#else #else
#define _X86_ #define _X86_
#endif #endif
#if defined(_AMD64_) #if defined(_AMD64_)
#define TARGET TARGET_AMD64 #define TARGET TARGET_AMD64
#define RADIX 64 #define RADIX 64
#define LOG2RADIX 6 #define LOG2RADIX 6
typedef uint64_t digit_t; // Unsigned 64-bit digit typedef uint64_t digit_t; // Unsigned 64-bit digit
typedef int64_t sdigit_t; // Signed 64-bit digit typedef int64_t sdigit_t; // Signed 64-bit digit
typedef uint32_t hdigit_t; // Unsigned 32-bit digit typedef uint32_t hdigit_t; // Unsigned 32-bit digit
#define NWORDS_FIELD 12 // Number of words of a 751-bit field element #define NWORDS_FIELD 12 // Number of words of a 751-bit field element
#define p751_ZERO_WORDS 5 // Number of "0" digits in the least significant part of p751 + 1 #define p751_ZERO_WORDS 5 // Number of "0" digits in the least significant part of p751 + 1
#elif defined(_X86_) #elif defined(_X86_)
#define TARGET TARGET_x86 #define TARGET TARGET_x86
#define RADIX 32 #define RADIX 32
#define LOG2RADIX 5 #define LOG2RADIX 5
typedef uint32_t digit_t; // Unsigned 32-bit digit typedef uint32_t digit_t; // Unsigned 32-bit digit
typedef int32_t sdigit_t; // Signed 32-bit digit typedef int32_t sdigit_t; // Signed 32-bit digit
typedef uint16_t hdigit_t; // Unsigned 16-bit digit typedef uint16_t hdigit_t; // Unsigned 16-bit digit
#define NWORDS_FIELD 24 #define NWORDS_FIELD 24
#define p751_ZERO_WORDS 11 #define p751_ZERO_WORDS 11
#elif defined(_ARM_) #elif defined(_ARM_)
#define TARGET TARGET_ARM #define TARGET TARGET_ARM
#define RADIX 32 #define RADIX 32
#define LOG2RADIX 5 #define LOG2RADIX 5
typedef uint32_t digit_t; // Unsigned 32-bit digit typedef uint32_t digit_t; // Unsigned 32-bit digit
typedef int32_t sdigit_t; // Signed 32-bit digit typedef int32_t sdigit_t; // Signed 32-bit digit
typedef uint16_t hdigit_t; // Unsigned 16-bit digit typedef uint16_t hdigit_t; // Unsigned 16-bit digit
#define NWORDS_FIELD 24 #define NWORDS_FIELD 24
#define p751_ZERO_WORDS 11 #define p751_ZERO_WORDS 11
#elif defined(_ARM64_) #elif defined(_ARM64_)
#define TARGET TARGET_ARM64 #define TARGET TARGET_ARM64
#define RADIX 64 #define RADIX 64
#define LOG2RADIX 6 #define LOG2RADIX 6
typedef uint64_t digit_t; // Unsigned 64-bit digit typedef uint64_t digit_t; // Unsigned 64-bit digit
typedef int64_t sdigit_t; // Signed 64-bit digit typedef int64_t sdigit_t; // Signed 64-bit digit
typedef uint32_t hdigit_t; typedef uint32_t hdigit_t;
#define NWORDS_FIELD 12 #define NWORDS_FIELD 12
#define p751_ZERO_WORDS 5 #define p751_ZERO_WORDS 5
#else #else
#error -- "Unsupported ARCHITECTURE" #error -- "Unsupported ARCHITECTURE"
#endif #endif
#define RADIX64 #define RADIX64
// Instruction support // Instruction support
#define NO_SIMD_SUPPORT 0 #define NO_SIMD_SUPPORT 0
#define AVX_SUPPORT 1 #define AVX_SUPPORT 1
#define AVX2_SUPPORT 2 #define AVX2_SUPPORT 2
#if defined(__AVX2__) #if defined(__AVX2__)
#define SIMD_SUPPORT AVX2_SUPPORT // AVX2 support selection #define SIMD_SUPPORT AVX2_SUPPORT // AVX2 support selection
#elif defined(__AVX__) #elif defined(__AVX__)
#define SIMD_SUPPORT AVX_SUPPORT // AVX support selection #define SIMD_SUPPORT AVX_SUPPORT // AVX support selection
#else #else
#define SIMD_SUPPORT NO_SIMD_SUPPORT #define SIMD_SUPPORT NO_SIMD_SUPPORT
#endif #endif
#if defined(__ASM__) // Assembly support selection #if defined(__ASM__) // Assembly support selection
#define ASM_SUPPORT #define ASM_SUPPORT
#endif #endif
#if (SIMD_SUPPORT == NO_SIMD_SUPPORT) // Selection of generic, portable implementation #if (SIMD_SUPPORT == NO_SIMD_SUPPORT) // Selection of generic, portable implementation
#define GENERIC_IMPLEMENTATION #define GENERIC_IMPLEMENTATION
#endif #endif
// Unsupported configurations // Unsupported configurations
#if defined(ASM_SUPPORT) && (OS_TARGET == OS_WIN) #if defined(ASM_SUPPORT) && (OS_TARGET == OS_WIN)
#error -- "Assembly is not supported on this platform" #error -- "Assembly is not supported on this platform"
#endif #endif
#if defined(ASM_SUPPORT) && defined(GENERIC_IMPLEMENTATION) #if defined(ASM_SUPPORT) && defined(GENERIC_IMPLEMENTATION)
#error -- "Unsupported configuration" #error -- "Unsupported configuration"
#endif #endif
#if (SIMD_SUPPORT != NO_SIMD_SUPPORT) && defined(GENERIC_IMPLEMENTATION) #if (SIMD_SUPPORT != NO_SIMD_SUPPORT) && defined(GENERIC_IMPLEMENTATION)
#error -- "Unsupported configuration" #error -- "Unsupported configuration"
#endif #endif
#if (TARGET != TARGET_AMD64) && !defined(GENERIC_IMPLEMENTATION) #if (TARGET != TARGET_AMD64) && !defined(GENERIC_IMPLEMENTATION)
#error -- "Unsupported configuration" #error -- "Unsupported configuration"
#endif #endif
#if (OS_TARGET == OS_LINUX) && defined(ASM_SUPPORT) && (SIMD_SUPPORT != AVX2_SUPPORT) #if (OS_TARGET == OS_LINUX) && defined(ASM_SUPPORT) && (SIMD_SUPPORT != AVX2_SUPPORT)
#error -- "Unsupported configuration" #error -- "Unsupported configuration"
#endif #endif
// Definitions of the error-handling type and error codes // Definitions of the error-handling type and error codes
/*typedef enum { /*typedef enum {
CRYPTO_MSRLN_SUCCESS, // 0x00 CRYPTO_MSRLN_SUCCESS, // 0x00
CRYPTO_MSRLN_ERROR, // 0x01 CRYPTO_MSRLN_ERROR, // 0x01
CRYPTO_MSRLN_ERROR_DURING_TEST, // 0x02 CRYPTO_MSRLN_ERROR_DURING_TEST, // 0x02
CRYPTO_MSRLN_ERROR_UNKNOWN, // 0x03 CRYPTO_MSRLN_ERROR_UNKNOWN, // 0x03
CRYPTO_MSRLN_ERROR_NOT_IMPLEMENTED, // 0x04 CRYPTO_MSRLN_ERROR_NOT_IMPLEMENTED, // 0x04
CRYPTO_MSRLN_ERROR_NO_MEMORY, // 0x05 CRYPTO_MSRLN_ERROR_NO_MEMORY, // 0x05
CRYPTO_MSRLN_ERROR_INVALID_PARAMETER, // 0x06 CRYPTO_MSRLN_ERROR_INVALID_PARAMETER, // 0x06
CRYPTO_MSRLN_ERROR_SHARED_KEY, // 0x07 CRYPTO_MSRLN_ERROR_SHARED_KEY, // 0x07
CRYPTO_MSRLN_ERROR_TOO_MANY_ITERATIONS, // 0x08 CRYPTO_MSRLN_ERROR_TOO_MANY_ITERATIONS, // 0x08
CRYPTO_MSRLN_ERROR_END_OF_LIST CRYPTO_MSRLN_ERROR_END_OF_LIST
} CRYPTO_MSRLN_STATUS; } CRYPTO_MSRLN_STATUS;
#define CRYPTO_STATUS_TYPE_SIZE (CRYPTO_ERROR_END_OF_LIST) #define CRYPTO_STATUS_TYPE_SIZE (CRYPTO_ERROR_END_OF_LIST)
// Definitions of the error messages // Definitions of the error messages
// NOTE: they must match the error codes above // NOTE: they must match the error codes above
#define CRYPTO_MSG_SUCCESS "CRYPTO_SUCCESS" #define CRYPTO_MSG_SUCCESS "CRYPTO_SUCCESS"
#define CRYPTO_MSG_ERROR "CRYPTO_ERROR" #define CRYPTO_MSG_ERROR "CRYPTO_ERROR"
#define CRYPTO_MSG_ERROR_DURING_TEST "CRYPTO_ERROR_DURING_TEST" #define CRYPTO_MSG_ERROR_DURING_TEST "CRYPTO_ERROR_DURING_TEST"
#define CRYPTO_MSG_ERROR_UNKNOWN "CRYPTO_ERROR_UNKNOWN" #define CRYPTO_MSG_ERROR_UNKNOWN "CRYPTO_ERROR_UNKNOWN"
#define CRYPTO_MSG_ERROR_NOT_IMPLEMENTED "CRYPTO_ERROR_NOT_IMPLEMENTED" #define CRYPTO_MSG_ERROR_NOT_IMPLEMENTED "CRYPTO_ERROR_NOT_IMPLEMENTED"
#define CRYPTO_MSG_ERROR_NO_MEMORY "CRYPTO_ERROR_NO_MEMORY" #define CRYPTO_MSG_ERROR_NO_MEMORY "CRYPTO_ERROR_NO_MEMORY"
#define CRYPTO_MSG_ERROR_INVALID_PARAMETER "CRYPTO_ERROR_INVALID_PARAMETER" #define CRYPTO_MSG_ERROR_INVALID_PARAMETER "CRYPTO_ERROR_INVALID_PARAMETER"
#define CRYPTO_MSG_ERROR_SHARED_KEY "CRYPTO_ERROR_SHARED_KEY" #define CRYPTO_MSG_ERROR_SHARED_KEY "CRYPTO_ERROR_SHARED_KEY"
#define CRYPTO_MSG_ERROR_TOO_MANY_ITERATIONS "CRYPTO_ERROR_TOO_MANY_ITERATIONS" #define CRYPTO_MSG_ERROR_TOO_MANY_ITERATIONS "CRYPTO_ERROR_TOO_MANY_ITERATIONS"
*/ */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif
/* /*
* Authors: * Authors:
* Dmitriy A. Gearasimov <kahovski@gmail.com> * Dmitriy A. Gearasimov <kahovski@gmail.com>
* Anatolii Kurotych <akurotych@gmail.com> * Anatolii Kurotych <akurotych@gmail.com>
* DeM Labs Inc. https://demlabs.net * DeM Labs Inc. https://demlabs.net
* DeM Labs Open source community https://github.com/demlabsinc * DeM Labs Open source community https://github.com/demlabsinc
* Copyright (c) 2017-2019 * Copyright (c) 2017-2019
* All rights reserved. * All rights reserved.
This file is part of DAP (Deus Applications Prototypes) the open source project This file is part of DAP (Deus Applications Prototypes) the open source project
DAP (Deus Applicaions Prototypes) is free software: you can redistribute it and/or modify DAP (Deus Applicaions Prototypes) is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
DAP is distributed in the hope that it will be useful, DAP is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with any DAP based project. If not, see <http://www.gnu.org/licenses/>. along with any DAP based project. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef _DAP_ENC_H_ #ifndef _DAP_ENC_H_
#define _DAP_ENC_H_ #define _DAP_ENC_H_
#include <stddef.h> #include <stddef.h>
#include <stdbool.h> #include <stdbool.h>
#include "dap_enc_key.h" #include "dap_enc_key.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
int dap_enc_init(void); int dap_enc_init(void);
void dap_enc_deinit(void); void dap_enc_deinit(void);
// if include_base64 == true. Calc out size with base64 encoding // if include_base64 == true. Calc out size with base64 encoding
size_t dap_enc_code_out_size(dap_enc_key_t* a_key, const size_t a_buf_in_size, dap_enc_data_type_t type); size_t dap_enc_code_out_size(dap_enc_key_t* a_key, const size_t a_buf_in_size, dap_enc_data_type_t type);
size_t dap_enc_decode_out_size(dap_enc_key_t* a_key, const size_t a_buf_in_size, dap_enc_data_type_t type); size_t dap_enc_decode_out_size(dap_enc_key_t* a_key, const size_t a_buf_in_size, dap_enc_data_type_t type);
size_t dap_enc_code(struct dap_enc_key * a_key, // Key size_t dap_enc_code(struct dap_enc_key * a_key, // Key
const void * a_buf_in, const size_t a_buf_in_size, // Input const void * a_buf_in, const size_t a_buf_in_size, // Input
void * a_buf_out, const size_t a_buf_out_size_max, // Output void * a_buf_out, const size_t a_buf_out_size_max, // Output
dap_enc_data_type_t a_data_type_out); // Output data type dap_enc_data_type_t a_data_type_out); // Output data type
size_t dap_enc_decode(struct dap_enc_key * a_key, // Key size_t dap_enc_decode(struct dap_enc_key * a_key, // Key
const void * a_buf_in, const size_t a_buf_in_size, // Input const void * a_buf_in, const size_t a_buf_in_size, // Input
void * a_buf_out, const size_t a_buf_out_size_max, // Output void * a_buf_out, const size_t a_buf_out_size_max, // Output
dap_enc_data_type_t a_data_type_in); // Output data type dap_enc_data_type_t a_data_type_in); // Output data type
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif
#ifndef _DAP_ENC_GOST_H_
#define _DAP_ENC_GOST_H_
#include <stddef.h>
#include "dap_enc_key.h"
#include "GOST/block_chipher.h"
#ifdef __cplusplus
extern "C" {
#endif
void dap_enc_gost_key_delete(struct dap_enc_key *a_key);
void dap_enc_gost_key_generate(struct dap_enc_key * a_key, const void *kex_buf,
size_t kex_size, const void * seed, size_t seed_size, size_t key_size);
//------GOST_OFB---------
void dap_enc_gost_ofb_key_new(struct dap_enc_key * a_key);
size_t dap_enc_gost_ofb_calc_decode_size(const size_t size_in);
size_t dap_enc_gost_ofb_calc_encode_size(const size_t size_in);
size_t dap_enc_gost_ofb_decrypt(struct dap_enc_key * a_key, const void * a_in, size_t a_in_size, void ** a_out);
size_t dap_enc_gost_ofb_encrypt(struct dap_enc_key * a_key, const void * a_in, size_t a_in_size, void ** a_out);
// Writes result ( out ) in already allocated buffer
size_t dap_enc_gost_ofb_decrypt_fast(struct dap_enc_key * a_key, const void * a_in,
size_t a_in_size, void * buf_out, size_t buf_out_size);
// Writes result ( out ) in already allocated buffer
size_t dap_enc_gost_ofb_encrypt_fast(struct dap_enc_key * a_key, const void * a_in,
size_t a_in_size, void * buf_out, size_t buf_out_size);
//------KUZNECHIK_OFB--------------
void dap_enc_kuzn_ofb_key_new(struct dap_enc_key * a_key);
size_t dap_enc_kuzn_ofb_calc_decode_size(const size_t size_in);
size_t dap_enc_kuzn_ofb_calc_encode_size(const size_t size_in);
size_t dap_enc_kuzn_ofb_decrypt(struct dap_enc_key * a_key, const void * a_in, size_t a_in_size, void ** a_out);
size_t dap_enc_kuzn_ofb_encrypt(struct dap_enc_key * a_key, const void * a_in, size_t a_in_size, void ** a_out);
// Writes result ( out ) in already allocated buffer
size_t dap_enc_kuzn_ofb_decrypt_fast(struct dap_enc_key * a_key, const void * a_in,
size_t a_in_size, void * buf_out, size_t buf_out_size);
// Writes result ( out ) in already allocated buffer
size_t dap_enc_kuzn_ofb_encrypt_fast(struct dap_enc_key * a_key, const void * a_in,
size_t a_in_size, void * buf_out, size_t buf_out_size);
#ifdef __cplusplus
}
#endif
#endif
/* /*
* Authors: * Authors:
* Dmitriy A. Gearasimov <kahovski@gmail.com> * Dmitriy A. Gearasimov <kahovski@gmail.com>
* DeM Labs Inc. https://demlabs.net * DeM Labs Inc. https://demlabs.net
* Kelvin Blockchain community https://github.com/kelvinblockchain * CellFrame https://cellframe.net
* Copyright (c) 2017-2019 * Copyright (c) 2017-2019
* All rights reserved. * All rights reserved.
This file is part of DAP (Deus Applications Prototypes) the open source project This file is part of DAP (Deus Applications Prototypes) the open source project
DAP (Deus Applicaions Prototypes) is free software: you can redistribute it and/or modify DAP (Deus Applicaions Prototypes) is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
DAP is distributed in the hope that it will be useful, DAP is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with any DAP based project. If not, see <http://www.gnu.org/licenses/>. along with any DAP based project. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef _DAP_ENC_BASE64_H_ #ifndef _DAP_ENC_BASE58_H_
#define _DAP_ENC_BASE64_H_ #define _DAP_ENC_BASE58_H_
#include <stddef.h> #include <stddef.h>
#include <stdint.h> #include <stdint.h>
#include "dap_enc_key.h" #include "dap_enc_key.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/* /*
* Calculates encode size from input size * Calculates encode size from input size
*/ */
#define DAP_ENC_BASE58_ENCODE_SIZE(a_in_size) ( (size_t) ((137 * a_in_size / 100)+2)) #define DAP_ENC_BASE58_ENCODE_SIZE(a_in_size) ( (size_t) ((137 * a_in_size / 100)+2))
#define DAP_ENC_BASE58_DECODE_SIZE(a_in_size) ( (size_t) ( 2 * a_in_size +1) ) #define DAP_ENC_BASE58_DECODE_SIZE(a_in_size) ( (size_t) ( 2 * a_in_size +1) )
size_t dap_enc_base58_encode(const void * a_in, size_t a_in_size, char * a_out); size_t dap_enc_base58_encode(const void * a_in, size_t a_in_size, char * a_out);
size_t dap_enc_base58_decode(const char * a_in, void * a_out); size_t dap_enc_base58_decode(const char * a_in, void * a_out);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif
/* /*
* Authors: * Authors:
* Dmitriy A. Gearasimov <kahovski@gmail.com> * Dmitriy A. Gearasimov <kahovski@gmail.com>
* Anatolii Kurotych <akurotych@gmail.com> * Anatolii Kurotych <akurotych@gmail.com>
* DeM Labs Inc. https://demlabs.net * DeM Labs Inc. https://demlabs.net
* DeM Labs Open source community https://github.com/demlabsinc * DeM Labs Open source community https://github.com/demlabsinc
* Copyright (c) 2017-2019 * Copyright (c) 2017-2019
* All rights reserved. * All rights reserved.
This file is part of DAP (Deus Applications Prototypes) the open source project This file is part of DAP (Deus Applications Prototypes) the open source project
DAP (Deus Applicaions Prototypes) is free software: you can redistribute it and/or modify DAP (Deus Applicaions Prototypes) is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
DAP is distributed in the hope that it will be useful, DAP is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with any DAP based project. If not, see <http://www.gnu.org/licenses/>. along with any DAP based project. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef _DAP_ENC_BASE64_H_ #ifndef _DAP_ENC_BASE64_H_
#define _DAP_ENC_BASE64_H_ #define _DAP_ENC_BASE64_H_
#include <stddef.h> #include <stddef.h>
#include "dap_enc_key.h" #include "dap_enc_key.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/* /*
* Calculates encode size from input size * Calculates encode size from input size
*/ */
#define DAP_ENC_BASE64_ENCODE_SIZE(in_size) (size_t)(((4 * in_size / 3) + 3) & ~3) #define DAP_ENC_BASE64_ENCODE_SIZE(in_size) (size_t)(((4 * in_size / 3) + 3) & ~3)
size_t dap_enc_base64_decode(const char * in, size_t in_size, void * out, dap_enc_data_type_t standard); size_t dap_enc_base64_decode(const char * in, size_t in_size, void * out, dap_enc_data_type_t standard);
size_t dap_enc_base64_encode(const void * in, size_t in_size, char * out, dap_enc_data_type_t standard); size_t dap_enc_base64_encode(const void * in, size_t in_size, char * out, dap_enc_data_type_t standard);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif
#ifndef _DAP_ENC_BF_H_
#define _DAP_ENC_BF_H_
#include <stddef.h>
#include "dap_enc_key.h"
#include"blowfish/blowfish.h"
#ifdef __cplusplus
extern "C" {
#endif
void dap_enc_bf_key_delete(struct dap_enc_key *a_key);
void dap_enc_bf_key_generate(struct dap_enc_key * a_key, const void *kex_buf,
size_t kex_size, const void * seed, size_t seed_size, size_t key_size);
//-----CBC----------
void dap_enc_bf_cbc_key_new(struct dap_enc_key * a_key);
size_t dap_enc_bf_cbc_calc_decode_size(const size_t size_in);
size_t dap_enc_bf_cbc_calc_encode_size(const size_t size_in);
size_t dap_enc_bf_cbc_decrypt(struct dap_enc_key * a_key, const void * a_in, size_t a_in_size, void ** a_out);
size_t dap_enc_bf_cbc_encrypt(struct dap_enc_key * a_key, const void * a_in, size_t a_in_size, void ** a_out);
// Writes result ( out ) in already allocated buffer
size_t dap_enc_bf_cbc_decrypt_fast(struct dap_enc_key * a_key, const void * a_in,
size_t a_in_size, void * buf_out, size_t buf_out_size);
// Writes result ( out ) in already allocated buffer
size_t dap_enc_bf_cbc_encrypt_fast(struct dap_enc_key * a_key, const void * a_in,
size_t a_in_size, void * buf_out, size_t buf_out_size);
//------OFB---------
void dap_enc_bf_ofb_key_new(struct dap_enc_key * a_key);
size_t dap_enc_bf_ofb_calc_decode_size(const size_t size_in);
size_t dap_enc_bf_ofb_calc_encode_size(const size_t size_in);
size_t dap_enc_bf_ofb_decrypt(struct dap_enc_key * a_key, const void * a_in, size_t a_in_size, void ** a_out);
size_t dap_enc_bf_ofb_encrypt(struct dap_enc_key * a_key, const void * a_in, size_t a_in_size, void ** a_out);
// Writes result ( out ) in already allocated buffer
size_t dap_enc_bf_ofb_decrypt_fast(struct dap_enc_key * a_key, const void * a_in,
size_t a_in_size, void * buf_out, size_t buf_out_size);
// Writes result ( out ) in already allocated buffer
size_t dap_enc_bf_ofb_encrypt_fast(struct dap_enc_key * a_key, const void * a_in,
size_t a_in_size, void * buf_out, size_t buf_out_size);
#ifdef __cplusplus
}
#endif
#endif
#pragma once #pragma once
#include "sig_bliss/bliss_b_params.h" #include "sig_bliss/bliss_b_params.h"
#include "dap_enc_key.h" #include "dap_enc_key.h"
enum DAP_BLISS_SIGN_SECURITY { enum DAP_BLISS_SIGN_SECURITY {
TOY = 0, MAX_SPEED, MIN_SIZE, SPEED_AND_SECURITY, MAX_SECURITY TOY = 0, MAX_SPEED, MIN_SIZE, SPEED_AND_SECURITY, MAX_SECURITY
}; };
void dap_enc_sig_bliss_set_type(enum DAP_BLISS_SIGN_SECURITY type); void dap_enc_sig_bliss_set_type(enum DAP_BLISS_SIGN_SECURITY type);
void dap_enc_sig_bliss_key_new(struct dap_enc_key *key); void dap_enc_sig_bliss_key_new(struct dap_enc_key *key);
void dap_enc_sig_bliss_key_new_generate(struct dap_enc_key * key, const void *kex_buf, void dap_enc_sig_bliss_key_new_generate(struct dap_enc_key * key, const void *kex_buf,
size_t kex_size, const void * seed, size_t seed_size, size_t kex_size, const void * seed, size_t seed_size,
size_t key_size); size_t key_size);
int dap_enc_sig_bliss_get_sign(struct dap_enc_key * key,const void * msg, int dap_enc_sig_bliss_get_sign(struct dap_enc_key * key,const void * msg,
const size_t msg_size, void * signature, const size_t signature_size); const size_t msg_size, void * signature, const size_t signature_size);
int dap_enc_sig_bliss_verify_sign(struct dap_enc_key * key,const void * msg, int dap_enc_sig_bliss_verify_sign(struct dap_enc_key * key,const void * msg,
const size_t msg_size, void * signature, const size_t signature_size); const size_t msg_size, void * signature, const size_t signature_size);
void dap_enc_sig_bliss_key_delete(struct dap_enc_key *key); void dap_enc_sig_bliss_key_delete(struct dap_enc_key *key);
size_t dap_enc_sig_bliss_key_pub_output_size(struct dap_enc_key *l_key); size_t dap_enc_sig_bliss_key_pub_output_size(struct dap_enc_key *l_key);
int dap_enc_sig_bliss_key_pub_output(struct dap_enc_key *l_key, void * l_output); int dap_enc_sig_bliss_key_pub_output(struct dap_enc_key *l_key, void * l_output);
uint8_t* dap_enc_sig_bliss_write_signature(bliss_signature_t* a_sign, size_t *a_sign_out); uint8_t* dap_enc_sig_bliss_write_signature(bliss_signature_t* a_sign, size_t *a_sign_out);
bliss_signature_t* dap_enc_sig_bliss_read_signature(uint8_t *a_buf, size_t a_buflen); bliss_signature_t* dap_enc_sig_bliss_read_signature(const uint8_t *a_buf, size_t a_buflen);
uint8_t* dap_enc_sig_bliss_write_private_key(const bliss_private_key_t* a_private_key, size_t *a_buflen_out); uint8_t* dap_enc_sig_bliss_write_private_key(const bliss_private_key_t* a_private_key, size_t *a_buflen_out);
uint8_t* dap_enc_sig_bliss_write_public_key(const bliss_public_key_t* a_public_key, size_t *a_buflen_out); uint8_t* dap_enc_sig_bliss_write_public_key(const bliss_public_key_t* a_public_key, size_t *a_buflen_out);
bliss_private_key_t* dap_enc_sig_bliss_read_private_key(uint8_t *a_buf, size_t a_buflen); bliss_private_key_t* dap_enc_sig_bliss_read_private_key(const uint8_t *a_buf, size_t a_buflen);
bliss_public_key_t* dap_enc_sig_bliss_read_public_key(const uint8_t *a_buf, size_t a_buflen); bliss_public_key_t* dap_enc_sig_bliss_read_public_key(const uint8_t *a_buf, size_t a_buflen);
#pragma once #pragma once
typedef struct dap_enc_ca { typedef struct dap_enc_ca {
} dap_enc_ca_t; } dap_enc_ca_t;
#ifndef _DAP_ENC_DEFEO_H_ #ifndef _DAP_ENC_DEFEO_H_
#define _DAP_ENC_DEFEO_H_ #define _DAP_ENC_DEFEO_H_
#include <stdint.h> #include <stdint.h>
#include <string.h> #include <string.h>
#include <stdbool.h> #include <stdbool.h>
#include "dap_common.h" #include "dap_common.h"
#include "dap_enc_key.h" #include "dap_enc_key.h"
struct dap_enc_key; struct dap_enc_key;
typedef struct dap_enc_defeo_key{ typedef struct dap_enc_defeo_key{
unsigned int alice_msg_len; unsigned int alice_msg_len;
unsigned int bob_msg_len; unsigned int bob_msg_len;
unsigned int key_len; unsigned int key_len;
uint16_t estimated_classical_security; uint16_t estimated_classical_security;
uint16_t estimated_quantum_security; uint16_t estimated_quantum_security;
} dap_enc_defeo_key_t; } dap_enc_defeo_key_t;
#define LOG_TAG "dap_enc_defeo" #define LOG_TAG "dap_enc_defeo"
#define DAP_ENC_DEFEO_KEY(a) ((dap_enc_defeo_key_t *)((a)->_inheritor)) #define DAP_ENC_DEFEO_KEY(a) ((dap_enc_defeo_key_t *)((a)->_inheritor))
void dap_enc_defeo_key_new(struct dap_enc_key* a_key); void dap_enc_defeo_key_new(struct dap_enc_key* a_key);
void dap_enc_defeo_key_new_generate(struct dap_enc_key * a_key, const void *kex_buf, void dap_enc_defeo_key_new_generate(struct dap_enc_key * a_key, const void *kex_buf,
size_t kex_size, const void * seed, size_t seed_size, size_t kex_size, const void * seed, size_t seed_size,
size_t key_size); size_t key_size);
void dap_enc_defeo_key_new_from_data(struct dap_enc_key* a_key, void **a_priv, size_t a_in_size); void dap_enc_defeo_key_new_from_data(struct dap_enc_key* a_key, void **a_priv, size_t a_in_size);
void dap_enc_defeo_key_delete(struct dap_enc_key* a_key); void dap_enc_defeo_key_delete(struct dap_enc_key* a_key);
size_t dap_enc_defeo_gen_bob_shared_key(struct dap_enc_key* b_key, const void* a_pub, size_t a_pub_size, void **b_pub); size_t dap_enc_defeo_gen_bob_shared_key(struct dap_enc_key* b_key, const void* a_pub, size_t a_pub_size, void **b_pub);
size_t dap_enc_defeo_gen_alice_shared_key(struct dap_enc_key* a_key, const void* a_priv, size_t b_pub_size, unsigned char * b_pub); size_t dap_enc_defeo_gen_alice_shared_key(struct dap_enc_key* a_key, const void* a_priv, size_t b_pub_size, unsigned char * b_pub);
#endif #endif
#ifndef _DAP_ENC_DILITHIUM_H_ #ifndef _DAP_ENC_DILITHIUM_H_
#define _DAP_ENC_DILITHIUM_H_ #define _DAP_ENC_DILITHIUM_H_
#include "sig_dilithium/dilithium_params.h" #include "sig_dilithium/dilithium_params.h"
#include "dap_enc_key.h" #include "dap_enc_key.h"
enum DAP_DILITHIUM_SIGN_SECURITY { enum DAP_DILITHIUM_SIGN_SECURITY {
DILITHIUM_TOY = 0, DILITHIUM_MAX_SPEED, DILITHIUM_MIN_SIZE, DILITHIUM_MAX_SECURITY DILITHIUM_TOY = 0, DILITHIUM_MAX_SPEED, DILITHIUM_MIN_SIZE, DILITHIUM_MAX_SECURITY
}; };
void dap_enc_sig_dilithium_set_type(enum DAP_DILITHIUM_SIGN_SECURITY type); void dap_enc_sig_dilithium_set_type(enum DAP_DILITHIUM_SIGN_SECURITY type);
void dap_enc_sig_dilithium_key_new(struct dap_enc_key *key); void dap_enc_sig_dilithium_key_new(struct dap_enc_key *key);
void dap_enc_sig_dilithium_key_new_generate(struct dap_enc_key * key, const void *kex_buf, void dap_enc_sig_dilithium_key_new_generate(struct dap_enc_key * key, const void *kex_buf,
size_t kex_size, const void * seed, size_t seed_size, size_t kex_size, const void * seed, size_t seed_size,
size_t key_size); size_t key_size);
size_t dap_enc_sig_dilithium_get_sign(struct dap_enc_key * key,const void * msg, size_t dap_enc_sig_dilithium_get_sign(struct dap_enc_key * key,const void * msg,
const size_t msg_size, void * signature, const size_t signature_size); const size_t msg_size, void * signature, const size_t signature_size);
size_t dap_enc_sig_dilithium_verify_sign(struct dap_enc_key * key,const void * msg, size_t dap_enc_sig_dilithium_verify_sign(struct dap_enc_key * key,const void * msg,
const size_t msg_size, void * signature, const size_t signature_size); const size_t msg_size, void * signature, const size_t signature_size);
void dap_enc_sig_dilithium_key_delete(struct dap_enc_key * key); void dap_enc_sig_dilithium_key_delete(struct dap_enc_key * key);
size_t dap_enc_dilithium_calc_signature_size(void); size_t dap_enc_dilithium_calc_signature_unserialized_size(void);
uint8_t* dap_enc_dilithium_write_signature(dilithium_signature_t* a_sign, size_t *a_sign_out); static inline size_t dap_enc_dilithium_calc_signagture_size(dilithium_signature_t* a_sign)
dilithium_signature_t* dap_enc_dilithium_read_signature(uint8_t *a_buf, size_t a_buflen); {
uint8_t* dap_enc_dilithium_write_private_key(const dilithium_private_key_t* a_private_key, size_t *a_buflen_out); return sizeof(size_t) + sizeof(dilithium_kind_t) + a_sign->sig_len + sizeof(unsigned long long);
uint8_t* dap_enc_dilithium_write_public_key(const dilithium_public_key_t* a_public_key, size_t *a_buflen_out); }
dilithium_private_key_t* dap_enc_dilithium_read_private_key(const uint8_t *a_buf, size_t a_buflen);
dilithium_public_key_t* dap_enc_dilithium_read_public_key(const uint8_t *a_buf, size_t a_buflen); uint8_t* dap_enc_dilithium_write_signature(dilithium_signature_t* a_sign, size_t *a_sign_out);
dilithium_signature_t* dap_enc_dilithium_read_signature(uint8_t *a_buf, size_t a_buflen);
#endif uint8_t* dap_enc_dilithium_write_private_key(const dilithium_private_key_t* a_private_key, size_t *a_buflen_out);
uint8_t* dap_enc_dilithium_write_public_key(const dilithium_public_key_t* a_public_key, size_t *a_buflen_out);
dilithium_private_key_t* dap_enc_dilithium_read_private_key(const uint8_t *a_buf, size_t a_buflen);
dilithium_public_key_t* dap_enc_dilithium_read_public_key(const uint8_t *a_buf, size_t a_buflen);
#endif
#ifndef _DAP_ENC_AES_H_ #ifndef _DAP_ENC_AES_H_
#define _DAP_ENC_AES_H_ #define _DAP_ENC_AES_H_
#include <stddef.h> #include <stddef.h>
#include <stdint.h> #include <stdint.h>
#include "iaes/dap_iaes_proto.h" #include "iaes/dap_iaes_proto.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
struct dap_enc_key; struct dap_enc_key;
void dap_enc_aes_key_new(struct dap_enc_key * a_key); void dap_enc_aes_key_new(struct dap_enc_key * a_key);
void dap_enc_aes_key_delete(struct dap_enc_key *a_key); void dap_enc_aes_key_delete(struct dap_enc_key *a_key);
void dap_enc_aes_key_generate(struct dap_enc_key * a_key, const void *kex_buf, size_t kex_size, void dap_enc_aes_key_generate(struct dap_enc_key * a_key, const void *kex_buf, size_t kex_size,
const void * seed, size_t seed_size, size_t key_size); const void * seed, size_t seed_size, size_t key_size);
size_t dap_enc_iaes256_calc_decode_size(const size_t size_in); size_t dap_enc_iaes256_calc_decode_max_size(const size_t size_in);
size_t dap_enc_iaes256_calc_encode_size(const size_t size_in); size_t dap_enc_iaes256_calc_encode_size(const size_t size_in);
size_t dap_enc_iaes256_cbc_decrypt(struct dap_enc_key * a_key, const void * a_in, size_t a_in_size, void ** a_out); size_t dap_enc_iaes256_cbc_decrypt(struct dap_enc_key * a_key, const void * a_in, size_t a_in_size, void ** a_out);
size_t dap_enc_iaes256_cbc_encrypt(struct dap_enc_key * a_key, const void * a_in, size_t a_in_size, void ** a_out); size_t dap_enc_iaes256_cbc_encrypt(struct dap_enc_key * a_key, const void * a_in, size_t a_in_size, void ** a_out);
// Writes result ( out ) in already allocated buffer // Writes result ( out ) in already allocated buffer
size_t dap_enc_iaes256_cbc_decrypt_fast(struct dap_enc_key * a_key, const void * a_in, size_t dap_enc_iaes256_cbc_decrypt_fast(struct dap_enc_key * a_key, const void * a_in,
size_t a_in_size, void * buf_out, size_t buf_out_size); size_t a_in_size, void * buf_out, size_t buf_out_size);
// if "a_in size mod IAES_BLOCK_SIZE = 0" encryption will be faster // if "a_in size mod IAES_BLOCK_SIZE = 0" encryption will be faster
size_t dap_enc_iaes256_cbc_encrypt_fast(struct dap_enc_key * a_key, const void * a_in, size_t dap_enc_iaes256_cbc_encrypt_fast(struct dap_enc_key * a_key, const void * a_in,
size_t a_in_size, void * buf_out, size_t buf_out_size); size_t a_in_size, void * buf_out, size_t buf_out_size);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif
/* /*
* Authors: * Authors:
* Dmitriy A. Gearasimov <kahovski@gmail.com> * Dmitriy A. Gearasimov <kahovski@gmail.com>
* Anatolii Kurotych <akurotych@gmail.com> * Anatolii Kurotych <akurotych@gmail.com>
* DeM Labs Inc. https://demlabs.net * DeM Labs Inc. https://demlabs.net
* DeM Labs Open source community https://github.com/demlabsinc * DeM Labs Open source community https://github.com/demlabsinc
* Copyright (c) 2017-2019 * Copyright (c) 2017-2019
* All rights reserved. * All rights reserved.
This file is part of DAP (Deus Applications Prototypes) the open source project This file is part of DAP (Deus Applications Prototypes) the open source project
DAP (Deus Applicaions Prototypes) is free software: you can redistribute it and/or modify DAP (Deus Applicaions Prototypes) is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
DAP is distributed in the hope that it will be useful, DAP is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with any DAP based project. If not, see <http://www.gnu.org/licenses/>. along with any DAP based project. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef _DAP_ENC_KEY_H_ #ifndef _DAP_ENC_KEY_H_
#define _DAP_ENC_KEY_H_ #define _DAP_ENC_KEY_H_
#include <stddef.h> #include <stddef.h>
#include <time.h> #include <time.h>
#include <stdint.h> #include <stdint.h>
#include "dap_common.h"
#ifdef __cplusplus
extern "C" { typedef enum dap_enc_data_type{DAP_ENC_DATA_TYPE_RAW,
#endif
DAP_ENC_DATA_TYPE_B64,
typedef enum dap_enc_data_type{DAP_ENC_DATA_TYPE_RAW,
DAP_ENC_DATA_TYPE_B64_URLSAFE,
DAP_ENC_DATA_TYPE_B64,
} dap_enc_data_type_t;
DAP_ENC_DATA_TYPE_B64_URLSAFE,
} dap_enc_data_type_t;
typedef enum dap_enc_key_type{
typedef enum dap_enc_key_type{ DAP_ENC_KEY_TYPE_IAES, // Symmetric AES DAP_ENC_KEY_TYPE_IAES, // Symmetric AES
DAP_ENC_KEY_TYPE_OAES,// from https://github.com/monero-project/monero/tree/master/src/crypto
DAP_ENC_KEY_TYPE_OAES,// from https://github.com/monero-project/monero/tree/master/src/crypto
DAP_ENC_KEY_TYPE_BF_CBC,// BlowFish CBCmode
DAP_ENC_KEY_TYPE_RLWE_NEWHOPE, // "NewHope": key exchange from the ring learning with errors problem DAP_ENC_KEY_TYPE_BF_OFB,//BlowFish OFBmode
// (Alkim, Ducas, Pöppelmann, Schwabe, USENIX Security 2016 )
// Using the reference C implementation of NewHope DAP_ENC_KEY_TYPE_GOST_OFB,//GOST28147_89
// from https://github.com/tpoeppelmann/newhop DAP_ENC_KEY_TYPE_KUZN_OFB,//GOST28147_14
// https://eprint.iacr.org/2015/1092
DAP_ENC_KEY_TYPE_SALSA2012,//SALSA2012//http://www.ecrypt.eu.org/stream/salsa20pf.html//https://ianix.com/pub/salsa20-deployment.html
DAP_ENC_KEY_TYPE_SIDH_CLN16 , // Key exchange from the supersingular isogeny Diffie-Hellman problem
// (Costello, Naehrig, Longa, CRYPTO 2016, https://eprint.iacr.org/2016/413) DAP_ENC_KEY_TYPE_RLWE_NEWHOPE, // "NewHope": key exchange from the ring learning with errors problem
// using the implementation of Microsoft Research // (Alkim, Ducas, Pöppelmann, Schwabe, USENIX Security 2016 )
// https://www.microsoft.com/en-us/research/project/sidh-library/ // Using the reference C implementation of NewHope
DAP_ENC_KEY_TYPE_DEFEO , // Key exchange from the supersingular isogeny Diffie-Hellman problem // from https://github.com/tpoeppelmann/newhop
// https://eprint.iacr.org/2015/1092
DAP_ENC_KEY_TYPE_MSRLN,
DAP_ENC_KEY_TYPE_SIDH_CLN16 , // Key exchange from the supersingular isogeny Diffie-Hellman problem
DAP_ENC_KEY_TYPE_RLWE_MSRLN16, // (Costello, Naehrig, Longa, CRYPTO 2016, https://eprint.iacr.org/2016/413)
//DAP_ENC_KEY_TYPE_RLWE_MSRLN16, // Microsoft Research implementation of Peikert's ring-LWE key exchange // using the implementation of Microsoft Research
// (Longa, Naehrig, CANS 2016, https://eprint.iacr.org/2016/504) // https://www.microsoft.com/en-us/research/project/sidh-library/
// based on the implementation of Alkim, Ducas, Pöppelmann, and Schwabe, DAP_ENC_KEY_TYPE_DEFEO , // Key exchange from the supersingular isogeny Diffie-Hellman problem
// with improvements from Longa and Naehrig,
// https://www.microsoft.com/en-us/research/project/lattice-cryptography-library/ DAP_ENC_KEY_TYPE_MSRLN,
DAP_ENC_KEY_TYPE_RLWE_MSRLN16,
DAP_ENC_KEY_TYPE_RLWE_BCNS15, // key exchange from the ring learning with errors problem //DAP_ENC_KEY_TYPE_RLWE_MSRLN16, // Microsoft Research implementation of Peikert's ring-LWE key exchange
// (Bos, Costello, Naehrig, Stebila, // (Longa, Naehrig, CANS 2016, https://eprint.iacr.org/2016/504)
// IEEE Symposium on Security & Privacy 2015, // based on the implementation of Alkim, Ducas, Pöppelmann, and Schwabe,
// https://eprint.iacr.org/2014/599) // with improvements from Longa and Naehrig,
// https://www.microsoft.com/en-us/research/project/lattice-cryptography-library/
DAP_ENC_KEY_TYPE_LWE_FRODO , // "Frodo": key exchange from the learning with errors problem
// Bos, Costello, Ducas, Mironov, Naehrig, Nikolaenko, Raghunathan, Stebila
// ACM Conference on Computer and Communications Security 2016 DAP_ENC_KEY_TYPE_RLWE_BCNS15, // key exchange from the ring learning with errors problem
// https://eprint.iacr.org/2016/659 // (Bos, Costello, Naehrig, Stebila,
// IEEE Symposium on Security & Privacy 2015,
DAP_ENC_KEY_TYPE_SIDH_IQC_REF, // key exchange from the supersingular isogeny Diffie-Hellman problem // https://eprint.iacr.org/2014/599)
// (De Feo, Jao, Plût, J. Math. Cryptol. 8(3):209, 2014
// https://eprint.iacr.org/2011/506 DAP_ENC_KEY_TYPE_LWE_FRODO , // "Frodo": key exchange from the learning with errors problem
// // Bos, Costello, Ducas, Mironov, Naehrig, Nikolaenko, Raghunathan, Stebila
DAP_ENC_KEY_TYPE_CODE_MCBITS, // "McBits": key exchange from the error correcting codes, // ACM Conference on Computer and Communications Security 2016
// specifically Niederreiter's form of McEliece public key encryption // https://eprint.iacr.org/2016/659
// using hidden Goppa codes (Bernstein, Chou, Schwabe, CHES 2013, https://eprint.iacr.org/2015/610)
// using the implementation of McBits from https://www.win.tue.nl/~tchou/mcbits/ DAP_ENC_KEY_TYPE_SIDH_IQC_REF, // key exchange from the supersingular isogeny Diffie-Hellman problem
// (De Feo, Jao, Plût, J. Math. Cryptol. 8(3):209, 2014
DAP_ENC_KEY_TYPE_NTRU, // NTRU: key transport using NTRU public key encryption // https://eprint.iacr.org/2011/506
// (Hoffstein, Pipher, Silverman, ANTS 1998) with the EES743EP1 parameter set //
// wrapper around the implementation from the NTRU Open Source project DAP_ENC_KEY_TYPE_CODE_MCBITS, // "McBits": key exchange from the error correcting codes,
// https://github.com/NTRUOpenSourceProject/NTRUEncrypt) // specifically Niederreiter's form of McEliece public key encryption
// using hidden Goppa codes (Bernstein, Chou, Schwabe, CHES 2013, https://eprint.iacr.org/2015/610)
DAP_ENC_KEY_TYPE_MLWE_KYBER, // Kyber: a CCA-secure module-lattice-based key exchange mechanism // using the implementation of McBits from https://www.win.tue.nl/~tchou/mcbits/
// (Bos, Ducas, Kiltz, Lepoint, Lyubashevsky, Schwabe, Shanck, Stehlé)
// Real World Crypto 2017, https://eprint.iacr.org/2017/634) DAP_ENC_KEY_TYPE_NTRU, // NTRU: key transport using NTRU public key encryption
// using the reference C implementation of Kyber from pq-crystals/kyber // (Hoffstein, Pipher, Silverman, ANTS 1998) with the EES743EP1 parameter set
DAP_ENC_KEY_TYPE_SIG_PICNIC, // signature based on zero-knowledge proof as specified in // wrapper around the implementation from the NTRU Open Source project
// Post-Quantum Zero-Knowledge and Signatures from Symmetric-Key Primitives // https://github.com/NTRUOpenSourceProject/NTRUEncrypt)
// (Melissa Chase and David Derler and Steven Goldfeder and Claudio Orlandi
// and Sebastian Ramacher and Christian Rechberger and Daniel Slamanig and Greg Zaverucha DAP_ENC_KEY_TYPE_MLWE_KYBER, // Kyber: a CCA-secure module-lattice-based key exchange mechanism
// https://eprint.iacr.org/2017/279.pdf), using the optimized implemenation // (Bos, Ducas, Kiltz, Lepoint, Lyubashevsky, Schwabe, Shanck, Stehlé)
// from https://github.com/IAIK/Picnic // Real World Crypto 2017, https://eprint.iacr.org/2017/634)
DAP_ENC_KEY_TYPE_SIG_BLISS, // signature based on zero-knowledge proof as specified in // using the reference C implementation of Kyber from pq-crystals/kyber
// Post-Quantum Zero-Knowledge and Signatures from Symmetric-Key Primitives DAP_ENC_KEY_TYPE_SIG_PICNIC, // signature based on zero-knowledge proof as specified in
// Post-Quantum Zero-Knowledge and Signatures from Symmetric-Key Primitives
DAP_ENC_KEY_TYPE_SIG_TESLA, // signature based on Ring_LWE problem with zero-knowledge proof as specified in // (Melissa Chase and David Derler and Steven Goldfeder and Claudio Orlandi
// Post-Quantum Zero-Knowledge and Signatures from Symmetric-Key Primitives // and Sebastian Ramacher and Christian Rechberger and Daniel Slamanig and Greg Zaverucha
// https://eprint.iacr.org/2017/279.pdf), using the optimized implemenation
DAP_ENC_KEY_TYPE_SIG_DILITHIUM, // from https://github.com/IAIK/Picnic
DAP_ENC_KEY_TYPE_SIG_BLISS, // signature based on zero-knowledge proof as specified in
DAP_ENC_KEY_TYPE_NULL = 0 // Post-Quantum Zero-Knowledge and Signatures from Symmetric-Key Primitives
} dap_enc_key_type_t; DAP_ENC_KEY_TYPE_SIG_TESLA, // signature based on Ring_LWE problem with zero-knowledge proof as specified in
// Post-Quantum Zero-Knowledge and Signatures from Symmetric-Key Primitives
struct dap_enc_key;
DAP_ENC_KEY_TYPE_SIG_DILITHIUM,
// allocates memory and sets callbacks
typedef void (*dap_enc_callback_new)(struct dap_enc_key*); DAP_ENC_KEY_TYPE_SIG_RINGCT20,//ring signature for confidentional transaction
// generates key data from seed DAP_ENC_KEY_TYPE_NULL = 0
typedef void (*dap_enc_callback_new_generate)(struct dap_enc_key* key, const void *kex_buf,
size_t kex_size, const void* seed, size_t seed_size, } dap_enc_key_type_t;
size_t key_size);
// free memory struct dap_enc_key;
typedef void (*dap_enc_callback_delete)(struct dap_enc_key*);
// allocates memory and sets callbacks
typedef size_t (*dap_enc_callback_key_size_t)(struct dap_enc_key*); typedef void (*dap_enc_callback_new)(struct dap_enc_key*);
// encrypt and decrypt functions. Allocates Memory for out // generates key data from seed
typedef size_t (*dap_enc_callback_dataop_t)(struct dap_enc_key *key, const void *in, typedef void (*dap_enc_callback_new_generate)(struct dap_enc_key* key, const void *kex_buf,
const size_t in_size,void ** out); size_t kex_size, const void* seed, size_t seed_size,
size_t key_size);
typedef size_t (*dap_enc_callback_dataop_na_t)(struct dap_enc_key *key, const void *in, // free memory
const size_t in_size,void * out, const size_t out_size_max); typedef void (*dap_enc_callback_delete)(struct dap_enc_key*);
typedef int (*dap_enc_callback_sign_op_t)(struct dap_enc_key *key, const void *in, typedef size_t (*dap_enc_callback_key_size_t)(struct dap_enc_key*);
const size_t in_size,void * out, const size_t out_size_max);
// encrypt and decrypt functions. Allocates Memory for out
// key pair generation and generation of shared key at Bob's side typedef size_t (*dap_enc_callback_dataop_t)(struct dap_enc_key *key, const void *in,
// INPUT: const size_t in_size,void ** out);
// dap_enc_key *b_key
// a_pub --- Alice's public key typedef size_t (*dap_enc_callback_dataop_na_t)(struct dap_enc_key *key, const void *in,
// a_pub_size --- Alice's public key length const size_t in_size,void * out, const size_t out_size_max);
// OUTPUT: typedef size_t (*dap_enc_callback_dataop_na_ext_t)(struct dap_enc_key *key, const void *in,
// b_pub --- Bob's public key const size_t in_size,void * out, const size_t out_size_max, const void *extra_param, const int extra_param_len);
// b_key->priv_key_data --- shared key
// b_key->priv_key_data_size --- shared key length typedef int (*dap_enc_callback_sign_op_t)(struct dap_enc_key *key, const void *in,
typedef size_t (*dap_enc_gen_bob_shared_key) (struct dap_enc_key *b_key, const void *a_pub, const size_t in_size,void * out, const size_t out_size_max);
size_t a_pub_size, void ** b_pub);
// key pair generation and generation of shared key at Bob's side
// generation of shared key at Alice's side // INPUT:
// INPUT: // dap_enc_key *b_key
// dap_enc_key *a_key // a_pub --- Alice's public key
// a_priv --- Alice's private key // a_pub_size --- Alice's public key length
// b_pub --- Bob's public key // OUTPUT:
// b_pub_size --- Bob public key size // b_pub --- Bob's public key
// OUTPUT: // b_key->priv_key_data --- shared key
// a_key->priv_key_data --- shared key // b_key->priv_key_data_size --- shared key length
// a_key->priv_key_data_size --- shared key length typedef size_t (*dap_enc_gen_bob_shared_key) (struct dap_enc_key *b_key, const void *a_pub,
typedef size_t (*dap_enc_gen_alice_shared_key) (struct dap_enc_key *a_key, const void *a_priv, size_t a_pub_size, void ** b_pub);
size_t b_pub_size, unsigned char *b_pub);
// generation of shared key at Alice's side
typedef int (*dap_enc_callback_gen_key_public_t ) (struct dap_enc_key *l_key, void * l_output); // INPUT:
// dap_enc_key *a_key
typedef void (*dap_enc_callback_ptr_t)(struct dap_enc_key *, void *); // a_priv --- Alice's private key
typedef size_t (*dap_enc_callback_pptr_r_size_t)(struct dap_enc_key *, void **); // b_pub --- Bob's public key
typedef void (*dap_enc_callback_data_t)(struct dap_enc_key *, const void * , size_t); // b_pub_size --- Bob public key size
typedef void (*dap_enc_callback_size_t)(struct dap_enc_key *, size_t); // OUTPUT:
typedef void (*dap_enc_callback_str_t)(struct dap_enc_key *, const char*); // a_key->priv_key_data --- shared key
typedef char* (*dap_enc_callback_r_str_t)(struct dap_enc_key *); // a_key->priv_key_data_size --- shared key length
typedef size_t (*dap_enc_callback_calc_out_size)(const size_t); typedef size_t (*dap_enc_gen_alice_shared_key) (struct dap_enc_key *a_key, const void *a_priv,
size_t b_pub_size, unsigned char *b_pub);
typedef struct dap_enc_key {
size_t priv_key_data_size; typedef int (*dap_enc_callback_gen_key_public_t ) (struct dap_enc_key *a_key, void * a_output);
//unsigned char * priv_key_data; // can be shared key in assymetric alghoritms
void * priv_key_data; // can be shared key in assymetric alghoritms or secret key in signature alghoritms typedef void (*dap_enc_callback_ptr_t)(struct dap_enc_key *, void *);
typedef size_t (*dap_enc_callback_pptr_r_size_t)(struct dap_enc_key *, void **);
size_t pub_key_data_size; typedef void (*dap_enc_callback_data_t)(struct dap_enc_key *, const void * , size_t);
//unsigned char * pub_key_data; // can be null if enc symmetric typedef void (*dap_enc_callback_size_t)(struct dap_enc_key *, size_t);
void * pub_key_data; // can be null if enc symmetric typedef void (*dap_enc_callback_str_t)(struct dap_enc_key *, const char*);
typedef char* (*dap_enc_callback_r_str_t)(struct dap_enc_key *);
time_t last_used_timestamp; typedef size_t (*dap_enc_callback_calc_out_size)(const size_t);
dap_enc_key_type_t type; typedef size_t (*dap_enc_get_allpbk_list) (struct dap_enc_key *a_key, const void *allpbk_list, const int allpbk_num);
dap_enc_callback_dataop_t enc;
dap_enc_callback_dataop_t dec; typedef struct dap_enc_key {
dap_enc_callback_dataop_na_t enc_na; size_t priv_key_data_size;
dap_enc_callback_dataop_na_t dec_na; //unsigned char * priv_key_data; // can be shared key in assymetric alghoritms
void * priv_key_data; // can be shared key in assymetric alghoritms or secret key in signature alghoritms
dap_enc_callback_sign_op_t sign_get;
dap_enc_callback_sign_op_t sign_verify; size_t pub_key_data_size;
//unsigned char * pub_key_data; // can be null if enc symmetric
dap_enc_gen_alice_shared_key gen_alice_shared_key; void * pub_key_data; // can be null if enc symmetric
dap_enc_gen_bob_shared_key gen_bob_shared_key;
time_t last_used_timestamp;
void * _inheritor; // WARNING! Inheritor must have only serealizeble/deserializeble data (copy) dap_enc_key_type_t type;
size_t _inheritor_size; dap_enc_callback_dataop_t enc;
} dap_enc_key_t; dap_enc_callback_dataop_t dec;
dap_enc_callback_dataop_na_t enc_na;
#define MAX_ENC_KEY_SIZE 16384 dap_enc_callback_dataop_na_t dec_na;
#define MAX_INHERITOR_SIZE 2048 dap_enc_callback_dataop_na_ext_t dec_na_ext;
// struct for serelization/deseralization keys in binary storage dap_enc_callback_sign_op_t sign_get;
typedef struct dap_enc_key_serealize { dap_enc_callback_sign_op_t sign_verify;
size_t priv_key_data_size;
size_t pub_key_data_size; dap_enc_gen_alice_shared_key gen_alice_shared_key;
size_t inheritor_size; dap_enc_gen_bob_shared_key gen_bob_shared_key;
time_t last_used_timestamp;
dap_enc_key_type_t type; void *pbkListdata;
size_t pbkListsize;
unsigned char priv_key_data[MAX_ENC_KEY_SIZE]; dap_enc_get_allpbk_list getallpbkList;
unsigned char pub_key_data[MAX_ENC_KEY_SIZE];
unsigned char inheritor[MAX_INHERITOR_SIZE];
} dap_enc_key_serealize_t; void * _inheritor; // WARNING! Inheritor must have only serealizeble/deserializeble data (copy)
size_t _inheritor_size;
int dap_enc_key_init(void); } dap_enc_key_t;
void dap_enc_key_deinit(void);
#define MAX_ENC_KEY_SIZE 16384
#define MAX_INHERITOR_SIZE 2048
size_t dap_enc_key_get_enc_size(dap_enc_key_t * a_key, const size_t buf_in_size);
size_t dap_enc_key_get_dec_size(dap_enc_key_t * a_key, const size_t buf_in_size); // struct for serelization/deseralization keys in binary storage
typedef struct dap_enc_key_serealize {
uint8_t* dap_enc_key_serealize_sign(dap_enc_key_type_t a_key_type, uint8_t *a_sign, size_t *a_sign_len); size_t priv_key_data_size;
uint8_t* dap_enc_key_deserealize_sign(dap_enc_key_type_t a_key_type, uint8_t *a_sign, size_t *a_sign_len); size_t pub_key_data_size;
uint8_t* dap_enc_key_serealize_priv_key(dap_enc_key_t *a_key, size_t *a_buflen_out); size_t inheritor_size;
uint8_t* dap_enc_key_serealize_pub_key(dap_enc_key_t *a_key, size_t *a_buflen_out); time_t last_used_timestamp;
int dap_enc_key_deserealize_priv_key(dap_enc_key_t *a_key, uint8_t *a_buf, size_t a_buflen); dap_enc_key_type_t type;
int dap_enc_key_deserealize_pub_key(dap_enc_key_t *a_key, const uint8_t *a_buf, size_t a_buflen);
unsigned char priv_key_data[MAX_ENC_KEY_SIZE];
dap_enc_key_serealize_t* dap_enc_key_serealize(dap_enc_key_t * key); unsigned char pub_key_data[MAX_ENC_KEY_SIZE];
dap_enc_key_t* dap_enc_key_deserealize(void *buf, size_t buf_size); unsigned char inheritor[MAX_INHERITOR_SIZE];
} dap_enc_key_serealize_t;
// allocate memory for key struct
dap_enc_key_t *dap_enc_key_new(dap_enc_key_type_t a_key_type); #ifdef __cplusplus
extern "C" {
#endif
// default gen key
dap_enc_key_t *dap_enc_key_new_generate(dap_enc_key_type_t key_type, const void *kex_buf, int dap_enc_key_init(void);
size_t kex_size, const void* seed, void dap_enc_key_deinit(void);
size_t seed_size, size_t key_size);
const char *dap_enc_get_type_name(dap_enc_key_type_t a_key_type);
// update struct dap_enc_key_t after insert foreign keys size_t dap_enc_key_get_enc_size(dap_enc_key_t * a_key, const size_t buf_in_size);
void dap_enc_key_update(dap_enc_key_t *a_key); size_t dap_enc_key_get_dec_size(dap_enc_key_t * a_key, const size_t buf_in_size);
// for asymmetric gen public key uint8_t* dap_enc_key_serealize_sign(dap_enc_key_type_t a_key_type, uint8_t *a_sign, size_t *a_sign_len);
dap_enc_key_t *dap_enc_gen_pub_key_from_priv(struct dap_enc_key *a_key, void **priv_key, size_t *alice_msg_len); uint8_t* dap_enc_key_deserealize_sign(dap_enc_key_type_t a_key_type, uint8_t *a_sign, size_t *a_sign_len);
uint8_t* dap_enc_key_serealize_priv_key(dap_enc_key_t *a_key, size_t *a_buflen_out);
uint8_t* dap_enc_key_serealize_pub_key(dap_enc_key_t *a_key, size_t *a_buflen_out);
size_t dap_enc_gen_key_public_size (dap_enc_key_t *a_key); int dap_enc_key_deserealize_priv_key(dap_enc_key_t *a_key, const uint8_t *a_buf, size_t a_buflen);
int dap_enc_gen_key_public (dap_enc_key_t *a_key, void * a_output); int dap_enc_key_deserealize_pub_key(dap_enc_key_t *a_key, const uint8_t *a_buf, size_t a_buflen);
void dap_enc_key_signature_delete(dap_enc_key_type_t a_key_type, uint8_t *a_sig_buf); dap_enc_key_serealize_t* dap_enc_key_serealize(dap_enc_key_t * key);
void dap_enc_key_delete(dap_enc_key_t * a_key); dap_enc_key_t* dap_enc_key_deserealize(const void *buf, size_t buf_size);
#ifdef __cplusplus // allocate memory for key struct
} dap_enc_key_t *dap_enc_key_new(dap_enc_key_type_t a_key_type);
#endif
#endif // default gen key
dap_enc_key_t *dap_enc_key_new_generate(dap_enc_key_type_t key_type, const void *kex_buf,
size_t kex_size, const void* seed,
size_t seed_size, size_t key_size);
// update struct dap_enc_key_t after insert foreign keys
void dap_enc_key_update(dap_enc_key_t *a_key);
// for asymmetric gen public key
dap_enc_key_t *dap_enc_gen_pub_key_from_priv(struct dap_enc_key *a_key, void **priv_key, size_t *alice_msg_len);
size_t dap_enc_gen_key_public_size (dap_enc_key_t *a_key);
int dap_enc_gen_key_public (dap_enc_key_t *a_key, void * a_output);
void dap_enc_key_signature_delete(dap_enc_key_type_t a_key_type, uint8_t *a_sig_buf);
void dap_enc_key_delete(dap_enc_key_t * a_key);
#ifdef __cplusplus
}
#endif
#endif
#ifndef _DAP_ENC_MSRLN_H_ #ifndef _DAP_ENC_MSRLN_H_
#define _DAP_ENC_MSRLN_H_ #define _DAP_ENC_MSRLN_H_
#include <stddef.h> #include <stddef.h>
#include "msrln/msrln.h" #include "msrln/msrln.h"
#include "dap_enc_key.h" #include "dap_enc_key.h"
//typedef struct dap_enc_key dap_enc_key_t; //typedef struct dap_enc_key dap_enc_key_t;
//typedef struct dap_enc_msrln_key{ //typedef struct dap_enc_msrln_key{
// void* private_key; // void* private_key;
// size_t private_length; // size_t private_length;
// uint8_t* public_key; // uint8_t* public_key;
// size_t public_length; // size_t public_length;
//} dap_enc_msrln_key_t; //} dap_enc_msrln_key_t;
#define DAP_ENC_KEY_TYPE_MSRLN(a) ((dap_enc_msrln_key_t *)((a)->_inheritor)) #define DAP_ENC_KEY_TYPE_MSRLN(a) ((dap_enc_msrln_key_t *)((a)->_inheritor))
void dap_enc_msrln_key_new(struct dap_enc_key* a_key); void dap_enc_msrln_key_new(struct dap_enc_key* a_key);
void dap_enc_msrln_key_generate(struct dap_enc_key * a_key, const void *kex_buf, void dap_enc_msrln_key_generate(struct dap_enc_key * a_key, const void *kex_buf,
size_t kex_size, const void * seed, size_t seed_size, size_t kex_size, const void * seed, size_t seed_size,
size_t key_size); size_t key_size);
//void dap_enc_msrln_key_new_from_data(struct dap_enc_key* a_key, void **a_priv, size_t *a_in_size); //void dap_enc_msrln_key_new_from_data(struct dap_enc_key* a_key, void **a_priv, size_t *a_in_size);
void dap_enc_msrln_key_new_from_data_public(dap_enc_key_t* a_key, const void * a_in, size_t a_in_size); void dap_enc_msrln_key_new_from_data_public(dap_enc_key_t* a_key, const void * a_in, size_t a_in_size);
void dap_enc_msrln_key_delete(struct dap_enc_key* a_key); void dap_enc_msrln_key_delete(struct dap_enc_key* a_key);
size_t dap_enc_msrln_key_public_raw(dap_enc_key_t *a_key, void ** a_key_public); size_t dap_enc_msrln_key_public_raw(dap_enc_key_t *a_key, void ** a_key_public);
size_t dap_enc_msrln_gen_bob_shared_key(struct dap_enc_key* b_key, const void *a_pub, size_t a_pub_size, void **b_pub); size_t dap_enc_msrln_gen_bob_shared_key(struct dap_enc_key* b_key, const void *a_pub, size_t a_pub_size, void **b_pub);
size_t dap_enc_msrln_gen_alice_shared_key(struct dap_enc_key* a_key, const void* a_priv, const size_t b_key_len, unsigned char * b_pub); size_t dap_enc_msrln_gen_alice_shared_key(struct dap_enc_key* a_key, const void* a_priv, const size_t b_key_len, unsigned char * b_pub);
#endif #endif
#ifndef _DAP_ENC_OAES_H_ #ifndef _DAP_ENC_OAES_H_
#define _DAP_ENC_OAES_H_ #define _DAP_ENC_OAES_H_
#include <stddef.h> #include <stddef.h>
#include "dap_enc_key.h" #include "dap_enc_key.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
void dap_enc_oaes_key_new(struct dap_enc_key * a_key); void dap_enc_oaes_key_new(struct dap_enc_key * a_key);
void dap_enc_oaes_key_delete(struct dap_enc_key *a_key); void dap_enc_oaes_key_delete(struct dap_enc_key *a_key);
void dap_enc_oaes_key_generate(struct dap_enc_key * a_key, const void *kex_buf, void dap_enc_oaes_key_generate(struct dap_enc_key * a_key, const void *kex_buf,
size_t kex_size, const void * seed, size_t seed_size, size_t key_size); size_t kex_size, const void * seed, size_t seed_size, size_t key_size);
size_t dap_enc_oaes_calc_decode_size(const size_t size_in); size_t dap_enc_oaes_calc_decode_size(const size_t size_in);
size_t dap_enc_oaes_calc_encode_size(const size_t size_in); size_t dap_enc_oaes_calc_encode_size(const size_t size_in);
size_t dap_enc_oaes_decrypt(struct dap_enc_key * a_key, const void * a_in, size_t a_in_size, void ** a_out); size_t dap_enc_oaes_decrypt(struct dap_enc_key * a_key, const void * a_in, size_t a_in_size, void ** a_out);
size_t dap_enc_oaes_encrypt(struct dap_enc_key * a_key, const void * a_in, size_t a_in_size, void ** a_out); size_t dap_enc_oaes_encrypt(struct dap_enc_key * a_key, const void * a_in, size_t a_in_size, void ** a_out);
// Writes result ( out ) in already allocated buffer // Writes result ( out ) in already allocated buffer
size_t dap_enc_oaes_decrypt_fast(struct dap_enc_key * a_key, const void * a_in, size_t dap_enc_oaes_decrypt_fast(struct dap_enc_key * a_key, const void * a_in,
size_t a_in_size, void * buf_out, size_t buf_out_size); size_t a_in_size, void * buf_out, size_t buf_out_size);
// Writes result ( out ) in already allocated buffer // Writes result ( out ) in already allocated buffer
size_t dap_enc_oaes_encrypt_fast(struct dap_enc_key * a_key, const void * a_in, size_t dap_enc_oaes_encrypt_fast(struct dap_enc_key * a_key, const void * a_in,
size_t a_in_size, void * buf_out, size_t buf_out_size); size_t a_in_size, void * buf_out, size_t buf_out_size);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif
/* /*
* Authors: * Authors:
* Dmitriy Gearasimov <gerasimov.dmitriy@demlabs.net> * Dmitriy Gearasimov <gerasimov.dmitriy@demlabs.net>
* Anatoly Kurotych <anatoly.kurotych@demlabs.net> * Anatoly Kurotych <anatoly.kurotych@demlabs.net>
* DeM Labs Inc. https://demlabs.net * DeM Labs Inc. https://demlabs.net
* Copyright (c) 2019 * Copyright (c) 2019
* All rights reserved. * All rights reserved.
This file is part of DAP (Deus Applications Prototypes) the open source project This file is part of DAP (Deus Applications Prototypes) the open source project
DAP (Deus Applicaions Prototypes) is free software: you can redistribute it and/or modify DAP (Deus Applicaions Prototypes) is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
DAP is distributed in the hope that it will be useful, DAP is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with any DAP based project. If not, see <http://www.gnu.org/licenses/>. along with any DAP based project. If not, see <http://www.gnu.org/licenses/>.
*/ */
#pragma once #pragma once
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
//#include "../sig_picnic/picnic.h" //#include "../sig_picnic/picnic.h"
#include "dap_enc_key.h" #include "dap_enc_key.h"
#define DAP_PICNIC_SIGN_PARAMETR 1//determination of the scheme and level of resistance {1-6} #define DAP_PICNIC_SIGN_PARAMETR 1//determination of the scheme and level of resistance {1-6}
void dap_enc_sig_picnic_key_new(struct dap_enc_key *key); void dap_enc_sig_picnic_key_new(struct dap_enc_key *key);
void dap_enc_sig_picnic_key_delete(struct dap_enc_key *key); void dap_enc_sig_picnic_key_delete(struct dap_enc_key *key);
void dap_enc_sig_picnic_update(struct dap_enc_key * key); void dap_enc_sig_picnic_update(struct dap_enc_key * key);
void dap_enc_sig_picnic_key_new_generate(struct dap_enc_key * key, const void *kex_buf, size_t kex_size, void dap_enc_sig_picnic_key_new_generate(struct dap_enc_key * key, const void *kex_buf, size_t kex_size,
const void * seed, size_t seed_size, const void * seed, size_t seed_size,
size_t key_size); size_t key_size);
size_t dap_enc_sig_picnic_get_sign(struct dap_enc_key * key, const void* message, size_t message_len, size_t dap_enc_sig_picnic_get_sign(struct dap_enc_key * key, const void* message, size_t message_len,
void* signature, size_t signature_len); void* signature, size_t signature_len);
size_t dap_enc_sig_picnic_verify_sign(struct dap_enc_key * key, const void* message, size_t message_len, size_t dap_enc_sig_picnic_verify_sign(struct dap_enc_key * key, const void* message, size_t message_len,
void* signature, size_t signature_len); void* signature, size_t signature_len);
size_t dap_enc_picnic_calc_signature_size(struct dap_enc_key *key); size_t dap_enc_picnic_calc_signature_size(struct dap_enc_key *key);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif