提交 29843e61 编写于 作者: Y yangqingyou

add cmake option flag DWITH_CRYPTO, test=develop

上级 aabb0651
......@@ -88,6 +88,7 @@ option(WITH_DGC "Use DGC(Deep Gradient Compression) or not" ${WITH_DISTRIBUTE}
option(SANITIZER_TYPE "Choose the type of sanitizer, options are: Address, Leak, Memory, Thread, Undefined" OFF)
option(WITH_LITE "Compile Paddle Fluid with Lite Engine" OFF)
option(WITH_NCCL "Compile PaddlePaddle with NCCL support" ON)
option(WITH_CRYPTO "Compile PaddlePaddle with paddle_crypto lib" ON)
# PY_VERSION
if(NOT PY_VERSION)
......
......@@ -205,10 +205,9 @@ include(external/threadpool)# download threadpool
include(external/dlpack) # download dlpack
include(external/xxhash) # download, build, install xxhash
include(external/warpctc) # download, build, install warpctc
include(external/cryptopp) # download, build, install cryptopp
list(APPEND third_party_deps extern_eigen3 extern_gflags extern_glog extern_boost extern_xxhash)
list(APPEND third_party_deps extern_zlib extern_dlpack extern_warpctc extern_threadpool extern_cryptopp)
list(APPEND third_party_deps extern_zlib extern_dlpack extern_warpctc extern_threadpool)
# download file
set(CUDAERROR_URL "http://paddlepaddledeps.bj.bcebos.com/cudaErrorMessage.tar.gz" CACHE STRING "" FORCE)
......@@ -306,4 +305,8 @@ if (WITH_LITE)
include(external/lite)
endif (WITH_LITE)
if (WITH_CRYPTO)
include(external/cryptopp) # download, build, install cryptopp
endif (WITH_CRYPTO)
add_custom_target(third_party ALL DEPENDS ${third_party_deps})
......@@ -2,4 +2,6 @@ cc_library(fs SRCS fs.cc DEPS string_helper glog boost)
cc_library(shell SRCS shell.cc DEPS string_helper glog timer enforce)
cc_test(test_fs SRCS test_fs.cc DEPS fs shell)
add_subdirectory(crypto)
if (WITH_CRYPTO)
add_subdirectory(crypto)
endif (WITH_CRYPTO)
cc_library(paddle_ciphers SRCS cipher_utils.cc cipher.cc aes_cipher.cc DEPS cryptopp enforce)
cc_test(aes_cipher_test SRCS aes_cipher_test.cc DEPS paddle_ciphers)
cc_test(cipher_utils_test SRCS cipher_utils_test.cc DEPS paddle_ciphers)
cc_library(paddle_crypto SRCS cipher_utils.cc cipher.cc aes_cipher.cc DEPS cryptopp enforce)
cc_test(aes_cipher_test SRCS aes_cipher_test.cc DEPS paddle_crypto)
cc_test(cipher_utils_test SRCS cipher_utils_test.cc DEPS paddle_crypto)
......@@ -29,8 +29,11 @@
#include <cryptopp/aes.h>
#include <cryptopp/ccm.h>
#include <cryptopp/cryptlib.h>
#include <cryptopp/filters.h>
#include <cryptopp/gcm.h>
#include <cryptopp/modes.h>
#include <cryptopp/smartptr.h>
#include <set>
#include <string>
......
......@@ -27,14 +27,21 @@
#pragma once
#include <cryptopp/cryptlib.h>
#include <cryptopp/filters.h>
#include <cryptopp/smartptr.h>
#include <string>
#include "paddle/fluid/framework/io/crypto/cipher.h"
namespace CryptoPP {
class StreamTransformationFilter;
class SymmetricCipher;
class AuthenticatedSymmetricCipher;
class AuthenticatedDecryptionFilter;
class AuthenticatedEncryptionFilter;
template <class CryptoppCipher>
class member_ptr;
} // namespace CryptoPP
namespace paddle {
namespace framework {
......
......@@ -14,6 +14,7 @@ limitations under the License. */
#include "paddle/fluid/framework/io/crypto/aes_cipher.h"
#include <cryptopp/cryptlib.h>
#include <glog/logging.h>
#include <gtest/gtest.h>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册