|
@@ -2,6 +2,7 @@
|
|
|
|
|
|
import random # For simulation, not cryptography!
|
|
|
import math
|
|
|
+import sys
|
|
|
|
|
|
import network
|
|
|
import dirauth
|
|
@@ -219,8 +220,6 @@ class Client:
|
|
|
# If we don't have a guard, pick one and make a channel to it
|
|
|
self.channelmgr.ensure_guard()
|
|
|
|
|
|
-
|
|
|
-
|
|
|
if __name__ == '__main__':
|
|
|
perfstats = network.PerfStats(network.EntType.NONE)
|
|
|
totsent = 0
|
|
@@ -232,8 +231,22 @@ if __name__ == '__main__':
|
|
|
clisent = 0
|
|
|
clirecv = 0
|
|
|
|
|
|
- network.thenetwork.set_wo_style(network.WOMode.TELESCOPING,
|
|
|
+ if len(sys.argv) < 2:
|
|
|
+ print("must pass in network mode: options are vanilla, telescoping, or single-pass.")
|
|
|
+ sys.exit(0)
|
|
|
+
|
|
|
+ network_mode = network.WOMode.string_to_type(sys.argv[1])
|
|
|
+ if network_mode == -1:
|
|
|
+ print("Not a valid network mode: " + network_mode)
|
|
|
+ sys.exit(0)
|
|
|
+
|
|
|
+ if network_mode == network.WOMode.VANILLA:
|
|
|
+ network.thenetwork.set_wo_style(network.WOMode.VANILLA,
|
|
|
+ network.SNIPAuthMode.THRESHSIG)
|
|
|
+ elif network_mode == network.WOMode.TELESCOPING:
|
|
|
+ network.thenetwork.set_wo_style(network.WOMode.TELESCOPING,
|
|
|
network.SNIPAuthMode.THRESHSIG)
|
|
|
+ # TODO set single-pass
|
|
|
|
|
|
# Start some dirauths
|
|
|
numdirauths = 9
|