-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
160 additions
and
26 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
...2d2324dcf1f8ad1b38ed3a5a911a6b2e0cecb1c0774c42c873cd6e97fd93b7e794f3f93822a4e5dd24be2.txt
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,4 @@ | ||
8a520e2b2252d2324dcf1f8ad1b38ed3a5a911a6b2e0cecb1c0774c42c873cd6e97fd93b7e794f3f93822a4e5dd24be2 | ||
1 | ||
8a520e2b2252d2324dcf1f8ad1b38ed3a5a911a6b2e0cecb1c0774c42c873cd6e97fd93b7e794f3f93822a4e5dd24be2 | ||
983cf67e18da6491185e19ee4445af3098796520fc408cbc99fb7003f290f0a002ee5e0d6c9537b8f665ded3dffd08680bd6aefb3f118964a44af5bf5e2b2852b23ae116ef6b88942dc77de8b8e1ae1d93af326508e4c889219c5d4d8f8cd253 |
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
File renamed without changes.
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,74 @@ | ||
#!/usr/bin/env python3 | ||
# -*- coding: utf-8 -*- | ||
|
||
import argparse | ||
import sys | ||
import os | ||
import argparse | ||
import getpass | ||
import sys | ||
from termcolor import colored | ||
|
||
from utils import recover | ||
from utils import genver | ||
|
||
pubkey_descriptions = { | ||
'MPC_ECDSA_SECP256K1': 'MPC_ECDSA_SECP256K1 XPUB', | ||
'MPC_EDDSA_ED25519': 'MPC_EdDSA_ED25519 extended public key (Fireblocks format)', | ||
'MPC_BLS_BLS12381': 'MPC_BLS_BLS12381 extended public key (Fireblocks format)', | ||
} | ||
|
||
privkey_descriptions = { | ||
'MPC_ECDSA_SECP256K1': 'MPC_ECDSA_SECP256K1 XPRV', | ||
'MPC_EDDSA_ED25519': 'MPC_EdDSA_ED25519 extended private key (Fireblocks format)', | ||
'MPC_BLS_BLS12381': 'MPC_BLS_BLS12381 extended private key (Fireblocks format)', | ||
} | ||
|
||
def query_yes_no(question, default="yes"): | ||
"""Ask a yes/no question via input() and return their answer. | ||
"question" is a string that is presented to the user. | ||
"default" is the presumed answer if the user just hits <Enter>. | ||
It must be "yes" (the default), "no" or None (meaning | ||
an answer is required of the user). | ||
The "answer" return value is True for "yes" or False for "no". | ||
""" | ||
valid = {"yes": True, "y": True, "ye": True, | ||
"no": False, "n": False} | ||
if default is None: | ||
prompt = " [y/n] " | ||
elif default == "yes": | ||
prompt = " [Y/n] " | ||
elif default == "no": | ||
prompt = " [y/N] " | ||
else: | ||
raise ValueError("invalid default answer: '%s'" % default) | ||
|
||
while True: | ||
sys.stdout.write(question + prompt) | ||
choice = input().lower() | ||
if default is not None and choice == '': | ||
return valid[default] | ||
elif choice in valid: | ||
return valid[choice] | ||
else: | ||
sys.stdout.write("Please respond with 'yes' or 'no' " | ||
"(or 'y' or 'n').\n") | ||
|
||
def main(): | ||
parser = argparse.ArgumentParser() #formatter_class=argparse.ArgumentDefaultsHelpFormatter) | ||
parser.add_argument("verification_files",type=str, nargs="+", help="space seperated list of signature share files generates by each party") | ||
parser.add_argument("-t", "--threshold", type=int, help="minimal number of shares able to reconstruct private key (if none, assume all)") | ||
parser.add_argument("-a", "--address", type=str, help="BLS public key address (if none, deduce from share files)") | ||
args = parser.parse_args() | ||
|
||
for sig_file in args.verification_files: | ||
if not os.path.exists(sig_file): | ||
print(f'Signature Share Verificaion file {sig_file} not found.') | ||
exit(-1) | ||
|
||
genver.verify_signature_shares(args.verification_files, args.threshold, args.address) | ||
|
||
if __name__ == "__main__": | ||
main() |
1 change: 1 addition & 0 deletions
1
...24dcf1f8ad1b38ed3a5a911a6b2e0cecb1c0774c42c873cd6e97fd93b7e794f3f93822a4e5dd24be2.rsa_enc
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 @@ | ||
a0febe7768f95372c0a965b62dd6dc8dcae63b3f3e17cd8ccc398d638b701fd94183fa1cf40f7d995f093f50a0a37c28b22312b20543c6effe7591475b195c4526de2c21ec3d767759579f53922c1327656d06a59f47306fe64034b1f8cff25442fa1e20294e542cc940cc72b1989fb910f9ab7c1a2852886f6b4a9bed782a59d13b402e40db5df961be081c45cbc30c61a9b3e09a1c57db537acd7d64d38b6fd2bebf3909cab47578daa00e3bc1d0a527a9d5012c8abc8c8428d6c5a7e0528f96b8c17f0c39976d8f444e32ce73fe1fb599609f3326bfccc6dfe0ff84a5ba65aa8e3da06b0a305209bea25876263e3d3fce134996e8f3707415d3d68c22b36354ad99f9a6208e41fea2166545dc60539771360e456b884d732726552ef2786104471083d692e862aaff6273a0fe18c56d39e3dbdb580606818d20772669cf347e52ea17c0f6a7193ace6ea9d4e3d174339be9a3804fcd0c8f5524ad317f8c119061e8320dec6f79cd6d104a24a29c05adb93a1b62b75791412f6ad9aa25efca54ed7dff603e94ff45b05987864f19dc2e1a2a0f686dbc079bb0b99c2a383e2e57ca47a112b755dffa6445716f5b0636008f554d389d1295b250c4409b531a97cffc97b30e7dc3a7e240f2b45ecfa0087ea9d3494bb1db6353bd4ce62345e87e3f78f7d3ddc18cb3ab3999861a82ff528f69ed72d3a8dafe38a808f3aa98e404 |
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