-
Notifications
You must be signed in to change notification settings - Fork 1
/
server_master.rb
executable file
·50 lines (38 loc) · 1.31 KB
/
server_master.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/usr/bin/env ruby
require 'optparse'
options = {:server_addr => "127.0.0.1:12345", :sys => "seal", :n => 2**16,
:d => 2, :a => 16, :t => 20}
OptionParser.new do |opts|
opts.banner = "Usage: server_master.rb [options]"
opts.on("-h", "--host HOST", "specify server addr") do |v|
options[:server_addr] = v
end
opts.on("-s", "--sys SYS", "specify system") do |v|
options[:sys] = v
end
opts.on("-n", "--num NUM", "specify exponent (2^num)") do |v|
options[:n] = 2**Integer(v)
end
opts.on("-d", "--dimension DIM", "specify dimensions") do |v|
options[:d] = Integer(v)
end
opts.on("-a", "--alpha ALPHA", "specify alpha") do |v|
options[:alpha] = Integer(v)
end
opts.on("-t", "--log_plain LOGT", "specify log of plaintext modulus") do |v|
options[:t] = Integer(v)
end
end.parse!
n = options[:n]
server_addr = options[:server_addr]
sys = options[:sys]
d = options[:d]
if sys == "seal"
t = options[:t]
puts("./target/release/server_sealpir -h #{server_addr} -n #{n} -d #{d} -t #{t}")
exec("./target/release/server_sealpir -h #{server_addr} -n #{n} -d #{d} -t #{t}")
elsif sys == "xpir"
a = options[:a]
puts("./target/release/server_xpir -h #{server_addr} -n #{n} -d #{d} -a #{a}")
exec("./target/release/server_xpir -h #{server_addr} -n #{n} -d #{d} -a #{a}")
end