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# Implementation of Dodis-Yampolskiy VRF and OPRF. 16 17load("@rules_cc//cc:defs.bzl", "cc_library") 18load("@rules_proto//proto:defs.bzl", "proto_library") 19 20package( 21 default_visibility = ["//visibility:public"], 22) 23 24proto_library( 25 name = "dy_verifiable_random_function_proto", 26 srcs = ["dy_verifiable_random_function.proto"], 27 deps = [ 28 "//private_join_and_compute/crypto/proto:big_num_proto", 29 "//private_join_and_compute/crypto/proto:ec_point_proto", 30 "//private_join_and_compute/crypto/proto:pedersen_proto", 31 ], 32) 33 34cc_proto_library( 35 name = "dy_verifiable_random_function_cc_proto", 36 deps = [":dy_verifiable_random_function_proto"], 37) 38 39cc_library( 40 name = "dy_verifiable_random_function", 41 srcs = [ 42 "dy_verifiable_random_function.cc", 43 ], 44 hdrs = [ 45 "dy_verifiable_random_function.h", 46 ], 47 deps = [ 48 ":dy_verifiable_random_function_cc_proto", 49 "//private_join_and_compute/crypto:bn_util", 50 "//private_join_and_compute/crypto:ec_util", 51 "//private_join_and_compute/crypto:pedersen_over_zn", 52 "//private_join_and_compute/crypto/proto:proto_util", 53 "@com_google_absl//absl/strings", 54 "@com_google_protobuf//:protobuf_lite", 55 ], 56) 57 58cc_test( 59 name = "dy_verifiable_random_function_test", 60 srcs = [ 61 "dy_verifiable_random_function_test.cc", 62 ], 63 deps = [ 64 ":dy_verifiable_random_function", 65 ":dy_verifiable_random_function_cc_proto", 66 "//private_join_and_compute/crypto:bn_util", 67 "//private_join_and_compute/crypto:ec_util", 68 "//private_join_and_compute/crypto:pedersen_over_zn", 69 "//private_join_and_compute/crypto/proto:big_num_cc_proto", 70 "//private_join_and_compute/crypto/proto:pedersen_cc_proto", 71 "//private_join_and_compute/crypto/proto:proto_util", 72 "//private_join_and_compute/util:status_testing_includes", 73 "@com_github_google_googletest//:gtest_main", 74 "@com_google_absl//absl/strings", 75 ], 76) 77 78proto_library( 79 name = "bb_oblivious_signature_proto", 80 srcs = ["bb_oblivious_signature.proto"], 81 deps = [ 82 "//private_join_and_compute/crypto/proto:big_num_proto", 83 "//private_join_and_compute/crypto/proto:camenisch_shoup_proto", 84 "//private_join_and_compute/crypto/proto:ec_point_proto", 85 "//private_join_and_compute/crypto/proto:pedersen_proto", 86 ], 87) 88 89cc_proto_library( 90 name = "bb_oblivious_signature_cc_proto", 91 deps = [":bb_oblivious_signature_proto"], 92) 93 94cc_library( 95 name = "bb_oblivious_signature", 96 srcs = [ 97 "bb_oblivious_signature.cc", 98 ], 99 hdrs = [ 100 "bb_oblivious_signature.h", 101 ], 102 deps = [ 103 ":bb_oblivious_signature_cc_proto", 104 "//private_join_and_compute/crypto:bn_util", 105 "//private_join_and_compute/crypto:camenisch_shoup", 106 "//private_join_and_compute/crypto:ec_util", 107 "//private_join_and_compute/crypto:pedersen_over_zn", 108 "//private_join_and_compute/crypto/proto:big_num_cc_proto", 109 "//private_join_and_compute/crypto/proto:camenisch_shoup_cc_proto", 110 "//private_join_and_compute/crypto/proto:ec_point_cc_proto", 111 "//private_join_and_compute/crypto/proto:proto_util", 112 "@com_google_absl//absl/strings", 113 ], 114) 115 116cc_test( 117 name = "bb_oblivious_signature_test", 118 timeout = "long", 119 srcs = [ 120 "bb_oblivious_signature_test.cc", 121 ], 122 deps = [ 123 ":bb_oblivious_signature", 124 ":bb_oblivious_signature_cc_proto", 125 "//private_join_and_compute/crypto:bn_util", 126 "//private_join_and_compute/crypto:camenisch_shoup", 127 "//private_join_and_compute/crypto:ec_util", 128 "//private_join_and_compute/crypto:pedersen_over_zn", 129 "//private_join_and_compute/crypto/proto:big_num_cc_proto", 130 "//private_join_and_compute/crypto/proto:camenisch_shoup_cc_proto", 131 "//private_join_and_compute/crypto/proto:ec_point_cc_proto", 132 "//private_join_and_compute/crypto/proto:pedersen_cc_proto", 133 "//private_join_and_compute/crypto/proto:proto_util", 134 "//private_join_and_compute/util:status_testing_includes", 135 "@com_github_google_googletest//:gtest_main", 136 "@com_google_absl//absl/strings", 137 ], 138) 139