Skip to content

Commit

Permalink
Address comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
ple13 committed Mar 20, 2024
1 parent 09b5a13 commit ac5b003
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 21 deletions.
4 changes: 2 additions & 2 deletions src/main/cc/crypto/shuffle.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "common_cpp/macros/macros.h"
#include "math/open_ssl_uniform_random_generator.h"

namespace wfa::measurement::common::crypto {
namespace wfa::crypto {

absl::Status SecureShuffleWithSeed(std::vector<uint32_t>& data,
const frequency_count::PrngSeed& seed) {
Expand Down Expand Up @@ -61,4 +61,4 @@ absl::Status SecureShuffleWithSeed(std::vector<uint32_t>& data,
return absl::OkStatus();
}

} // namespace wfa::measurement::common::crypto
} // namespace wfa::crypto
4 changes: 2 additions & 2 deletions src/main/cc/crypto/shuffle.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include "absl/status/status.h"
#include "wfa/frequency_count/secret_share.pb.h"

namespace wfa::measurement::common::crypto {
namespace wfa::crypto {

// Shuffles the vector data using Fisher-Yates approach. Let n be the size of
// data, the Fisher-Yates shuffle is as below.
Expand All @@ -32,6 +32,6 @@ namespace wfa::measurement::common::crypto {
absl::Status SecureShuffleWithSeed(std::vector<uint32_t>& data,
const frequency_count::PrngSeed& seed);

} // namespace wfa::measurement::common::crypto
} // namespace wfa::crypto

#endif // SRC_MAIN_CC_CRYPTO_SHUFFLE_H_
2 changes: 1 addition & 1 deletion src/main/cc/frequency_count/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ cc_library(
deps = [
":secret_share_generator",
"//src/main/proto/wfa/frequency_count:secret_share_cc_proto",
"//src/main/proto/wfa/frequency_count:share_shuffle_methods_cc_proto",
"//src/main/proto/wfa/frequency_count:secret_share_methods_cc_proto",
],
)
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include "common_cpp/macros/macros.h"
#include "frequency_count/secret_share_generator.h"
#include "wfa/frequency_count/secret_share.pb.h"
#include "wfa/frequency_count/share_shuffle_methods.pb.h"
#include "wfa/frequency_count/secret_share_methods.pb.h"

namespace wfa::frequency_count {

Expand Down
16 changes: 8 additions & 8 deletions src/main/proto/wfa/frequency_count/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,26 @@ cc_proto_library(
)

proto_library(
name = "share_shuffle_sketch_proto",
srcs = ["share_shuffle_sketch.proto"],
name = "frequency_vector_proto",
srcs = ["frequency_vector.proto"],
strip_import_prefix = IMPORT_PREFIX,
)

cc_proto_library(
name = "share_shuffle_sketch_cc_proto",
deps = [":share_shuffle_sketch_proto"],
name = "frequency_vector_cc_proto",
deps = [":frequency_vector_proto"],
)

proto_library(
name = "share_shuffle_methods_proto",
srcs = ["share_shuffle_methods.proto"],
name = "secret_share_methods_proto",
srcs = ["secret_share_methods.proto"],
strip_import_prefix = IMPORT_PREFIX,
deps = [
":secret_share_proto",
],
)

cc_proto_library(
name = "share_shuffle_methods_cc_proto",
deps = [":share_shuffle_methods_proto"],
name = "secret_share_methods_cc_proto",
deps = [":secret_share_methods_proto"],
)
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,9 @@ package wfa.frequency_count;

option java_package = "org.wfanet.frequencycount";
option java_multiple_files = true;
option java_outer_classname = "ShareShuffleSketchProto";
option java_outer_classname = "FrequencyVectorProto";

// The data share of HonestMajorityShareShuffle protocol.
message ShareShuffleSketch {
message FrequencyVector {
// A vector of count where each count corresponds to the frequency of a single
// VID.
repeated uint32 data = 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import "wfa/frequency_count/secret_share.proto";
option java_package = "org.wfanet.frequencycount";
option java_multiple_files = true;

// The request to encrypt a sketch.
// The request to secret share a frequency vector.
message SecretShareGeneratorRequest {
uint32 ring_modulus = 1;
// The input frequency vector
Expand Down
2 changes: 1 addition & 1 deletion src/test/cc/crypto/shuffle_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ namespace wfa::crypto {
namespace {

using frequency_count::PrngSeed;
using measurement::common::crypto::SecureShuffleWithSeed;
using ::wfa::StatusIs;
using ::wfa::crypto::SecureShuffleWithSeed;
using ::wfa::math::kBytesPerAes256Iv;
using ::wfa::math::kBytesPerAes256Key;

Expand Down
2 changes: 1 addition & 1 deletion src/test/cc/frequency_count/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ cc_test(
"//src/main/cc/frequency_count:secret_share_generator_adapter",
"//src/main/cc/math:open_ssl_uniform_random_generator",
"//src/main/proto/wfa/frequency_count:secret_share_cc_proto",
"//src/main/proto/wfa/frequency_count:share_shuffle_methods_cc_proto",
"//src/main/proto/wfa/frequency_count:secret_share_methods_cc_proto",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
"@wfa_common_cpp//src/main/cc/common_cpp/testing:status",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include "frequency_count/secret_share_generator.h"
#include "gtest/gtest.h"
#include "math/open_ssl_uniform_random_generator.h"
#include "wfa/frequency_count/share_shuffle_methods.pb.h"
#include "wfa/frequency_count/secret_share_methods.pb.h"

namespace wfa::frequency_count {
namespace {
Expand Down

0 comments on commit ac5b003

Please sign in to comment.