File tree 1 file changed +27
-1
lines changed
apple/swift_homomorphic_encryption/pir/v1
1 file changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -58,7 +58,33 @@ message PirParameters {
58
58
message KeywordPirParameters {
59
59
// The number of hash functions used.
60
60
uint64 num_hash_functions = 1 ;
61
- reserved 2 , 3 , 4 ;
61
+ reserved 2 , 3 ;
62
+ // The sharding function to use.
63
+ PIRShardingFunction sharding_function = 4 ;
64
+ }
65
+
66
+ // Configuration for the sharding function.
67
+ message PIRShardingFunction {
68
+ // Sharding function to use.
69
+ oneof function {
70
+ // Sharding based on SHA256 hash of the keyword.
71
+ PIRShardingFunctionSHA256 sha256 = 1 ;
72
+ // Sharding depends on a different usecase.
73
+ PIRShardingFunctionDoubleMod double_mod = 2 ;
74
+ }
75
+ }
76
+
77
+ // SHA256 sharding function.
78
+ //
79
+ // shard_id = (truncate(SHA256(keyword)) % shard_count).
80
+ message PIRShardingFunctionSHA256 {}
81
+
82
+ // Double mod sharding function.
83
+ //
84
+ // shard_id = (truncate(SHA256(keyword)) % other_shard_count) % shard_count.
85
+ message PIRShardingFunctionDoubleMod {
86
+ // Number of shards in the other usecase.
87
+ uint32 other_shard_count = 1 ;
62
88
}
63
89
64
90
// Encrypted PIR index.
You can’t perform that action at this time.
0 commit comments