|
@@ -450,8 +450,10 @@ if __name__ == '__main__':
|
|
|
clisent = 0
|
|
|
clirecv = 0
|
|
|
|
|
|
- if len(sys.argv) < 2:
|
|
|
- print("must pass in network mode: options are vanilla, telescoping, or single-pass.")
|
|
|
+ if len(sys.argv) < 3:
|
|
|
+ print("Must pass in network mode and snip auth mode!")
|
|
|
+ print("Network options are vanilla, telescoping, or single-pass.")
|
|
|
+ print("SNIP auth options are merkle or threshold.")
|
|
|
sys.exit(0)
|
|
|
|
|
|
logging.basicConfig(level=logging.DEBUG)
|
|
@@ -461,7 +463,10 @@ if __name__ == '__main__':
|
|
|
print("Not a valid network mode: " + network_mode)
|
|
|
sys.exit(0)
|
|
|
|
|
|
- #TODO Add a command-line switch to set Merkle or Threshold
|
|
|
+ snipauth_mode = network.SNIPAuthMode.string_to_type(sys.argv[2])
|
|
|
+ if network_mode == -1:
|
|
|
+ print("Not a valid SNIP authentication mode: " + snipauth_mode)
|
|
|
+ sys.exit(0)
|
|
|
|
|
|
# Initialize the (non-cryptographic) random seed
|
|
|
random.seed(1)
|
|
@@ -470,11 +475,19 @@ if __name__ == '__main__':
|
|
|
network.thenetwork.set_wo_style(network.WOMode.VANILLA,
|
|
|
network.SNIPAuthMode.NONE)
|
|
|
elif network_mode == network.WOMode.TELESCOPING:
|
|
|
- network.thenetwork.set_wo_style(network.WOMode.TELESCOPING,
|
|
|
- network.SNIPAuthMode.MERKLE)
|
|
|
+ if snipauth_mode == network.SNIPAuthMode.MERKLE:
|
|
|
+ network.thenetwork.set_wo_style(network.WOMode.TELESCOPING,
|
|
|
+ network.SNIPAuthMode.MERKLE)
|
|
|
+ else:
|
|
|
+ network.thenetwork.set_wo_style(network.WOMode.TELESCOPING,
|
|
|
+ network.SNIPAuthMode.THRESHSIG)
|
|
|
elif network_mode == network.WOMode.SINGLEPASS:
|
|
|
- network.thenetwork.set_wo_style(network.WOMode.SINGLEPASS,
|
|
|
- network.SNIPAuthMode.MERKLE)
|
|
|
+ if snipauth_mode == network.SNIPAuthMode.MERKLE:
|
|
|
+ network.thenetwork.set_wo_style(network.WOMode.SINGLEPASS,
|
|
|
+ network.SNIPAuthMode.MERKLE)
|
|
|
+ else:
|
|
|
+ network.thenetwork.set_wo_style(network.WOMode.SINGLEPASS,
|
|
|
+ network.SNIPAuthMode.THRESHSIG)
|
|
|
else:
|
|
|
sys.exit("Received unsupported network mode, exiting.")
|
|
|
|