def bip_derive(srcClient, srcServer, hardened, index, test): clientObj = mpc_crypto.Bip32(CLIENT) serverObj = mpc_crypto.Bip32(SERVER) clientObj.initDerive(srcClient, index, hardened) serverObj.initDerive(srcServer, index, hardened) exec_client_server(clientObj, serverObj) clientObj.getDeriveResult() serverObj.getDeriveResult() assert clientObj.serialize() == test return clientObj, serverObj
def run_derive(inShare): if args.type != 'BIP32': sys.exit("Derive not supported for " + args.type) srcObj = mpc_crypto.GenericSecret(peer, inShare) with srcObj: obj = mpc_crypto.Bip32(peer) with obj: obj.initDerive(srcObj, args.index, args.hardened) exec_mpc_exchange(obj) obj.getDeriveResult() return obj.exportShare()