blob: 41a98af3f6ba7950fc6e87eb4d2f2f4960687213 [file] [log] [blame]
Amr Aboelkhere6eac202020-04-08 20:46:44 +00001# Copyright 2020 The Chromium Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5import("//testing/test.gni")
6import("//third_party/protobuf/proto_library.gni")
7
8config("shell_encryption_config1") {
9 include_dirs = [
10 # Allow includes to be prefixed with shell-encryption/src/ in case it is not an
11 # immediate subdirectory of the top-level.
12 "src",
13
14 # Allow includes to be prefixed with shell-encryption/ in case it is not an
15 # immediate subdirectory of the top-level. That's mainly is being used for
16 # glog/logging.h includes.
17 ".",
18
19 # Just like the root shell-encryption directory is added to include path, the
20 # corresponding directory tree with generated files needs to be added too.
21 # Note: this path does not change depending on the current target, e.g.
22 # it is always "//gen/third_party/shell-encryption/src" when building with Chromium.
23 # See also: http://cs.chromium.org/?q=%5C"default_include_dirs
24 # https://gn.googlesource.com/gn/+/master/docs/reference.md#target_gen_dir"
25 target_gen_dir,
26 ]
27}
28
29# Protos.
30proto_library("serialization_proto") {
31 sources = [ "src/serialization.proto" ]
32 proto_in_dir = "src/"
33}
34
35proto_library("coefficient_polynomial_proto") {
36 sources = [ "src/testing/coefficient_polynomial.proto" ]
37 proto_in_dir = "src/testing/"
38}
39
40# SHELL lib.
41source_set("shell_encryption") {
42 public_configs = [ ":shell_encryption_config1" ]
43 configs -= [ "//build/config/compiler:chromium_code" ]
44 configs += [ "//build/config/compiler:no_chromium_code" ]
45 public = [
46 "glog/logging.h",
47 "src/bits_util.h",
48 "src/constants.h",
Amr Aboelkher1fd6f752020-04-21 16:06:56 +000049 "src/context.h",
Amr Aboelkhere6eac202020-04-08 20:46:44 +000050 "src/error_params.h",
51 "src/galois_key.h",
52 "src/int256.h",
53 "src/integral_types.h",
54 "src/montgomery.h",
55 "src/ntt_parameters.h",
56 "src/polynomial.h",
57 "src/prng/chacha_prng.h",
58 "src/prng/chacha_prng_util.h",
59 "src/prng/integral_prng_types.h",
60 "src/prng/prng.h",
61 "src/prng/single_thread_chacha_prng.h",
62 "src/relinearization_key.h",
63 "src/sample_error.h",
64 "src/status_macros.h",
65 "src/statusor.h",
66 "src/symmetric_encryption.h",
67 "src/symmetric_encryption_with_prng.h",
68 "src/transcription.h",
69 ]
70 sources = [
71 "src/int256.cc",
Amr Aboelkher1fd6f752020-04-21 16:06:56 +000072 "src/montgomery.cc",
Amr Aboelkhere6eac202020-04-08 20:46:44 +000073 "src/ntt_parameters.cc",
74 "src/prng/chacha_prng.cc",
75 "src/prng/chacha_prng_util.cc",
76 "src/prng/single_thread_chacha_prng.cc",
77 "src/relinearization_key.cc",
78 "src/statusor.cc",
79 ]
80 public_deps = [
81 ":serialization_proto",
82 "//third_party/abseil-cpp/absl/base",
83 "//third_party/abseil-cpp/absl/base:core_headers",
84 "//third_party/abseil-cpp/absl/memory",
85 "//third_party/abseil-cpp/absl/numeric:int128",
86 "//third_party/abseil-cpp/absl/status:status",
87 "//third_party/abseil-cpp/absl/strings",
88 "//third_party/abseil-cpp/absl/types:optional",
89 "//third_party/boringssl:boringssl",
90 ]
91}
92
93test("shell_encryption_test") {
94 testonly = true
95 public_configs = [ ":shell_encryption_config1" ]
96 configs -= [ "//build/config/compiler:chromium_code" ]
97 configs += [ "//build/config/compiler:no_chromium_code" ]
98 public = [
99 "src/testing/coefficient_polynomial.h",
100 "src/testing/coefficient_polynomial_ciphertext.h",
Amr Aboelkher1fd6f752020-04-21 16:06:56 +0000101 "src/testing/parameter.h",
Amr Aboelkhere6eac202020-04-08 20:46:44 +0000102 "src/testing/protobuf_matchers.h",
103 "src/testing/status_matchers.h",
104 "src/testing/status_testing.h",
105 "src/testing/testing_prng.h",
106 "src/testing/testing_utils.h",
107 ]
108 sources = [
109 "src/bits_util_test.cc",
Amr Aboelkher1fd6f752020-04-21 16:06:56 +0000110 "src/context_test.cc",
Amr Aboelkhere6eac202020-04-08 20:46:44 +0000111 "src/error_params_test.cc",
112 "src/galois_key_test.cc",
113 "src/int256_test.cc",
114 "src/montgomery_test.cc",
115 "src/ntt_parameters_test.cc",
116 "src/polynomial_test.cc",
117 "src/prng/chacha_prng.cc",
118 "src/prng/integral_prng_testing_types.h",
119 "src/prng/prng_test.cc",
120 "src/prng/single_thread_chacha_prng_test.cc",
121 "src/relinearization_key_test.cc",
122 "src/sample_error_test.cc",
123 "src/status_macros_test.cc",
124 "src/statusor_test.cc",
125 "src/symmetric_encryption_test.cc",
126 "src/symmetric_encryption_with_prng_test.cc",
127 "src/testing/coefficient_polynomial_ciphertext_test.cc",
128 "src/testing/coefficient_polynomial_test.cc",
129 "src/testing/protobuf_matchers_test.cc",
130 "src/transcription_test.cc",
131 ]
132 public_deps = [
133 ":coefficient_polynomial_proto",
134 ":shell_encryption",
135 "//testing/gmock:gmock",
136 "//testing/gtest:gtest",
137 ]
138}