# Copyright 2020 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import("//testing/test.gni") import("//third_party/protobuf/proto_library.gni") config("shell_encryption_config1") { include_dirs = [ # Allow includes to be prefixed with shell-encryption/src/ in case it is not an # immediate subdirectory of the top-level. "src", # Allow includes to be prefixed with shell-encryption/ in case it is not an # immediate subdirectory of the top-level. That's mainly is being used for # glog/logging.h includes. ".", # Just like the root shell-encryption directory is added to include path, the # corresponding directory tree with generated files needs to be added too. # Note: this path does not change depending on the current target, e.g. # it is always "//gen/third_party/shell-encryption/src" when building with Chromium. # See also: http://cs.chromium.org/?q=%5C"default_include_dirs # https://gn.googlesource.com/gn/+/master/docs/reference.md#target_gen_dir" target_gen_dir, ] } # Protos. proto_library("serialization_proto") { sources = [ "src/serialization.proto" ] proto_in_dir = "src/" } proto_library("coefficient_polynomial_proto") { sources = [ "src/testing/coefficient_polynomial.proto" ] proto_in_dir = "src/testing/" } # SHELL lib. source_set("shell_encryption") { public_configs = [ ":shell_encryption_config1" ] configs -= [ "//build/config/compiler:chromium_code" ] configs += [ "//build/config/compiler:no_chromium_code" ] public = [ "glog/logging.h", "src/bits_util.h", "src/constants.h", "src/context.h", "src/error_params.h", "src/galois_key.h", "src/int256.h", "src/integral_types.h", "src/montgomery.h", "src/ntt_parameters.h", "src/polynomial.h", "src/prng/chacha_prng.h", "src/prng/chacha_prng_util.h", "src/prng/integral_prng_types.h", "src/prng/prng.h", "src/prng/single_thread_chacha_prng.h", "src/relinearization_key.h", "src/sample_error.h", "src/status_macros.h", "src/statusor.h", "src/symmetric_encryption.h", "src/symmetric_encryption_with_prng.h", "src/transcription.h", ] sources = [ "src/int256.cc", "src/montgomery.cc", "src/ntt_parameters.cc", "src/prng/chacha_prng.cc", "src/prng/chacha_prng_util.cc", "src/prng/single_thread_chacha_prng.cc", "src/relinearization_key.cc", "src/statusor.cc", ] public_deps = [ ":serialization_proto", "//third_party/abseil-cpp/absl/base", "//third_party/abseil-cpp/absl/base:core_headers", "//third_party/abseil-cpp/absl/memory", "//third_party/abseil-cpp/absl/numeric:int128", "//third_party/abseil-cpp/absl/status:status", "//third_party/abseil-cpp/absl/strings", "//third_party/abseil-cpp/absl/types:optional", "//third_party/boringssl:boringssl", ] } test("shell_encryption_test") { testonly = true public_configs = [ ":shell_encryption_config1" ] configs -= [ "//build/config/compiler:chromium_code" ] configs += [ "//build/config/compiler:no_chromium_code" ] public = [ "src/testing/coefficient_polynomial.h", "src/testing/coefficient_polynomial_ciphertext.h", "src/testing/parameter.h", "src/testing/protobuf_matchers.h", "src/testing/status_matchers.h", "src/testing/status_testing.h", "src/testing/testing_prng.h", "src/testing/testing_utils.h", ] sources = [ "src/bits_util_test.cc", "src/context_test.cc", "src/error_params_test.cc", "src/galois_key_test.cc", "src/int256_test.cc", "src/montgomery_test.cc", "src/ntt_parameters_test.cc", "src/polynomial_test.cc", "src/prng/chacha_prng.cc", "src/prng/integral_prng_testing_types.h", "src/prng/prng_test.cc", "src/prng/single_thread_chacha_prng_test.cc", "src/relinearization_key_test.cc", "src/sample_error_test.cc", "src/status_macros_test.cc", "src/statusor_test.cc", "src/symmetric_encryption_test.cc", "src/symmetric_encryption_with_prng_test.cc", "src/testing/coefficient_polynomial_ciphertext_test.cc", "src/testing/coefficient_polynomial_test.cc", "src/testing/protobuf_matchers_test.cc", "src/transcription_test.cc", ] public_deps = [ ":coefficient_polynomial_proto", ":shell_encryption", "//testing/gmock:gmock", "//testing/gtest:gtest", ] }