-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor service protos to allow 3 service types. (#11)
The service types: * PIR-only * PNNS-only * PIR and PNNS
- Loading branch information
Showing
6 changed files
with
189 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
// Copyright 2024 Apple Inc. and the Swift Homomorphic Encryption project authors | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
syntax = "proto3"; | ||
package apple.swift_homomorphic_encryption.api.pir.v1; | ||
|
||
import "apple/swift_homomorphic_encryption/api/pir/v1/pir.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; | ||
} | ||
|
||
// Usecase configuration. | ||
message Config { | ||
// Configuration. | ||
oneof config { | ||
// Configuration for a PIR usecase. | ||
apple.swift_homomorphic_encryption.api.pir.v1.PIRConfig pir_config = 1; | ||
} | ||
reserved 2; | ||
// Unique identifier for the configuration. | ||
bytes config_id = 3; | ||
} | ||
|
||
// Server side configurations. | ||
message ConfigResponse { | ||
// usecases with associated configurations. | ||
map<string, Config> configs = 1; | ||
// Configuration & status of evaluation keys. | ||
repeated apple.swift_homomorphic_encryption.api.shared.v1.KeyStatus key_info = 2; | ||
} | ||
|
||
// Container for multiple requests. | ||
message Requests { | ||
// Requests. | ||
repeated Request requests = 1; | ||
} | ||
|
||
// Container for multiple responses. | ||
message Responses { | ||
// Responses. | ||
repeated Response responses = 1; | ||
} | ||
|
||
// Generic request. | ||
message Request { | ||
// Usecase identifier. | ||
string usecase = 1; | ||
// Generic request. | ||
oneof request { | ||
// PIR request. | ||
apple.swift_homomorphic_encryption.api.pir.v1.PIRRequest pir_request = 2; | ||
} | ||
reserved 3; | ||
} | ||
|
||
// Generic response. | ||
message Response { | ||
// Generic response. | ||
oneof response { | ||
// Response to a `PIRRequest`. | ||
apple.swift_homomorphic_encryption.api.pir.v1.PIRResponse pir_response = 1; | ||
} | ||
reserved 2; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
// Copyright 2024 Apple Inc. and the Swift Homomorphic Encryption project authors | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
syntax = "proto3"; | ||
package apple.swift_homomorphic_encryption.api.pnns.v1; | ||
|
||
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; | ||
} | ||
|
||
// Usecase configuration. | ||
message Config { | ||
reserved 1; | ||
// Configuration. | ||
oneof config { | ||
// Configuration for a PNNS usecase. | ||
apple.swift_homomorphic_encryption.api.pnns.v1.PNNSConfig pnns_config = 2; | ||
} | ||
// Unique identifier for the configuration. | ||
bytes config_id = 3; | ||
} | ||
|
||
// Server side configurations. | ||
message ConfigResponse { | ||
// usecases with associated configurations. | ||
map<string, Config> configs = 1; | ||
// Configuration & status of evaluation keys. | ||
repeated apple.swift_homomorphic_encryption.api.shared.v1.KeyStatus key_info = 2; | ||
} | ||
|
||
// Container for multiple requests. | ||
message Requests { | ||
// Requests. | ||
repeated Request requests = 1; | ||
} | ||
|
||
// Container for multiple responses. | ||
message Responses { | ||
// Responses. | ||
repeated Response responses = 1; | ||
} | ||
|
||
// Generic request. | ||
message Request { | ||
// Usecase identifier. | ||
string usecase = 1; | ||
reserved 2; | ||
// Generic request. | ||
oneof request { | ||
// PNNS request. | ||
apple.swift_homomorphic_encryption.api.pnns.v1.PNNSRequest pnns_request = 3; | ||
} | ||
} | ||
|
||
// Generic response. | ||
message Response { | ||
reserved 1; | ||
// Generic response. | ||
oneof response { | ||
// Response to a `PNNSRequest`. | ||
apple.swift_homomorphic_encryption.api.pnns.v1.PNNSResponse pnns_response = 2; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters