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 15load("@com_github_grpc_grpc//bazel:grpc_build_system.bzl", "grpc_proto_library") 16 17package(default_visibility = ["//visibility:public"]) 18 19grpc_proto_library( 20 name = "match_proto", 21 srcs = ["match.proto"], 22) 23 24grpc_proto_library( 25 name = "private_intersection_sum_proto", 26 srcs = ["private_intersection_sum.proto"], 27 deps = [ 28 ":match_proto", 29 ], 30) 31 32grpc_proto_library( 33 name = "private_join_and_compute_proto", 34 srcs = ["private_join_and_compute.proto"], 35 deps = [ 36 ":private_intersection_sum_proto", 37 ], 38) 39 40cc_library( 41 name = "message_sink", 42 hdrs = ["message_sink.h"], 43 deps = [ 44 ":private_join_and_compute_proto", 45 "//private_join_and_compute/util:status_includes", 46 "@com_google_absl//absl/memory", 47 ], 48) 49 50cc_library( 51 name = "protocol_client", 52 hdrs = ["protocol_client.h"], 53 deps = [ 54 ":message_sink", 55 ":private_join_and_compute_proto", 56 "//private_join_and_compute/util:status_includes", 57 ], 58) 59 60cc_library( 61 name = "client_impl", 62 srcs = ["client_impl.cc"], 63 hdrs = ["client_impl.h"], 64 deps = [ 65 ":match_proto", 66 ":message_sink", 67 ":private_intersection_sum_proto", 68 ":private_join_and_compute_proto", 69 ":protocol_client", 70 "//private_join_and_compute/crypto:bn_util", 71 "//private_join_and_compute/crypto:ec_commutative_cipher", 72 "//private_join_and_compute/crypto:paillier", 73 "//private_join_and_compute/util:status_includes", 74 ], 75) 76 77cc_library( 78 name = "protocol_server", 79 hdrs = ["protocol_server.h"], 80 deps = [ 81 ":message_sink", 82 ":private_join_and_compute_proto", 83 "//private_join_and_compute/util:status_includes", 84 ], 85) 86 87cc_library( 88 name = "server_impl", 89 srcs = ["server_impl.cc"], 90 hdrs = ["server_impl.h"], 91 deps = [ 92 ":match_proto", 93 ":message_sink", 94 ":private_intersection_sum_proto", 95 ":private_join_and_compute_proto", 96 ":protocol_server", 97 "//private_join_and_compute/crypto:bn_util", 98 "//private_join_and_compute/crypto:ec_commutative_cipher", 99 "//private_join_and_compute/crypto:paillier", 100 "//private_join_and_compute/util:status_includes", 101 ], 102) 103 104cc_library( 105 name = "data_util", 106 srcs = ["data_util.cc"], 107 hdrs = ["data_util.h"], 108 deps = [ 109 ":match_proto", 110 "//private_join_and_compute/crypto:bn_util", 111 "//private_join_and_compute/util:status_includes", 112 "@com_google_absl//absl/container:btree", 113 "@com_google_absl//absl/strings", 114 ], 115) 116 117cc_binary( 118 name = "generate_dummy_data", 119 srcs = ["generate_dummy_data.cc"], 120 deps = [ 121 ":data_util", 122 "@com_google_absl//absl/base", 123 "@com_google_absl//absl/flags:flag", 124 "@com_google_absl//absl/flags:parse", 125 "@com_google_absl//absl/log", 126 ], 127) 128 129cc_library( 130 name = "private_join_and_compute_rpc_impl", 131 srcs = ["private_join_and_compute_rpc_impl.cc"], 132 hdrs = ["private_join_and_compute_rpc_impl.h"], 133 deps = [ 134 ":message_sink", 135 ":private_join_and_compute_proto", 136 ":protocol_server", 137 "//private_join_and_compute/util:status_includes", 138 "@com_github_grpc_grpc//:grpc++", 139 ], 140) 141 142cc_binary( 143 name = "server", 144 srcs = ["server.cc"], 145 deps = [ 146 ":data_util", 147 ":private_join_and_compute_proto", 148 ":private_join_and_compute_rpc_impl", 149 ":protocol_server", 150 ":server_impl", 151 "@com_github_grpc_grpc//:grpc", 152 "@com_github_grpc_grpc//:grpc++", 153 "@com_google_absl//absl/base", 154 "@com_google_absl//absl/flags:flag", 155 "@com_google_absl//absl/flags:parse", 156 ], 157) 158 159cc_binary( 160 name = "client", 161 srcs = ["client.cc"], 162 deps = [ 163 ":client_impl", 164 ":data_util", 165 ":private_join_and_compute_proto", 166 ":protocol_client", 167 "@com_github_grpc_grpc//:grpc", 168 "@com_github_grpc_grpc//:grpc++", 169 "@com_google_absl//absl/base", 170 "@com_google_absl//absl/flags:flag", 171 "@com_google_absl//absl/flags:parse", 172 "@com_google_absl//absl/strings", 173 ], 174) 175