Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proto changes for pir_shard_configs and reuse_existing_config #14

Merged
merged 1 commit into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions apple/swift_homomorphic_encryption/api/pir/v1/api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ message ConfigRequest {
// List of usecases to fetch configs for.
// When set to empty array, all configs will be returned.
repeated string usecases = 1;
// For each usecase, the existing config id, if one exists.
repeated bytes existing_config_ids = 2;
}

// Usecase configuration.
Expand All @@ -35,6 +37,8 @@ message Config {
reserved 2;
// Unique identifier for the configuration.
bytes config_id = 3;
// Indicator that the config is the same config as in the ConfigRequest. If set, all other fields can be unset.
bool reuse_existing_config = 4;
}

// Server side configurations.
Expand Down
23 changes: 21 additions & 2 deletions apple/swift_homomorphic_encryption/api/pir/v1/pir.proto
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ message PIRShardConfig {
message PIRConfig {
// Encryption parameters.
apple.swift_homomorphic_encryption.v1.EncryptionParameters encryption_parameters = 1;
// Configuration for each shard.
// Configuration for each shard; can be overridden by `pir_shard_configs` (field 10).
repeated PIRShardConfig shard_configs = 2;
// Parameters specific to KeywordPIR.
apple.swift_homomorphic_encryption.pir.v1.KeywordPirParameters keyword_pir_params = 3;
Expand All @@ -50,7 +50,26 @@ message PIRConfig {
uint64 batch_size = 5;
// Hash of EvaluationKeyConfig.
bytes evaluation_key_config_hash = 6;
reserved 7, 8;
reserved 7, 8, 9;
// Configuration for each shard; overrides `shard_configs` (field 2).
PIRShardConfigs pir_shard_configs = 10;
}

// Configuration for PIR shards.
message PIRShardConfigs {
// Different shard configuration formats.
oneof shard_configs {
// Repeated shard configuration.
PIRFixedShardConfig repeated_shard_config = 1;
}
}

// Every shard configuration is the same.
message PIRFixedShardConfig {
// Shard configuration for all the shards.
PIRShardConfig shard_config = 1;
// Number of shards.
uint32 shard_count = 2;
}

// PIR Request.
Expand Down
4 changes: 4 additions & 0 deletions apple/swift_homomorphic_encryption/api/pnns/v1/api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ message ConfigRequest {
// List of usecases to fetch configs for.
// When set to empty array, all configs will be returned.
repeated string usecases = 1;
// For each usecase, the existing config id, if one exists.
repeated bytes existing_config_ids = 2;
}

// Usecase configuration.
Expand All @@ -35,6 +37,8 @@ message Config {
}
// Unique identifier for the configuration.
bytes config_id = 3;
// Indicator that the config is the same config as in the ConfigRequest. If set, all other fields can be unset.
bool reuse_existing_config = 4;
}

// Server side configurations.
Expand Down
18 changes: 11 additions & 7 deletions apple/swift_homomorphic_encryption/api/v1/api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@ import "apple/swift_homomorphic_encryption/api/pir/v1/pir.proto";
import "apple/swift_homomorphic_encryption/api/pnns/v1/pnns.proto";
import "apple/swift_homomorphic_encryption/api/shared/v1/api_shared.proto";

// Request for server side configurations.
message ConfigRequest {
// List of usecases to fetch configs for.
// When set to empty array, all configs will be returned.
repeated string usecases = 1;
// For each usecase, the existing config id, if one exists.
repeated bytes existing_config_ids = 2;
}

// Usecase configuration.
message Config {
// Configuration.
Expand All @@ -30,13 +39,8 @@ message Config {
}
// Unique identifier for the configuration.
bytes config_id = 3;
}

// Request for server side configurations.
message ConfigRequest {
// List of usecases to fetch configs for.
// When set to empty array, all configs will be returned.
repeated string usecases = 1;
// Indicator that the config is the same config as in the ConfigRequest. If set, all other fields can be unset.
bool reuse_existing_config = 4;
}

// Server side configurations.
Expand Down
2 changes: 1 addition & 1 deletion apple/swift_homomorphic_encryption/pir/v1/pir.proto
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ message PirParameters {
message KeywordPirParameters {
// The number of hash functions used.
uint64 num_hash_functions = 1;
reserved 2;
reserved 2, 3, 4;
}

// Encrypted PIR index.
Expand Down