Skip to content
This repository has been archived by the owner on Sep 4, 2022. It is now read-only.

Commit

Permalink
Friends implementation (#23)
Browse files Browse the repository at this point in the history
* change to system message

* it builds

* initial tests passing!!!
  • Loading branch information
arvid220u authored Jun 29, 2022
1 parent 7cf56b7 commit f5f22e7
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 12 deletions.
69 changes: 68 additions & 1 deletion Cargo.Bazel.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,69 @@
{
"checksum": "2baaade5e42cd2759e106e809dfbc207c4fdc3010e67328bbf58f77486c07117",
"checksum": "198f0babe8a72f4971fb0af0214760f35eaca9f7c77fd452d5e608ee242ceeb3",
"crates": {
"anyhow 1.0.58": {
"name": "anyhow",
"version": "1.0.58",
"repository": {
"Http": {
"url": "https://crates.io/api/v1/crates/anyhow/1.0.58/download",
"sha256": "bb07d2053ccdbe10e2af2995a2f116c1330396493dc1269f6a91d0ae82e19704"
}
},
"targets": [
{
"Library": {
"crate_name": "anyhow",
"crate_root": "src/lib.rs",
"srcs": {
"include": [
"**/*.rs"
],
"exclude": []
}
}
},
{
"BuildScript": {
"crate_name": "build_script_build",
"crate_root": "build.rs",
"srcs": {
"include": [
"**/*.rs"
],
"exclude": []
}
}
}
],
"library_target_name": "anyhow",
"common_attrs": {
"compile_data_glob": [
"**"
],
"crate_features": [
"default",
"std"
],
"deps": {
"common": [
{
"id": "anyhow 1.0.58",
"target": "build_script_build"
}
],
"selects": {}
},
"edition": "2018",
"version": "1.0.58"
},
"build_script_attrs": {
"data_glob": [
"**"
]
},
"license": "MIT OR Apache-2.0"
},
"cc 1.0.73": {
"name": "cc",
"version": "1.0.73",
Expand Down Expand Up @@ -282,6 +345,10 @@
],
"deps": {
"common": [
{
"id": "anyhow 1.0.58",
"target": "anyhow"
},
{
"id": "diesel 2.0.0-rc.0",
"target": "diesel"
Expand Down
5 changes: 4 additions & 1 deletion asphr_load5.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ def load_asphr_repos5(asphr_path):
version = "0.24.2",
features = ["bundled"],
),
"anyhow": crate.spec(
version = "1.0",
),
},
# Setting the default package name to `""` forces the use of the macros defined in this repository
# to always use the root package when looking for dependencies or aliases. This should be considered
Expand All @@ -39,7 +42,7 @@ def load_asphr_repos5(asphr_path):
default_package_name = "",
),
)

rust_cxx_vendor(
name = "third-party",
cargo_version = RUST_VERSION,
Expand Down
4 changes: 2 additions & 2 deletions pir/fast_pir/fast_pir_config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ static auto create_context_params() -> seal::EncryptionParameters {
return params;
}

constexpr size_t SEAL_DB_COLUMNS = CEIL_DIV(MESSAGE_SIZE_BITS, PLAIN_BITS);
constexpr int SEAL_DB_COLUMNS = CEIL_DIV(MESSAGE_SIZE_BITS, PLAIN_BITS);

// CLIENT_DB_ROWS is the number of rows that the client thinks is in the
// database. this must be an upper bound on the actual database size. note that
Expand All @@ -77,4 +77,4 @@ constexpr size_t SEAL_DB_COLUMNS = CEIL_DIV(MESSAGE_SIZE_BITS, PLAIN_BITS);
// is to be under the GRPC message size limit of 4 MB — to increase this, use
// GRPC streaming instead. See
// https://jbrandhorst.com/post/grpc-binary-blob-stream/.
constexpr size_t CLIENT_DB_ROWS = 360'000;
constexpr int CLIENT_DB_ROWS = 360'000;
18 changes: 10 additions & 8 deletions schema/message.proto
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ syntax = "proto3";

package asphrclient;

// keep this in sync with db.rs, SystemMessage
enum SystemMessage {
OUTGOING_INVITATION = 0;
}

// Given that we have a very very limited bandwidth, our goal is to define a Message type that is as small
// as possible.
//
Expand All @@ -38,13 +43,10 @@ message Message {
// this field is not set if the message isn't long.
uint32 chunks_start_sequence_number = 4;

// control messages below. none of the fields below will be set for actual messages.
// system messages below. none of the fields below will be set for actual messages.
//
// true iff this message is a control message
bool control = 5;
// keep this in sync with db.rs, ControlMessage constants
enum ControlMessage {
OUTGOING_FRIEND_REQUEST = 0;
}
ControlMessage control_message = 6;
// true iff this message is a system message
bool system = 5;
SystemMessage system_message = 6;
string system_message_data = 7; // optional data for the system message
}

0 comments on commit f5f22e7

Please sign in to comment.