# -*- mode: python -*- Import("env") env = env.Clone() env.Library('sha1_block', source=[ 'sha1_block.cpp' ], LIBDEPS=[ '$BUILD_DIR/mongo/base', '$BUILD_DIR/mongo/util/secure_compare_memory', ]) env.Library('sha256_block', source=[ 'sha256_block.cpp' ], LIBDEPS=[ '$BUILD_DIR/mongo/base', '$BUILD_DIR/mongo/util/secure_compare_memory', ]) if "tom" in env["MONGO_CRYPTO"]: tomEnv = env.Clone() tomEnv.InjectThirdParty(libraries=['tomcrypt']) tomEnv.Append( CPPDEFINES=[ 'LTC_NO_PROTOTYPES', ] ) tomEnv.Library( target='sha_block_tom', source=[ 'sha_block_tom.cpp' ], LIBDEPS=[ '$BUILD_DIR/mongo/base', 'sha1_block', 'sha256_block', ], LIBDEPS_PRIVATE=[ '$BUILD_DIR/third_party/shim_tomcrypt', ] ) else: env.Library('sha_block_${MONGO_CRYPTO}', source=[ 'sha_block_${MONGO_CRYPTO}.cpp' ], LIBDEPS=[ '$BUILD_DIR/mongo/base', 'sha1_block', 'sha256_block', ]) env.Library(target='symmetric_crypto', source=[ 'symmetric_crypto.cpp', 'symmetric_crypto_${MONGO_CRYPTO}.cpp', 'symmetric_key.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/base/secure_allocator', '$BUILD_DIR/mongo/util/net/ssl_manager', '$BUILD_DIR/mongo/util/secure_zero_memory', ], ) env.Library( target="aead_encryption", source=[ "aead_encryption.cpp", ], LIBDEPS=[ 'symmetric_crypto', '$BUILD_DIR/mongo/db/matcher/expressions', ], ) env.CppUnitTest( target='crypto_test', source=[ 'aead_encryption_test.cpp' if "tom" not in env["MONGO_CRYPTO"] else [], 'mechanism_scram_test.cpp', 'sha1_block_test.cpp', 'sha256_block_test.cpp', 'sha512_block_test.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/base', '$BUILD_DIR/mongo/base/secure_allocator', 'aead_encryption' if "tom" not in env["MONGO_CRYPTO"] else [], 'sha_block_${MONGO_CRYPTO}', ], )