1# Copyright 2019 Google LLC. 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); 4# you may not use this file except in compliance with the License. 5# You may obtain a copy of the License at 6# 7# https://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, 11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12# See the License for the specific language governing permissions and 13# limitations under the License. 14 15# Build file for util folder in open-source Private Join and Compute. 16 17load("@com_github_grpc_grpc//bazel:grpc_build_system.bzl", "grpc_proto_library") 18 19package( 20 default_visibility = ["//visibility:public"], 21 features = [ 22 "-layering_check", 23 "-parse_headers", 24 ], 25) 26 27cc_library( 28 name = "status_includes", 29 hdrs = [ 30 "status.inc", 31 "status_macros.h", 32 ], 33 deps = [ 34 "@com_google_absl//absl/status", 35 "@com_google_absl//absl/status:statusor", 36 "@com_google_protobuf//:protobuf_lite", 37 ], 38) 39 40cc_library( 41 name = "status_testing_includes", 42 hdrs = [ 43 "status_matchers.h", 44 "status_testing.h", 45 "status_testing.inc", 46 ], 47 deps = [ 48 ":status_includes", 49 "@com_github_google_googletest//:gtest", 50 "@com_google_absl//absl/strings", 51 ], 52) 53 54cc_library( 55 name = "file", 56 srcs = [ 57 "file.cc", 58 "file_posix.cc", 59 ], 60 hdrs = [ 61 "file.h", 62 ], 63 deps = [ 64 ":status_includes", 65 "@com_google_absl//absl/strings", 66 ], 67) 68 69cc_test( 70 name = "file_test", 71 size = "small", 72 srcs = [ 73 "file_test.cc", 74 ], 75 deps = [ 76 ":file", 77 "@com_github_google_googletest//:gtest_main", 78 ], 79) 80 81grpc_proto_library( 82 name = "file_test_proto", 83 srcs = ["file_test.proto"], 84) 85 86cc_library( 87 name = "proto_util", 88 hdrs = ["proto_util.h"], 89 deps = [ 90 ":recordio", 91 ":status_includes", 92 "@com_google_absl//absl/strings", 93 "@com_google_protobuf//:protobuf_lite", 94 ], 95) 96 97cc_test( 98 name = "proto_util_test", 99 size = "medium", 100 srcs = ["proto_util_test.cc"], 101 deps = [ 102 ":file_test_proto", 103 ":proto_util", 104 ":status_testing_includes", 105 "@com_github_google_googletest//:gtest_main", 106 ], 107) 108 109cc_library( 110 name = "recordio", 111 srcs = [ 112 "recordio.cc", 113 ], 114 hdrs = ["recordio.h"], 115 deps = [ 116 ":file", 117 ":status_includes", 118 "@com_google_absl//absl/log", 119 "@com_google_absl//absl/memory", 120 "@com_google_absl//absl/status", 121 "@com_google_absl//absl/strings", 122 "@com_google_absl//absl/synchronization", 123 "@com_google_protobuf//:protobuf_lite", 124 ], 125) 126 127cc_test( 128 name = "recordio_test", 129 srcs = ["recordio_test.cc"], 130 deps = [ 131 ":file_test_proto", 132 ":proto_util", 133 ":recordio", 134 ":status_includes", 135 ":status_testing_includes", 136 "//private_join_and_compute/crypto:bn_util", 137 "@com_github_google_googletest//:gtest_main", 138 "@com_google_absl//absl/random", 139 "@com_google_absl//absl/strings", 140 ], 141) 142 143cc_library( 144 name = "process_record_file_parameters", 145 hdrs = ["process_record_file_parameters.h"], 146 deps = [ 147 "//private_join_and_compute/crypto:ec_commutative_cipher", 148 "//private_join_and_compute/crypto:openssl_includes", 149 ], 150) 151 152cc_library( 153 name = "process_record_file_util", 154 hdrs = ["process_record_file_util.h"], 155 deps = [ 156 ":process_record_file_parameters", 157 ":proto_util", 158 ":recordio", 159 ":status_includes", 160 "@com_google_absl//absl/strings", 161 ], 162) 163 164grpc_proto_library( 165 name = "test_proto", 166 srcs = ["test.proto"], 167) 168 169cc_test( 170 name = "process_record_file_util_test", 171 srcs = ["process_record_file_util_test.cc"], 172 deps = [ 173 ":process_record_file_parameters", 174 ":process_record_file_util", 175 ":proto_util", 176 ":status_testing_includes", 177 ":test_proto", 178 "@com_github_google_googletest//:gtest_main", 179 "@com_google_absl//absl/strings", 180 ], 181) 182 183cc_library( 184 name = "elgamal_proto_util", 185 srcs = ["elgamal_proto_util.cc"], 186 hdrs = ["elgamal_proto_util.h"], 187 deps = [ 188 "//private_join_and_compute/crypto:bn_util", 189 "//private_join_and_compute/crypto:ec_util", 190 "//private_join_and_compute/crypto:elgamal", 191 "//private_join_and_compute/crypto:elgamal_proto", 192 ], 193) 194 195cc_library( 196 name = "elgamal_key_util", 197 srcs = ["elgamal_key_util.cc"], 198 hdrs = ["elgamal_key_util.h"], 199 deps = [ 200 ":elgamal_proto_util", 201 ":proto_util", 202 ":recordio", 203 ":status_includes", 204 "//private_join_and_compute/crypto:bn_util", 205 "//private_join_and_compute/crypto:ec_util", 206 "//private_join_and_compute/crypto:elgamal_proto", 207 ], 208) 209 210cc_library( 211 name = "ec_key_util", 212 srcs = ["ec_key_util.cc"], 213 hdrs = ["ec_key_util.h"], 214 deps = [ 215 ":proto_util", 216 ":recordio", 217 ":status_includes", 218 "//private_join_and_compute/crypto:bn_util", 219 "//private_join_and_compute/crypto:ec_key_proto", 220 "//private_join_and_compute/crypto:ec_util", 221 "@com_google_absl//absl/strings", 222 ], 223) 224 225cc_test( 226 name = "elgamal_proto_util_test", 227 srcs = ["elgamal_proto_util_test.cc"], 228 deps = [ 229 ":elgamal_proto_util", 230 ":status_testing_includes", 231 "@com_github_google_googletest//:gtest_main", 232 ], 233) 234 235cc_test( 236 name = "elgamal_key_util_test", 237 srcs = ["elgamal_key_util_test.cc"], 238 deps = [ 239 ":elgamal_key_util", 240 ":elgamal_proto_util", 241 ":proto_util", 242 ":status_testing_includes", 243 "//private_join_and_compute/crypto:bn_util", 244 "//private_join_and_compute/crypto:ec_util", 245 "//private_join_and_compute/crypto:elgamal", 246 "//private_join_and_compute/crypto:elgamal_proto", 247 "//private_join_and_compute/crypto:openssl_includes", 248 "@com_github_google_googletest//:gtest_main", 249 ], 250) 251 252cc_test( 253 name = "ec_key_util_test", 254 srcs = ["ec_key_util_test.cc"], 255 deps = [ 256 ":ec_key_util", 257 ":proto_util", 258 ":status_testing_includes", 259 "//private_join_and_compute/crypto:bn_util", 260 "//private_join_and_compute/crypto:ec_key_proto", 261 "//private_join_and_compute/crypto:ec_util", 262 "//private_join_and_compute/crypto:openssl_includes", 263 "@com_github_google_googletest//:gtest_main", 264 ], 265) 266