diff --git a/.rustfmt.toml b/.rustfmt.toml new file mode 100644 index 0000000..5485717 --- /dev/null +++ b/.rustfmt.toml @@ -0,0 +1,2 @@ +hard_tabs = true +use_small_heuristics = "Off" diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..73956b5 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "trezor-api" +version = "0.0.0" +authors = ["Steven Roose "] + +[dependencies] +bitcoin = "0.14" +hid = "0.3" +secp256k1 = "0.6" +protobuf = "2.0" diff --git a/generate-protos.sh b/generate-protos.sh new file mode 100755 index 0000000..ed05b56 --- /dev/null +++ b/generate-protos.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +protoc --proto_path ./protos --rust_out ./src/protos protos/*.proto diff --git a/protos/messages-bitcoin.proto b/protos/messages-bitcoin.proto new file mode 100644 index 0000000..09173ed --- /dev/null +++ b/protos/messages-bitcoin.proto @@ -0,0 +1,243 @@ +syntax = "proto2"; +package hw.trezor.messages.bitcoin; + +// Sugar for easier handling in Java +option java_package = "com.satoshilabs.trezor.lib.protobuf"; +option java_outer_classname = "TrezorMessageBitcoin"; + +import "messages-common.proto"; + +/** + * Type of script which will be used for transaction output + */ +enum InputScriptType { + SPENDADDRESS = 0; // standard P2PKH address + SPENDMULTISIG = 1; // P2SH multisig address + EXTERNAL = 2; // reserved for external inputs (coinjoin) + SPENDWITNESS = 3; // native SegWit + SPENDP2SHWITNESS = 4; // SegWit over P2SH (backward compatible) +} + +/** + * Type of redeem script used in input + * @embed + */ +message MultisigRedeemScriptType { + repeated HDNodePathType pubkeys = 1; // pubkeys from multisig address (sorted lexicographically) + repeated bytes signatures = 2; // existing signatures for partially signed input + optional uint32 m = 3; // "m" from n, how many valid signatures is necessary for spending + /** + * Structure representing HDNode + Path + */ + message HDNodePathType { + required hw.trezor.messages.common.HDNodeType node = 1; // BIP-32 node in deserialized form + repeated uint32 address_n = 2; // BIP-32 path to derive the key from node + } +} + +/** + * Request: Ask device for public key corresponding to address_n path + * @start + * @next PublicKey + * @next Failure + */ +message GetPublicKey { + repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node + optional string ecdsa_curve_name = 2; // ECDSA curve name to use + optional bool show_display = 3; // optionally show on display before sending the result + optional string coin_name = 4 [default='Bitcoin']; // coin to use for verifying + optional InputScriptType script_type = 5 [default=SPENDADDRESS]; // used to distinguish between various address formats (non-segwit, segwit, etc.) +} + +/** + * Response: Contains public key derived from device private seed + * @end + */ +message PublicKey { + required hw.trezor.messages.common.HDNodeType node = 1; // BIP32 public node + optional string xpub = 2; // serialized form of public node +} + +/** + * Request: Ask device for address corresponding to address_n path + * @start + * @next Address + * @next Failure + */ +message GetAddress { + repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node + optional string coin_name = 2 [default='Bitcoin']; // coin to use + optional bool show_display = 3; // optionally show on display before sending the result + optional MultisigRedeemScriptType multisig = 4; // filled if we are showing a multisig address + optional InputScriptType script_type = 5 [default=SPENDADDRESS]; // used to distinguish between various address formats (non-segwit, segwit, etc.) +} + +/** + * Response: Contains address derived from device private seed + * @end + */ +message Address { + required string address = 1; // Coin address in Base58 encoding +} + +/** + * Request: Ask device to sign message + * @start + * @next MessageSignature + * @next Failure + */ +message SignMessage { + repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node + required bytes message = 2; // message to be signed + optional string coin_name = 3 [default='Bitcoin']; // coin to use for signing + optional InputScriptType script_type = 4 [default=SPENDADDRESS]; // used to distinguish between various address formats (non-segwit, segwit, etc.) +} + +/** + * Response: Signed message + * @end + */ +message MessageSignature { + optional string address = 1; // address used to sign the message + optional bytes signature = 2; // signature of the message +} + +/** + * Request: Ask device to verify message + * @start + * @next Success + * @next Failure + */ +message VerifyMessage { + optional string address = 1; // address to verify + optional bytes signature = 2; // signature to verify + optional bytes message = 3; // message to verify + optional string coin_name = 4 [default='Bitcoin']; // coin to use for verifying +} + +/** + * Request: Ask device to sign transaction + * @start + * @next TxRequest + * @next Failure + */ +message SignTx { + required uint32 outputs_count = 1; // number of transaction outputs + required uint32 inputs_count = 2; // number of transaction inputs + optional string coin_name = 3 [default='Bitcoin']; // coin to use + optional uint32 version = 4 [default=1]; // transaction version + optional uint32 lock_time = 5 [default=0]; // transaction lock_time + optional uint32 expiry = 6; // only for Decred and Zcash + optional bool overwintered = 7; // only for Zcash +} + +/** + * Response: Device asks for information for signing transaction or returns the last result + * If request_index is set, device awaits TxAck message (with fields filled in according to request_type) + * If signature_index is set, 'signature' contains signed input of signature_index's input + * @end + * @next TxAck + */ +message TxRequest { + optional RequestType request_type = 1; // what should be filled in TxAck message? + optional TxRequestDetailsType details = 2; // request for tx details + optional TxRequestSerializedType serialized = 3; // serialized data and request for next + /** + * Type of information required by transaction signing process + */ + enum RequestType { + TXINPUT = 0; + TXOUTPUT = 1; + TXMETA = 2; + TXFINISHED = 3; + TXEXTRADATA = 4; + } + /** + * Structure representing request details + */ + message TxRequestDetailsType { + optional uint32 request_index = 1; // device expects TxAck message from the computer + optional bytes tx_hash = 2; // tx_hash of requested transaction + optional uint32 extra_data_len = 3; // length of requested extra data + optional uint32 extra_data_offset = 4; // offset of requested extra data + } + /** + * Structure representing serialized data + */ + message TxRequestSerializedType { + optional uint32 signature_index = 1; // 'signature' field contains signed input of this index + optional bytes signature = 2; // signature of the signature_index input + optional bytes serialized_tx = 3; // part of serialized and signed transaction + } +} + +/** + * Request: Reported transaction data + * @next TxRequest + */ +message TxAck { + optional TransactionType tx = 1; + /** + * Structure representing transaction + */ + message TransactionType { + optional uint32 version = 1; + repeated TxInputType inputs = 2; + repeated TxOutputBinType bin_outputs = 3; + optional uint32 lock_time = 4; + repeated TxOutputType outputs = 5; + optional uint32 inputs_cnt = 6; + optional uint32 outputs_cnt = 7; + optional bytes extra_data = 8; // only for Zcash + optional uint32 extra_data_len = 9; // only for Zcash + optional uint32 expiry = 10; // only for Decred and Zcash + optional bool overwintered = 11; // only for Zcash + /** + * Structure representing transaction input + */ + message TxInputType { + repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node + required bytes prev_hash = 2; // hash of previous transaction output to spend by this input + required uint32 prev_index = 3; // index of previous output to spend + optional bytes script_sig = 4; // script signature, unset for tx to sign + optional uint32 sequence = 5 [default=4294967295]; // sequence (default=0xffffffff) + optional InputScriptType script_type = 6 [default=SPENDADDRESS]; // defines template of input script + optional MultisigRedeemScriptType multisig = 7; // Filled if input is going to spend multisig tx + optional uint64 amount = 8; // amount of previous transaction output (for segwit only) + optional uint32 decred_tree = 9; + optional uint32 decred_script_version = 10; + optional bytes prev_block_hash_bip115 = 11; // block hash of previous transaction output (for bip115 implementation) + optional uint32 prev_block_height_bip115 = 12; // block height of previous transaction output (for bip115 implementation) + } + /** + * Structure representing compiled transaction output + */ + message TxOutputBinType { + required uint64 amount = 1; + required bytes script_pubkey = 2; + optional uint32 decred_script_version = 3; + } + /** + * Structure representing transaction output + */ + message TxOutputType { + optional string address = 1; // target coin address in Base58 encoding + repeated uint32 address_n = 2; // BIP-32 path to derive the key from master node; has higher priority than "address" + required uint64 amount = 3; // amount to spend in satoshis + required OutputScriptType script_type = 4; // output script type + optional MultisigRedeemScriptType multisig = 5; // defines multisig address; script_type must be PAYTOMULTISIG + optional bytes op_return_data = 6; // defines op_return data; script_type must be PAYTOOPRETURN, amount must be 0 + optional uint32 decred_script_version = 7; + optional bytes block_hash_bip115 = 8; // block hash of existing block (recommended current_block - 300) (for bip115 implementation) + optional uint32 block_height_bip115 = 9; // block height of existing block (recommended current_block - 300) (for bip115 implementation) + enum OutputScriptType { + PAYTOADDRESS = 0; // used for all addresses (bitcoin, p2sh, witness) + PAYTOSCRIPTHASH = 1; // p2sh address (deprecated; use PAYTOADDRESS) + PAYTOMULTISIG = 2; // only for change output + PAYTOOPRETURN = 3; // op_return + PAYTOWITNESS = 4; // only for change output + PAYTOP2SHWITNESS = 5; // only for change output + } + } + } +} diff --git a/protos/messages-bootloader.proto b/protos/messages-bootloader.proto new file mode 100644 index 0000000..7151a8e --- /dev/null +++ b/protos/messages-bootloader.proto @@ -0,0 +1,44 @@ +syntax = "proto2"; +package hw.trezor.messages.bootloader; + +// Sugar for easier handling in Java +option java_package = "com.satoshilabs.trezor.lib.protobuf"; +option java_outer_classname = "TrezorMessageBootloader"; + +/** + * Request: Ask device to erase its firmware (so it can be replaced via FirmwareUpload) + * @start + * @next FirmwareRequest + */ +message FirmwareErase { + optional uint32 length = 1; // length of new firmware +} + +/** + * Response: Ask for firmware chunk + * @next FirmwareUpload + */ +message FirmwareRequest { + optional uint32 offset = 1; // offset of requested firmware chunk + optional uint32 length = 2; // length of requested firmware chunk +} + +/** + * Request: Send firmware in binary form to the device + * @next FirmwareRequest + * @next Success + * @next Failure + */ +message FirmwareUpload { + required bytes payload = 1; // firmware to be loaded into device + optional bytes hash = 2; // hash of the payload +} + +/** + * Request: Perform a device self-test + * @next Success + * @next Failure + */ +message SelfTest { + optional bytes payload = 1; // payload to be used in self-test +} diff --git a/protos/messages-common.proto b/protos/messages-common.proto new file mode 100644 index 0000000..0e23c87 --- /dev/null +++ b/protos/messages-common.proto @@ -0,0 +1,143 @@ +syntax = "proto2"; +package hw.trezor.messages.common; + +/** + * Response: Success of the previous request + * @end + */ +message Success { + optional string message = 1; // human readable description of action or request-specific payload +} + +/** + * Response: Failure of the previous request + * @end + */ +message Failure { + optional FailureType code = 1; // computer-readable definition of the error state + optional string message = 2; // human-readable message of the error state + enum FailureType { + Failure_UnexpectedMessage = 1; + Failure_ButtonExpected = 2; + Failure_DataError = 3; + Failure_ActionCancelled = 4; + Failure_PinExpected = 5; + Failure_PinCancelled = 6; + Failure_PinInvalid = 7; + Failure_InvalidSignature = 8; + Failure_ProcessError = 9; + Failure_NotEnoughFunds = 10; + Failure_NotInitialized = 11; + Failure_PinMismatch = 12; + Failure_FirmwareError = 99; + } +} + +/** + * Response: Device is waiting for HW button press. + * @auxstart + * @next ButtonAck + */ +message ButtonRequest { + optional ButtonRequestType code = 1; + optional string data = 2; + /** + * Type of button request + */ + enum ButtonRequestType { + ButtonRequest_Other = 1; + ButtonRequest_FeeOverThreshold = 2; + ButtonRequest_ConfirmOutput = 3; + ButtonRequest_ResetDevice = 4; + ButtonRequest_ConfirmWord = 5; + ButtonRequest_WipeDevice = 6; + ButtonRequest_ProtectCall = 7; + ButtonRequest_SignTx = 8; + ButtonRequest_FirmwareCheck = 9; + ButtonRequest_Address = 10; + ButtonRequest_PublicKey = 11; + ButtonRequest_MnemonicWordCount = 12; + ButtonRequest_MnemonicInput = 13; + ButtonRequest_PassphraseType = 14; + ButtonRequest_UnknownDerivationPath = 15; + } +} + +/** + * Request: Computer agrees to wait for HW button press + * @auxend + */ +message ButtonAck { +} + +/** + * Response: Device is asking computer to show PIN matrix and awaits PIN encoded using this matrix scheme + * @auxstart + * @next PinMatrixAck + */ +message PinMatrixRequest { + optional PinMatrixRequestType type = 1; + /** + * Type of PIN request + */ + enum PinMatrixRequestType { + PinMatrixRequestType_Current = 1; + PinMatrixRequestType_NewFirst = 2; + PinMatrixRequestType_NewSecond = 3; + } +} + +/** + * Request: Computer responds with encoded PIN + * @auxend + */ +message PinMatrixAck { + required string pin = 1; // matrix encoded PIN entered by user +} + +/** + * Response: Device awaits encryption passphrase + * @auxstart + * @next PassphraseAck + */ +message PassphraseRequest { + optional bool on_device = 1; // passphrase is being entered on the device +} + +/** + * Request: Send passphrase back + * @next PassphraseStateRequest + */ +message PassphraseAck { + optional string passphrase = 1; + optional bytes state = 2; // expected device state +} + +/** + * Response: Device awaits passphrase state + * @next PassphraseStateAck + */ +message PassphraseStateRequest { + optional bytes state = 1; // actual device state +} + +/** + * Request: Send passphrase state back + * @auxend + */ +message PassphraseStateAck { +} + +/** + * Structure representing BIP32 (hierarchical deterministic) node + * Used for imports of private key into the device and exporting public key out of device + * @embed + */ +message HDNodeType { + required uint32 depth = 1; + required uint32 fingerprint = 2; + required uint32 child_num = 3; + required bytes chain_code = 4; + optional bytes private_key = 5; + optional bytes public_key = 6; +} diff --git a/protos/messages-crypto.proto b/protos/messages-crypto.proto new file mode 100644 index 0000000..8841fbc --- /dev/null +++ b/protos/messages-crypto.proto @@ -0,0 +1,127 @@ +syntax = "proto2"; +package hw.trezor.messages.crypto; + +// Sugar for easier handling in Java +option java_package = "com.satoshilabs.trezor.lib.protobuf"; +option java_outer_classname = "TrezorMessageCrypto"; + +/** + * Request: Ask device to encrypt or decrypt value of given key + * @start + * @next CipheredKeyValue + * @next Failure + */ +message CipherKeyValue { + repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node + optional string key = 2; // key component of key:value + optional bytes value = 3; // value component of key:value + optional bool encrypt = 4; // are we encrypting (True) or decrypting (False)? + optional bool ask_on_encrypt = 5; // should we ask on encrypt operation? + optional bool ask_on_decrypt = 6; // should we ask on decrypt operation? + optional bytes iv = 7; // initialization vector (will be computed if not set) +} + +/** + * Response: Return ciphered/deciphered value + * @end + */ +message CipheredKeyValue { + optional bytes value = 1; // ciphered/deciphered value +} + +/** + * Structure representing identity data + * @embed + */ +message IdentityType { + optional string proto = 1; // proto part of URI + optional string user = 2; // user part of URI + optional string host = 3; // host part of URI + optional string port = 4; // port part of URI + optional string path = 5; // path part of URI + optional uint32 index = 6 [default=0]; // identity index +} + +/** + * Request: Ask device to sign identity + * @start + * @next SignedIdentity + * @next Failure + */ +message SignIdentity { + optional IdentityType identity = 1; // identity + optional bytes challenge_hidden = 2; // non-visible challenge + optional string challenge_visual = 3; // challenge shown on display (e.g. date+time) + optional string ecdsa_curve_name = 4; // ECDSA curve name to use +} + +/** + * Response: Device provides signed identity + * @end + */ +message SignedIdentity { + optional string address = 1; // identity address + optional bytes public_key = 2; // identity public key + optional bytes signature = 3; // signature of the identity data +} + +/** + * Request: Ask device to generate ECDH session key + * @start + * @next ECDHSessionKey + * @next Failure + */ +message GetECDHSessionKey { + optional IdentityType identity = 1; // identity + optional bytes peer_public_key = 2; // peer's public key + optional string ecdsa_curve_name = 3; // ECDSA curve name to use +} + +/** + * Response: Device provides ECDH session key + * @end + */ +message ECDHSessionKey { + optional bytes session_key = 1; // ECDH session key +} + +/** + * Request: Ask device to commit to CoSi signing + * @start + * @next CosiCommitment + * @next Failure + */ +message CosiCommit { + repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node + optional bytes data = 2; // Data to be signed +} + +/** + * Response: Contains a CoSi commitment + * @end + */ +message CosiCommitment { + optional bytes commitment = 1; // Commitment + optional bytes pubkey = 2; // Public key +} + +/** + * Request: Ask device to sign using CoSi + * @start + * @next CosiSignature + * @next Failure + */ +message CosiSign { + repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node + optional bytes data = 2; // Data to be signed + optional bytes global_commitment = 3; // Aggregated commitment + optional bytes global_pubkey = 4; // Aggregated public key +} + +/** + * Response: Contains a CoSi signature + * @end + */ +message CosiSignature { + optional bytes signature = 1; // Signature +} diff --git a/protos/messages-debug.proto b/protos/messages-debug.proto new file mode 100644 index 0000000..6c6e415 --- /dev/null +++ b/protos/messages-debug.proto @@ -0,0 +1,104 @@ +syntax = "proto2"; +package hw.trezor.messages.debug; + +// Sugar for easier handling in Java +option java_package = "com.satoshilabs.trezor.lib.protobuf"; +option java_outer_classname = "TrezorMessageDebug"; + +import "messages-common.proto"; + +/** + * Request: "Press" the button on the device + * @start + * @next Success + */ +message DebugLinkDecision { + optional bool yes_no = 1; // true for "Confirm", false for "Cancel" + optional bool up_down = 2; // true for scroll up, false for scroll down + optional string input = 3; // keyboard input +} + +/** + * Request: Computer asks for device state + * @start + * @next DebugLinkState + */ +message DebugLinkGetState { +} + +/** + * Response: Device current state + * @end + */ +message DebugLinkState { + optional bytes layout = 1; // raw buffer of display + optional string pin = 2; // current PIN, blank if PIN is not set/enabled + optional string matrix = 3; // current PIN matrix + optional string mnemonic = 4; // current BIP-39 mnemonic + optional hw.trezor.messages.common.HDNodeType node = 5; // current BIP-32 node + optional bool passphrase_protection = 6; // is node/mnemonic encrypted using passphrase? + optional string reset_word = 7; // word on device display during ResetDevice workflow + optional bytes reset_entropy = 8; // current entropy during ResetDevice workflow + optional string recovery_fake_word = 9; // (fake) word on display during RecoveryDevice workflow + optional uint32 recovery_word_pos = 10; // index of mnemonic word the device is expecting during RecoveryDevice workflow + optional uint32 reset_word_pos = 11; // index of mnemonic word the device is expecting during ResetDevice workflow +} + +/** + * Request: Ask device to restart + * @start + */ +message DebugLinkStop { +} + +/** + * Response: Device wants host to log event + * @ignore + */ +message DebugLinkLog { + optional uint32 level = 1; + optional string bucket = 2; + optional string text = 3; +} + +/** + * Request: Read memory from device + * @start + * @next DebugLinkMemory + */ +message DebugLinkMemoryRead { + optional uint32 address = 1; + optional uint32 length = 2; +} + +/** + * Response: Device sends memory back + * @end + */ +message DebugLinkMemory { + optional bytes memory = 1; +} + +/** + * Request: Write memory to device. + * WARNING: Writing to the wrong location can irreparably break the device. + * @start + * @next Success + * @next Failure + */ +message DebugLinkMemoryWrite { + optional uint32 address = 1; + optional bytes memory = 2; + optional bool flash = 3; +} + +/** + * Request: Erase block of flash on device + * WARNING: Writing to the wrong location can irreparably break the device. + * @start + * @next Success + * @next Failure + */ +message DebugLinkFlashErase { + optional uint32 sector = 1; +} diff --git a/protos/messages-management.proto b/protos/messages-management.proto new file mode 100644 index 0000000..edf78f2 --- /dev/null +++ b/protos/messages-management.proto @@ -0,0 +1,284 @@ +syntax = "proto2"; +package hw.trezor.messages.management; + +// Sugar for easier handling in Java +option java_package = "com.satoshilabs.trezor.lib.protobuf"; +option java_outer_classname = "TrezorMessageManagement"; + +import "messages-common.proto"; + +/** + * Request: Reset device to default state and ask for device details + * @start + * @next Features + */ +message Initialize { + optional bytes state = 1; // assumed device state, clear session if set and different + optional bool skip_passphrase = 2; // this session should always assume empty passphrase +} + +/** + * Request: Ask for device details (no device reset) + * @start + * @next Features + */ +message GetFeatures { +} + +/** + * Response: Reports various information about the device + * @end + */ +message Features { + optional string vendor = 1; // name of the manufacturer, e.g. "trezor.io" + optional uint32 major_version = 2; // major version of the firmware/bootloader, e.g. 1 + optional uint32 minor_version = 3; // minor version of the firmware/bootloader, e.g. 0 + optional uint32 patch_version = 4; // patch version of the firmware/bootloader, e.g. 0 + optional bool bootloader_mode = 5; // is device in bootloader mode? + optional string device_id = 6; // device's unique identifier + optional bool pin_protection = 7; // is device protected by PIN? + optional bool passphrase_protection = 8; // is node/mnemonic encrypted using passphrase? + optional string language = 9; // device language + optional string label = 10; // device description label + optional bool initialized = 12; // does device contain seed? + optional bytes revision = 13; // SCM revision of firmware + optional bytes bootloader_hash = 14; // hash of the bootloader + optional bool imported = 15; // was storage imported from an external source? + optional bool pin_cached = 16; // is PIN already cached in session? + optional bool passphrase_cached = 17; // is passphrase already cached in session? + optional bool firmware_present = 18; // is valid firmware loaded? + optional bool needs_backup = 19; // does storage need backup? (equals to Storage.needs_backup) + optional uint32 flags = 20; // device flags (equals to Storage.flags) + optional string model = 21; // device hardware model + optional uint32 fw_major = 22; // reported firmware version if in bootloader mode + optional uint32 fw_minor = 23; // reported firmware version if in bootloader mode + optional uint32 fw_patch = 24; // reported firmware version if in bootloader mode + optional string fw_vendor = 25; // reported firmware vendor if in bootloader mode + optional bytes fw_vendor_keys = 26; // reported firmware vendor keys (their hash) + optional bool unfinished_backup = 27; // report unfinished backup (equals to Storage.unfinished_backup) + optional bool no_backup = 28; // report no backup (equals to Storage.no_backup) +} + +/** + * Request: clear session (removes cached PIN, passphrase, etc). + * @start + * @next Success + */ +message ClearSession { +} + +/** + * Request: change language and/or label of the device + * @start + * @next Success + * @next Failure + */ +message ApplySettings { + optional string language = 1; + optional string label = 2; + optional bool use_passphrase = 3; + optional bytes homescreen = 4; + optional PassphraseSourceType passphrase_source = 5; + optional uint32 auto_lock_delay_ms = 6; + /** + * Structure representing passphrase source + */ + enum PassphraseSourceType { + ASK = 0; + DEVICE = 1; + HOST = 2; + } +} + +/** + * Request: set flags of the device + * @start + * @next Success + * @next Failure + */ +message ApplyFlags { + optional uint32 flags = 1; // bitmask, can only set bits, not unset +} + +/** + * Request: Starts workflow for setting/changing/removing the PIN + * @start + * @next Success + * @next Failure + */ +message ChangePin { + optional bool remove = 1; // is PIN removal requested? +} + +/** + * Request: Test if the device is alive, device sends back the message in Success response + * @start + * @next Success + */ +message Ping { + optional string message = 1; // message to send back in Success message + optional bool button_protection = 2; // ask for button press + optional bool pin_protection = 3; // ask for PIN if set in device + optional bool passphrase_protection = 4; // ask for passphrase if set in device +} + +/** + * Request: Abort last operation that required user interaction + * @start + * @next Failure + */ +message Cancel { +} + +/** + * Request: Request a sample of random data generated by hardware RNG. May be used for testing. + * @start + * @next Entropy + * @next Failure + */ +message GetEntropy { + required uint32 size = 1; // size of requested entropy +} + +/** + * Response: Reply with random data generated by internal RNG + * @end + */ +message Entropy { + required bytes entropy = 1; // chunk of random generated bytes +} + +/** + * Request: Request device to wipe all sensitive data and settings + * @start + * @next Success + * @next Failure + */ +message WipeDevice { +} + +/** + * Request: Load seed and related internal settings from the computer + * @start + * @next Success + * @next Failure + */ +message LoadDevice { + optional string mnemonic = 1; // seed encoded as BIP-39 mnemonic (12, 18 or 24 words) + optional hw.trezor.messages.common.HDNodeType node = 2; // BIP-32 node + optional string pin = 3; // set PIN protection + optional bool passphrase_protection = 4; // enable master node encryption using passphrase + optional string language = 5 [default='english']; // device language + optional string label = 6; // device label + optional bool skip_checksum = 7; // do not test mnemonic for valid BIP-39 checksum + optional uint32 u2f_counter = 8; // U2F counter +} + +/** + * Request: Ask device to do initialization involving user interaction + * @start + * @next EntropyRequest + * @next Failure + */ +message ResetDevice { + optional bool display_random = 1; // display entropy generated by the device before asking for additional entropy + optional uint32 strength = 2 [default=256]; // strength of seed in bits + optional bool passphrase_protection = 3; // enable master node encryption using passphrase + optional bool pin_protection = 4; // enable PIN protection + optional string language = 5 [default='english']; // device language + optional string label = 6; // device label + optional uint32 u2f_counter = 7; // U2F counter + optional bool skip_backup = 8; // postpone seed backup to BackupDevice workflow + optional bool no_backup = 9; // indicate that no backup is going to be made +} + +/** + * Request: Perform backup of the device seed if not backed up using ResetDevice + * @start + * @next Success + */ +message BackupDevice { +} + +/** + * Response: Ask for additional entropy from host computer + * @next EntropyAck + */ +message EntropyRequest { +} + +/** + * Request: Provide additional entropy for seed generation function + * @next Success + */ +message EntropyAck { + optional bytes entropy = 1; // 256 bits (32 bytes) of random data +} + +/** + * Request: Start recovery workflow asking user for specific words of mnemonic + * Used to recovery device safely even on untrusted computer. + * @start + * @next WordRequest + */ +message RecoveryDevice { + optional uint32 word_count = 1; // number of words in BIP-39 mnemonic + optional bool passphrase_protection = 2; // enable master node encryption using passphrase + optional bool pin_protection = 3; // enable PIN protection + optional string language = 4 [default='english']; // device language + optional string label = 5; // device label + optional bool enforce_wordlist = 6; // enforce BIP-39 wordlist during the process + // 7 reserved for unused recovery method + optional RecoveryDeviceType type = 8; // supported recovery type + optional uint32 u2f_counter = 9; // U2F counter + optional bool dry_run = 10; // perform dry-run recovery workflow (for safe mnemonic validation) + /** + * Type of recovery procedure. These should be used as bitmask, e.g., + * `RecoveryDeviceType_ScrambledWords | RecoveryDeviceType_Matrix` + * listing every method supported by the host computer. + * + * Note that ScrambledWords must be supported by every implementation + * for backward compatibility; there is no way to not support it. + */ + enum RecoveryDeviceType { + // use powers of two when extending this field + RecoveryDeviceType_ScrambledWords = 0; // words in scrambled order + RecoveryDeviceType_Matrix = 1; // matrix recovery type + } +} + +/** + * Response: Device is waiting for user to enter word of the mnemonic + * Its position is shown only on device's internal display. + * @next WordAck + */ +message WordRequest { + optional WordRequestType type = 1; + /** + * Type of Recovery Word request + */ + enum WordRequestType { + WordRequestType_Plain = 0; + WordRequestType_Matrix9 = 1; + WordRequestType_Matrix6 = 2; + } +} + +/** + * Request: Computer replies with word from the mnemonic + * @next WordRequest + * @next Success + * @next Failure + */ +message WordAck { + required string word = 1; // one word of mnemonic on asked position +} + +/** + * Request: Set U2F counter + * @start + * @next Success + */ +message SetU2FCounter { + optional uint32 u2f_counter = 1; // counter +} diff --git a/protos/messages.proto b/protos/messages.proto new file mode 100644 index 0000000..fb90f18 --- /dev/null +++ b/protos/messages.proto @@ -0,0 +1,232 @@ +syntax = "proto2"; +package hw.trezor.messages; + +/** + * Messages for TREZOR communication + */ + +// Sugar for easier handling in Java +option java_package = "com.satoshilabs.trezor.lib.protobuf"; +option java_outer_classname = "TrezorMessage"; + +import "google/protobuf/descriptor.proto"; + +/** + * Options for specifying message direction and type of wire (normal/debug) + */ +extend google.protobuf.EnumValueOptions { + optional bool wire_in = 50002; // message can be transmitted via wire from PC to TREZOR + optional bool wire_out = 50003; // message can be transmitted via wire from TREZOR to PC + optional bool wire_debug_in = 50004; // message can be transmitted via debug wire from PC to TREZOR + optional bool wire_debug_out = 50005; // message can be transmitted via debug wire from TREZOR to PC + optional bool wire_tiny = 50006; // message is handled by TREZOR when the USB stack is in tiny mode + optional bool wire_bootloader = 50007; // message is only handled by TREZOR Bootloader + optional bool wire_no_fsm = 50008; // message is not handled by TREZOR unless the USB stack is in tiny mode +} + +/** + * Mapping between TREZOR wire identifier (uint) and a protobuf message + */ +enum MessageType { + + // Management + MessageType_Initialize = 0 [(wire_in) = true, (wire_tiny) = true]; + MessageType_Ping = 1 [(wire_in) = true]; + MessageType_Success = 2 [(wire_out) = true]; + MessageType_Failure = 3 [(wire_out) = true]; + MessageType_ChangePin = 4 [(wire_in) = true]; + MessageType_WipeDevice = 5 [(wire_in) = true]; + MessageType_GetEntropy = 9 [(wire_in) = true]; + MessageType_Entropy = 10 [(wire_out) = true]; + MessageType_LoadDevice = 13 [(wire_in) = true]; + MessageType_ResetDevice = 14 [(wire_in) = true]; + MessageType_Features = 17 [(wire_out) = true]; + MessageType_PinMatrixRequest = 18 [(wire_out) = true]; + MessageType_PinMatrixAck = 19 [(wire_in) = true, (wire_tiny) = true, (wire_no_fsm) = true]; + MessageType_Cancel = 20 [(wire_in) = true, (wire_tiny) = true]; + MessageType_ClearSession = 24 [(wire_in) = true]; + MessageType_ApplySettings = 25 [(wire_in) = true]; + MessageType_ButtonRequest = 26 [(wire_out) = true]; + MessageType_ButtonAck = 27 [(wire_in) = true, (wire_tiny) = true, (wire_no_fsm) = true]; + MessageType_ApplyFlags = 28 [(wire_in) = true]; + MessageType_BackupDevice = 34 [(wire_in) = true]; + MessageType_EntropyRequest = 35 [(wire_out) = true]; + MessageType_EntropyAck = 36 [(wire_in) = true]; + MessageType_PassphraseRequest = 41 [(wire_out) = true]; + MessageType_PassphraseAck = 42 [(wire_in) = true, (wire_tiny) = true, (wire_no_fsm) = true]; + MessageType_PassphraseStateRequest = 77 [(wire_out) = true]; + MessageType_PassphraseStateAck = 78 [(wire_in) = true, (wire_tiny) = true, (wire_no_fsm) = true]; + MessageType_RecoveryDevice = 45 [(wire_in) = true]; + MessageType_WordRequest = 46 [(wire_out) = true]; + MessageType_WordAck = 47 [(wire_in) = true]; + MessageType_GetFeatures = 55 [(wire_in) = true]; + MessageType_SetU2FCounter = 63 [(wire_in) = true]; + + // Bootloader + MessageType_FirmwareErase = 6 [(wire_in) = true, (wire_bootloader) = true]; + MessageType_FirmwareUpload = 7 [(wire_in) = true, (wire_bootloader) = true]; + MessageType_FirmwareRequest = 8 [(wire_out) = true, (wire_bootloader) = true]; + MessageType_SelfTest = 32 [(wire_in) = true, (wire_bootloader) = true]; + + // Bitcoin + MessageType_GetPublicKey = 11 [(wire_in) = true]; + MessageType_PublicKey = 12 [(wire_out) = true]; + MessageType_SignTx = 15 [(wire_in) = true]; + MessageType_TxRequest = 21 [(wire_out) = true]; + MessageType_TxAck = 22 [(wire_in) = true]; + MessageType_GetAddress = 29 [(wire_in) = true]; + MessageType_Address = 30 [(wire_out) = true]; + MessageType_SignMessage = 38 [(wire_in) = true]; + MessageType_VerifyMessage = 39 [(wire_in) = true]; + MessageType_MessageSignature = 40 [(wire_out) = true]; + + // Crypto + MessageType_CipherKeyValue = 23 [(wire_in) = true]; + MessageType_CipheredKeyValue = 48 [(wire_out) = true]; + MessageType_SignIdentity = 53 [(wire_in) = true]; + MessageType_SignedIdentity = 54 [(wire_out) = true]; + MessageType_GetECDHSessionKey = 61 [(wire_in) = true]; + MessageType_ECDHSessionKey = 62 [(wire_out) = true]; + MessageType_CosiCommit = 71 [(wire_in) = true]; + MessageType_CosiCommitment = 72 [(wire_out) = true]; + MessageType_CosiSign = 73 [(wire_in) = true]; + MessageType_CosiSignature = 74 [(wire_out) = true]; + + // Debug + MessageType_DebugLinkDecision = 100 [(wire_debug_in) = true, (wire_tiny) = true, (wire_no_fsm) = true]; + MessageType_DebugLinkGetState = 101 [(wire_debug_in) = true, (wire_tiny) = true]; + MessageType_DebugLinkState = 102 [(wire_debug_out) = true]; + MessageType_DebugLinkStop = 103 [(wire_debug_in) = true]; + MessageType_DebugLinkLog = 104 [(wire_debug_out) = true]; + MessageType_DebugLinkMemoryRead = 110 [(wire_debug_in) = true]; + MessageType_DebugLinkMemory = 111 [(wire_debug_out) = true]; + MessageType_DebugLinkMemoryWrite = 112 [(wire_debug_in) = true]; + MessageType_DebugLinkFlashErase = 113 [(wire_debug_in) = true]; + + // Ethereum + MessageType_EthereumGetAddress = 56 [(wire_in) = true]; + MessageType_EthereumAddress = 57 [(wire_out) = true]; + MessageType_EthereumSignTx = 58 [(wire_in) = true]; + MessageType_EthereumTxRequest = 59 [(wire_out) = true]; + MessageType_EthereumTxAck = 60 [(wire_in) = true]; + MessageType_EthereumSignMessage = 64 [(wire_in) = true]; + MessageType_EthereumVerifyMessage = 65 [(wire_in) = true]; + MessageType_EthereumMessageSignature = 66 [(wire_out) = true]; + + // NEM + MessageType_NEMGetAddress = 67 [(wire_in) = true]; + MessageType_NEMAddress = 68 [(wire_out) = true]; + MessageType_NEMSignTx = 69 [(wire_in) = true]; + MessageType_NEMSignedTx = 70 [(wire_out) = true]; + MessageType_NEMDecryptMessage = 75 [(wire_in) = true]; + MessageType_NEMDecryptedMessage = 76 [(wire_out) = true]; + + // Lisk + MessageType_LiskGetAddress = 114 [(wire_in) = true]; + MessageType_LiskAddress = 115 [(wire_out) = true]; + MessageType_LiskSignTx = 116 [(wire_in) = true]; + MessageType_LiskSignedTx = 117 [(wire_out) = true]; + MessageType_LiskSignMessage = 118 [(wire_in) = true]; + MessageType_LiskMessageSignature = 119 [(wire_out) = true]; + MessageType_LiskVerifyMessage = 120 [(wire_in) = true]; + MessageType_LiskGetPublicKey = 121 [(wire_in) = true]; + MessageType_LiskPublicKey = 122 [(wire_out) = true]; + + // Tezos + MessageType_TezosGetAddress = 150 [(wire_in) = true]; + MessageType_TezosAddress = 151 [(wire_out) = true]; + MessageType_TezosSignTx = 152 [(wire_in) = true]; + MessageType_TezosSignedTx = 153 [(wire_out) = true]; + MessageType_TezosGetPublicKey = 154 [(wire_in) = true]; + MessageType_TezosPublicKey = 155 [(wire_out) = true]; + + // Stellar + MessageType_StellarSignTx = 202 [(wire_in) = true]; + MessageType_StellarTxOpRequest = 203 [(wire_out) = true]; + MessageType_StellarGetAddress = 207 [(wire_in) = true]; + MessageType_StellarAddress = 208 [(wire_out) = true]; + MessageType_StellarCreateAccountOp = 210 [(wire_in) = true]; + MessageType_StellarPaymentOp = 211 [(wire_in) = true]; + MessageType_StellarPathPaymentOp = 212 [(wire_in) = true]; + MessageType_StellarManageOfferOp = 213 [(wire_in) = true]; + MessageType_StellarCreatePassiveOfferOp = 214 [(wire_in) = true]; + MessageType_StellarSetOptionsOp = 215 [(wire_in) = true]; + MessageType_StellarChangeTrustOp = 216 [(wire_in) = true]; + MessageType_StellarAllowTrustOp = 217 [(wire_in) = true]; + MessageType_StellarAccountMergeOp = 218 [(wire_in) = true]; + // omitted: StellarInflationOp is not a supported operation, would be 219 + MessageType_StellarManageDataOp = 220 [(wire_in) = true]; + MessageType_StellarBumpSequenceOp = 221 [(wire_in) = true]; + MessageType_StellarSignedTx = 230 [(wire_out) = true]; + + // TRON + MessageType_TronGetAddress = 250 [(wire_in) = true]; + MessageType_TronAddress = 251 [(wire_out) = true]; + MessageType_TronSignTx = 252 [(wire_in) = true]; + MessageType_TronSignedTx = 253 [(wire_out) = true]; + + // Cardano + // dropped Sign/VerifyMessage ids 300-302 + MessageType_CardanoSignTx = 303 [(wire_in) = true]; + MessageType_CardanoTxRequest = 304 [(wire_out) = true]; + MessageType_CardanoGetPublicKey = 305 [(wire_in) = true]; + MessageType_CardanoPublicKey = 306 [(wire_out) = true]; + MessageType_CardanoGetAddress = 307 [(wire_in) = true]; + MessageType_CardanoAddress = 308 [(wire_out) = true]; + MessageType_CardanoTxAck = 309 [(wire_in) = true]; + MessageType_CardanoSignedTx = 310 [(wire_out) = true]; + + // Ontology + MessageType_OntologyGetAddress = 350 [(wire_in) = true]; + MessageType_OntologyAddress = 351 [(wire_out) = true]; + MessageType_OntologyGetPublicKey = 352 [(wire_in) = true]; + MessageType_OntologyPublicKey = 353 [(wire_out) = true]; + MessageType_OntologySignTransfer = 354 [(wire_in) = true]; + MessageType_OntologySignedTransfer = 355 [(wire_out) = true]; + MessageType_OntologySignWithdrawOng = 356 [(wire_in) = true]; + MessageType_OntologySignedWithdrawOng = 357 [(wire_out) = true]; + MessageType_OntologySignOntIdRegister = 358 [(wire_in) = true]; + MessageType_OntologySignedOntIdRegister = 359 [(wire_out) = true]; + MessageType_OntologySignOntIdAddAttributes = 360 [(wire_in) = true]; + MessageType_OntologySignedOntIdAddAttributes = 361 [(wire_out) = true]; + + // Ripple + MessageType_RippleGetAddress = 400 [(wire_in) = true]; + MessageType_RippleAddress = 401 [(wire_out) = true]; + MessageType_RippleSignTx = 402 [(wire_in) = true]; + MessageType_RippleSignedTx = 403 [(wire_in) = true]; + + // Monero + MessageType_MoneroTransactionInitRequest = 501 [(wire_out) = true]; + MessageType_MoneroTransactionInitAck = 502 [(wire_out) = true]; + MessageType_MoneroTransactionSetInputRequest = 503 [(wire_out) = true]; + MessageType_MoneroTransactionSetInputAck = 504 [(wire_out) = true]; + MessageType_MoneroTransactionInputsPermutationRequest = 505 [(wire_out) = true]; + MessageType_MoneroTransactionInputsPermutationAck = 506 [(wire_out) = true]; + MessageType_MoneroTransactionInputViniRequest = 507 [(wire_out) = true]; + MessageType_MoneroTransactionInputViniAck = 508 [(wire_out) = true]; + MessageType_MoneroTransactionAllInputsSetRequest = 509 [(wire_out) = true]; + MessageType_MoneroTransactionAllInputsSetAck = 510 [(wire_out) = true]; + MessageType_MoneroTransactionSetOutputRequest = 511 [(wire_out) = true]; + MessageType_MoneroTransactionSetOutputAck = 512 [(wire_out) = true]; + MessageType_MoneroTransactionAllOutSetRequest = 513 [(wire_out) = true]; + MessageType_MoneroTransactionAllOutSetAck = 514 [(wire_out) = true]; + MessageType_MoneroTransactionMlsagDoneRequest = 515 [(wire_out) = true]; + MessageType_MoneroTransactionMlsagDoneAck = 516 [(wire_out) = true]; + MessageType_MoneroTransactionSignInputRequest = 517 [(wire_out) = true]; + MessageType_MoneroTransactionSignInputAck = 518 [(wire_out) = true]; + MessageType_MoneroTransactionFinalRequest = 519 [(wire_out) = true]; + MessageType_MoneroTransactionFinalAck = 520 [(wire_out) = true]; + MessageType_MoneroKeyImageExportInitRequest = 530 [(wire_out) = true]; + MessageType_MoneroKeyImageExportInitAck = 531 [(wire_out) = true]; + MessageType_MoneroKeyImageSyncStepRequest = 532 [(wire_out) = true]; + MessageType_MoneroKeyImageSyncStepAck = 533 [(wire_out) = true]; + MessageType_MoneroKeyImageSyncFinalRequest = 534 [(wire_out) = true]; + MessageType_MoneroKeyImageSyncFinalAck = 535 [(wire_out) = true]; + MessageType_MoneroGetAddress = 540 [(wire_in) = true]; + MessageType_MoneroAddress = 541 [(wire_out) = true]; + MessageType_MoneroGetWatchKey = 542 [(wire_in) = true]; + MessageType_MoneroWatchKey = 543 [(wire_out) = true]; + MessageType_DebugMoneroDiagRequest = 546 [(wire_in) = true]; + MessageType_DebugMoneroDiagAck = 547 [(wire_out) = true]; +} diff --git a/src/bin/test.rs b/src/bin/test.rs new file mode 100644 index 0000000..bad4528 --- /dev/null +++ b/src/bin/test.rs @@ -0,0 +1,6 @@ +extern crate trezor_api; + +fn main() { + let trezors = trezor_api::find_devices(); + println!("{:?}", trezors); +} diff --git a/src/constants.rs b/src/constants.rs new file mode 100644 index 0000000..b3def79 --- /dev/null +++ b/src/constants.rs @@ -0,0 +1,11 @@ +/// HID-related constants. +pub mod hid { + pub const DEV_TREZOR1: (u16, u16) = (0x534C, 0x0001); + pub const DEV_TREZOR2: (u16, u16) = (0x1209, 0x53C1); + pub const DEV_TREZOR2_BL: (u16, u16) = (0x1209, 0x53C0); + + pub const WIRELINK_USAGE: u16 = 0xFF00; + pub const WIRELINK_INTERFACE: isize = 0; + pub const DEBUGLINK_USAGE: u16 = 0xFF01; + pub const DEBUGLINK_INTERFACE: isize = 1; +} diff --git a/src/error.rs b/src/error.rs new file mode 100644 index 0000000..745f9c0 --- /dev/null +++ b/src/error.rs @@ -0,0 +1,173 @@ +//! # Error Handling + +use std::result; + +use bitcoin::util::base58; +use hid; +use secp256k1; +use std::{error, fmt, io, string}; + +/// Trezor error. +#[derive(Debug)] +pub enum Error { + /// Error from hidapi. + Hid(hid::Error), + /// Less than one device was plugged in. + NoDeviceFound, + /// More than one device was plugged in. + DeviceNotUnique, + /// The HID version supported by the device was unknown. + UnknownHidVersion, + + // unused: + /// Error in Base58 decoding + Base58(base58::Error), + /// std io error + Io(io::Error), + /// Error from libsecp + Secp(secp256k1::Error), + /// Error parsing text + Utf8(string::FromUtf8Error), + /// APDU reply had bad status word + ApduBadStatus(u16), + /// APDU reply had wrong channel + ApduWrongChannel, + /// APDU reply had wrong tag + ApduWrongTag, + /// APDU reply had out of order sequence numbers + ApduWrongSequence, + /// Received message with invalid length (message, received length) + ResponseWrongLength(u8, usize), + /// An wallet does not have enough money (had, required) + InsufficientFunds(u64, u64), + /// An wallet cannot produce anymore addresses + WalletFull, + /// An encrypted wallet had a bad filesize + WalletWrongSize(usize), + /// An encrypted wallet had a bad magic (probably not a wallet) + WalletWrongMagic(u64), + /// Attempted to use a user ID that exceeds the field length of the wallet (used, max) + UserIdTooLong(usize, usize), + /// Attempted to use a note that exceeds the field length of the wallet (used, max) + NoteTooLong(usize, usize), + /// Tried to access entry not in the wallet + EntryOutOfRange(usize), + /// Searched for an address not in the wallet + AddressNotFound, + /// Attempted to receive twice to one address + DoubleReceive, + /// Received an unparseable signature + BadSignature, + /// The dongle requested we do something unsupported + Unsupported, + /// Received APDU frame of shorter than expected length + UnexpectedEof, +} + +impl From for Error { + fn from(e: base58::Error) -> Error { + Error::Base58(e) + } +} + +impl From for Error { + fn from(e: hid::Error) -> Error { + Error::Hid(e) + } +} + +impl From for Error { + fn from(e: io::Error) -> Error { + Error::Io(e) + } +} + +impl From for Error { + fn from(e: secp256k1::Error) -> Error { + Error::Secp(e) + } +} + +impl From for Error { + fn from(e: string::FromUtf8Error) -> Error { + Error::Utf8(e) + } +} + +impl error::Error for Error { + fn cause(&self) -> Option<&error::Error> { + match *self { + Error::Hid(ref e) => Some(e), + // unused: + Error::Base58(ref e) => Some(e), + Error::Io(ref e) => Some(e), + Error::Secp(ref e) => Some(e), + Error::Utf8(ref e) => Some(e), + _ => None, + } + } + + fn description(&self) -> &str { + match *self { + Error::Hid(ref e) => error::Error::description(e), + Error::NoDeviceFound => "Trezor device not found", + Error::DeviceNotUnique => "multiple Trezor devices found", + Error::UnknownHidVersion => "HID version of the device unknown", + // + // unused: + Error::Base58(ref e) => error::Error::description(e), + Error::Io(ref e) => error::Error::description(e), + Error::Secp(ref e) => error::Error::description(e), + Error::Utf8(ref e) => error::Error::description(e), + Error::ApduBadStatus(_) => "bad APDU status word (is device unlocked?)", + Error::ApduWrongChannel => "wrong APDU channel (is device running the right app?)", + Error::ApduWrongTag => "wrong APDU tag (is device running the right app?)", + Error::ApduWrongSequence => "bad APDU sequence no", + Error::ResponseWrongLength(_, _) => "bad message length", + Error::InsufficientFunds(_, _) => "insufficient funds", + Error::WalletFull => "wallet is full, it has no more available addresses", + Error::WalletWrongSize(_) => "wallet had invalid length", + Error::WalletWrongMagic(_) => "wallet had wrong magic", + Error::UserIdTooLong(_, _) => "user ID too long", + Error::NoteTooLong(_, _) => "note too long", + Error::EntryOutOfRange(_) => "tried to access entry outside of wallet", + Error::AddressNotFound => "address not found in wallet", + Error::DoubleReceive => "attempted to receive twice to same address", + Error::BadSignature => "unparseable signature", + Error::Unsupported => "we were asked to do something unsupported", + Error::UnexpectedEof => "unexpected end of data", + } + } +} + +impl fmt::Display for Error { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + match *self { + Error::Base58(ref e) => fmt::Display::fmt(e, f), + Error::Hid(ref e) => fmt::Display::fmt(e, f), + Error::Io(ref e) => fmt::Display::fmt(e, f), + Error::Secp(ref e) => fmt::Display::fmt(e, f), + Error::Utf8(ref e) => fmt::Display::fmt(e, f), + Error::ApduBadStatus(sw) => write!(f, "bad APDU status word {}", sw), + Error::ResponseWrongLength(msg, len) => { + write!(f, "bad APDU response length {} for message 0x{:02x}", len, msg) + } + Error::InsufficientFunds(had, required) => { + write!(f, "have {} but need {} satoshi to fund this transaction", had, required) + } + Error::WalletWrongSize(len) => write!(f, "bad wallet size {}", len), + Error::WalletWrongMagic(magic) => write!(f, "bad wallet magic {:08x}", magic), + Error::UserIdTooLong(used, max) => { + write!(f, "user ID length {} exceeds max {}", used, max) + } + Error::NoteTooLong(used, max) => { + write!(f, "user ID length {} exceeds max {}", used, max) + } + Error::EntryOutOfRange(entry) => write!(f, "entry {} not in wallet", entry), + _ => f.write_str(error::Error::description(self)), + } + } +} + +/// Result type used in this crate. +pub type Result = result::Result; diff --git a/src/lib.rs b/src/lib.rs new file mode 100644 index 0000000..4421d6d --- /dev/null +++ b/src/lib.rs @@ -0,0 +1,32 @@ +extern crate bitcoin; +extern crate hid; +extern crate protobuf; +extern crate secp256k1; + +use std::fmt; + +mod constants; +mod error; +mod protocol; +mod protos; +mod trezor; + +pub use error::*; +pub use trezor::*; + +#[derive(PartialEq, Eq, Clone, Debug)] +pub enum Model { + Trezor1, + Trezor2, + Trezor2Bl, +} + +impl fmt::Display for Model { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.write_str(match self { + Model::Trezor1 => "Trezor 1", + Model::Trezor2 => "Trezor 2", + Model::Trezor2Bl => "Trezor 2 Bl", + }) + } +} diff --git a/src/protocol.rs b/src/protocol.rs new file mode 100644 index 0000000..21c75e4 --- /dev/null +++ b/src/protocol.rs @@ -0,0 +1,38 @@ +use hid; +use protobuf; + +use error::Result; + +pub trait Transport { + fn write_chunk(&mut self, chunk: Vec) -> Result<()>; + fn read_chunk(&mut self) -> Result>; +} + +pub trait Protocol { + fn session_begin(transport: &mut hid::Handle) -> Result<()>; + fn session_end(transport: &mut hid::Handle) -> Result<()>; + //fn write(transport: &mut hid::Handle, message: M) -> Result<(), Error>; + //fn read(transport: &mut hid::Handle) -> Result; +} + +pub struct ProtocolV1 {} + +impl Protocol for ProtocolV1 { + fn session_begin(transport: &mut hid::Handle) -> Result<()> { + Ok(()) + } + fn session_end(transport: &mut hid::Handle) -> Result<()> { + Ok(()) + } +} + +pub struct ProtocolV2 {} + +impl Protocol for ProtocolV2 { + fn session_begin(transport: &mut hid::Handle) -> Result<()> { + Ok(()) + } + fn session_end(transport: &mut hid::Handle) -> Result<()> { + Ok(()) + } +} diff --git a/src/protos/messages.rs b/src/protos/messages.rs new file mode 100644 index 0000000..792fa8a --- /dev/null +++ b/src/protos/messages.rs @@ -0,0 +1,1424 @@ +// This file is generated by rust-protobuf 2.0.4. Do not edit +// @generated + +// https://github.com/Manishearth/rust-clippy/issues/702 +#![allow(unknown_lints)] +#![allow(clippy)] + +#![cfg_attr(rustfmt, rustfmt_skip)] + +#![allow(box_pointers)] +#![allow(dead_code)] +#![allow(missing_docs)] +#![allow(non_camel_case_types)] +#![allow(non_snake_case)] +#![allow(non_upper_case_globals)] +#![allow(trivial_casts)] +#![allow(unsafe_code)] +#![allow(unused_imports)] +#![allow(unused_results)] + +use protobuf::Message as Message_imported_for_functions; +use protobuf::ProtobufEnum as ProtobufEnum_imported_for_functions; + +#[derive(Clone,PartialEq,Eq,Debug,Hash)] +pub enum MessageType { + MessageType_Initialize = 0, + MessageType_Ping = 1, + MessageType_Success = 2, + MessageType_Failure = 3, + MessageType_ChangePin = 4, + MessageType_WipeDevice = 5, + MessageType_GetEntropy = 9, + MessageType_Entropy = 10, + MessageType_LoadDevice = 13, + MessageType_ResetDevice = 14, + MessageType_Features = 17, + MessageType_PinMatrixRequest = 18, + MessageType_PinMatrixAck = 19, + MessageType_Cancel = 20, + MessageType_ClearSession = 24, + MessageType_ApplySettings = 25, + MessageType_ButtonRequest = 26, + MessageType_ButtonAck = 27, + MessageType_ApplyFlags = 28, + MessageType_BackupDevice = 34, + MessageType_EntropyRequest = 35, + MessageType_EntropyAck = 36, + MessageType_PassphraseRequest = 41, + MessageType_PassphraseAck = 42, + MessageType_PassphraseStateRequest = 77, + MessageType_PassphraseStateAck = 78, + MessageType_RecoveryDevice = 45, + MessageType_WordRequest = 46, + MessageType_WordAck = 47, + MessageType_GetFeatures = 55, + MessageType_SetU2FCounter = 63, + MessageType_FirmwareErase = 6, + MessageType_FirmwareUpload = 7, + MessageType_FirmwareRequest = 8, + MessageType_SelfTest = 32, + MessageType_GetPublicKey = 11, + MessageType_PublicKey = 12, + MessageType_SignTx = 15, + MessageType_TxRequest = 21, + MessageType_TxAck = 22, + MessageType_GetAddress = 29, + MessageType_Address = 30, + MessageType_SignMessage = 38, + MessageType_VerifyMessage = 39, + MessageType_MessageSignature = 40, + MessageType_CipherKeyValue = 23, + MessageType_CipheredKeyValue = 48, + MessageType_SignIdentity = 53, + MessageType_SignedIdentity = 54, + MessageType_GetECDHSessionKey = 61, + MessageType_ECDHSessionKey = 62, + MessageType_CosiCommit = 71, + MessageType_CosiCommitment = 72, + MessageType_CosiSign = 73, + MessageType_CosiSignature = 74, + MessageType_DebugLinkDecision = 100, + MessageType_DebugLinkGetState = 101, + MessageType_DebugLinkState = 102, + MessageType_DebugLinkStop = 103, + MessageType_DebugLinkLog = 104, + MessageType_DebugLinkMemoryRead = 110, + MessageType_DebugLinkMemory = 111, + MessageType_DebugLinkMemoryWrite = 112, + MessageType_DebugLinkFlashErase = 113, + MessageType_EthereumGetAddress = 56, + MessageType_EthereumAddress = 57, + MessageType_EthereumSignTx = 58, + MessageType_EthereumTxRequest = 59, + MessageType_EthereumTxAck = 60, + MessageType_EthereumSignMessage = 64, + MessageType_EthereumVerifyMessage = 65, + MessageType_EthereumMessageSignature = 66, + MessageType_NEMGetAddress = 67, + MessageType_NEMAddress = 68, + MessageType_NEMSignTx = 69, + MessageType_NEMSignedTx = 70, + MessageType_NEMDecryptMessage = 75, + MessageType_NEMDecryptedMessage = 76, + MessageType_LiskGetAddress = 114, + MessageType_LiskAddress = 115, + MessageType_LiskSignTx = 116, + MessageType_LiskSignedTx = 117, + MessageType_LiskSignMessage = 118, + MessageType_LiskMessageSignature = 119, + MessageType_LiskVerifyMessage = 120, + MessageType_LiskGetPublicKey = 121, + MessageType_LiskPublicKey = 122, + MessageType_TezosGetAddress = 150, + MessageType_TezosAddress = 151, + MessageType_TezosSignTx = 152, + MessageType_TezosSignedTx = 153, + MessageType_TezosGetPublicKey = 154, + MessageType_TezosPublicKey = 155, + MessageType_StellarSignTx = 202, + MessageType_StellarTxOpRequest = 203, + MessageType_StellarGetAddress = 207, + MessageType_StellarAddress = 208, + MessageType_StellarCreateAccountOp = 210, + MessageType_StellarPaymentOp = 211, + MessageType_StellarPathPaymentOp = 212, + MessageType_StellarManageOfferOp = 213, + MessageType_StellarCreatePassiveOfferOp = 214, + MessageType_StellarSetOptionsOp = 215, + MessageType_StellarChangeTrustOp = 216, + MessageType_StellarAllowTrustOp = 217, + MessageType_StellarAccountMergeOp = 218, + MessageType_StellarManageDataOp = 220, + MessageType_StellarBumpSequenceOp = 221, + MessageType_StellarSignedTx = 230, + MessageType_TronGetAddress = 250, + MessageType_TronAddress = 251, + MessageType_TronSignTx = 252, + MessageType_TronSignedTx = 253, + MessageType_CardanoSignTx = 303, + MessageType_CardanoTxRequest = 304, + MessageType_CardanoGetPublicKey = 305, + MessageType_CardanoPublicKey = 306, + MessageType_CardanoGetAddress = 307, + MessageType_CardanoAddress = 308, + MessageType_CardanoTxAck = 309, + MessageType_CardanoSignedTx = 310, + MessageType_OntologyGetAddress = 350, + MessageType_OntologyAddress = 351, + MessageType_OntologyGetPublicKey = 352, + MessageType_OntologyPublicKey = 353, + MessageType_OntologySignTransfer = 354, + MessageType_OntologySignedTransfer = 355, + MessageType_OntologySignWithdrawOng = 356, + MessageType_OntologySignedWithdrawOng = 357, + MessageType_OntologySignOntIdRegister = 358, + MessageType_OntologySignedOntIdRegister = 359, + MessageType_OntologySignOntIdAddAttributes = 360, + MessageType_OntologySignedOntIdAddAttributes = 361, + MessageType_RippleGetAddress = 400, + MessageType_RippleAddress = 401, + MessageType_RippleSignTx = 402, + MessageType_RippleSignedTx = 403, + MessageType_MoneroTransactionInitRequest = 501, + MessageType_MoneroTransactionInitAck = 502, + MessageType_MoneroTransactionSetInputRequest = 503, + MessageType_MoneroTransactionSetInputAck = 504, + MessageType_MoneroTransactionInputsPermutationRequest = 505, + MessageType_MoneroTransactionInputsPermutationAck = 506, + MessageType_MoneroTransactionInputViniRequest = 507, + MessageType_MoneroTransactionInputViniAck = 508, + MessageType_MoneroTransactionAllInputsSetRequest = 509, + MessageType_MoneroTransactionAllInputsSetAck = 510, + MessageType_MoneroTransactionSetOutputRequest = 511, + MessageType_MoneroTransactionSetOutputAck = 512, + MessageType_MoneroTransactionAllOutSetRequest = 513, + MessageType_MoneroTransactionAllOutSetAck = 514, + MessageType_MoneroTransactionMlsagDoneRequest = 515, + MessageType_MoneroTransactionMlsagDoneAck = 516, + MessageType_MoneroTransactionSignInputRequest = 517, + MessageType_MoneroTransactionSignInputAck = 518, + MessageType_MoneroTransactionFinalRequest = 519, + MessageType_MoneroTransactionFinalAck = 520, + MessageType_MoneroKeyImageExportInitRequest = 530, + MessageType_MoneroKeyImageExportInitAck = 531, + MessageType_MoneroKeyImageSyncStepRequest = 532, + MessageType_MoneroKeyImageSyncStepAck = 533, + MessageType_MoneroKeyImageSyncFinalRequest = 534, + MessageType_MoneroKeyImageSyncFinalAck = 535, + MessageType_MoneroGetAddress = 540, + MessageType_MoneroAddress = 541, + MessageType_MoneroGetWatchKey = 542, + MessageType_MoneroWatchKey = 543, + MessageType_DebugMoneroDiagRequest = 546, + MessageType_DebugMoneroDiagAck = 547, +} + +impl ::protobuf::ProtobufEnum for MessageType { + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 0 => ::std::option::Option::Some(MessageType::MessageType_Initialize), + 1 => ::std::option::Option::Some(MessageType::MessageType_Ping), + 2 => ::std::option::Option::Some(MessageType::MessageType_Success), + 3 => ::std::option::Option::Some(MessageType::MessageType_Failure), + 4 => ::std::option::Option::Some(MessageType::MessageType_ChangePin), + 5 => ::std::option::Option::Some(MessageType::MessageType_WipeDevice), + 9 => ::std::option::Option::Some(MessageType::MessageType_GetEntropy), + 10 => ::std::option::Option::Some(MessageType::MessageType_Entropy), + 13 => ::std::option::Option::Some(MessageType::MessageType_LoadDevice), + 14 => ::std::option::Option::Some(MessageType::MessageType_ResetDevice), + 17 => ::std::option::Option::Some(MessageType::MessageType_Features), + 18 => ::std::option::Option::Some(MessageType::MessageType_PinMatrixRequest), + 19 => ::std::option::Option::Some(MessageType::MessageType_PinMatrixAck), + 20 => ::std::option::Option::Some(MessageType::MessageType_Cancel), + 24 => ::std::option::Option::Some(MessageType::MessageType_ClearSession), + 25 => ::std::option::Option::Some(MessageType::MessageType_ApplySettings), + 26 => ::std::option::Option::Some(MessageType::MessageType_ButtonRequest), + 27 => ::std::option::Option::Some(MessageType::MessageType_ButtonAck), + 28 => ::std::option::Option::Some(MessageType::MessageType_ApplyFlags), + 34 => ::std::option::Option::Some(MessageType::MessageType_BackupDevice), + 35 => ::std::option::Option::Some(MessageType::MessageType_EntropyRequest), + 36 => ::std::option::Option::Some(MessageType::MessageType_EntropyAck), + 41 => ::std::option::Option::Some(MessageType::MessageType_PassphraseRequest), + 42 => ::std::option::Option::Some(MessageType::MessageType_PassphraseAck), + 77 => ::std::option::Option::Some(MessageType::MessageType_PassphraseStateRequest), + 78 => ::std::option::Option::Some(MessageType::MessageType_PassphraseStateAck), + 45 => ::std::option::Option::Some(MessageType::MessageType_RecoveryDevice), + 46 => ::std::option::Option::Some(MessageType::MessageType_WordRequest), + 47 => ::std::option::Option::Some(MessageType::MessageType_WordAck), + 55 => ::std::option::Option::Some(MessageType::MessageType_GetFeatures), + 63 => ::std::option::Option::Some(MessageType::MessageType_SetU2FCounter), + 6 => ::std::option::Option::Some(MessageType::MessageType_FirmwareErase), + 7 => ::std::option::Option::Some(MessageType::MessageType_FirmwareUpload), + 8 => ::std::option::Option::Some(MessageType::MessageType_FirmwareRequest), + 32 => ::std::option::Option::Some(MessageType::MessageType_SelfTest), + 11 => ::std::option::Option::Some(MessageType::MessageType_GetPublicKey), + 12 => ::std::option::Option::Some(MessageType::MessageType_PublicKey), + 15 => ::std::option::Option::Some(MessageType::MessageType_SignTx), + 21 => ::std::option::Option::Some(MessageType::MessageType_TxRequest), + 22 => ::std::option::Option::Some(MessageType::MessageType_TxAck), + 29 => ::std::option::Option::Some(MessageType::MessageType_GetAddress), + 30 => ::std::option::Option::Some(MessageType::MessageType_Address), + 38 => ::std::option::Option::Some(MessageType::MessageType_SignMessage), + 39 => ::std::option::Option::Some(MessageType::MessageType_VerifyMessage), + 40 => ::std::option::Option::Some(MessageType::MessageType_MessageSignature), + 23 => ::std::option::Option::Some(MessageType::MessageType_CipherKeyValue), + 48 => ::std::option::Option::Some(MessageType::MessageType_CipheredKeyValue), + 53 => ::std::option::Option::Some(MessageType::MessageType_SignIdentity), + 54 => ::std::option::Option::Some(MessageType::MessageType_SignedIdentity), + 61 => ::std::option::Option::Some(MessageType::MessageType_GetECDHSessionKey), + 62 => ::std::option::Option::Some(MessageType::MessageType_ECDHSessionKey), + 71 => ::std::option::Option::Some(MessageType::MessageType_CosiCommit), + 72 => ::std::option::Option::Some(MessageType::MessageType_CosiCommitment), + 73 => ::std::option::Option::Some(MessageType::MessageType_CosiSign), + 74 => ::std::option::Option::Some(MessageType::MessageType_CosiSignature), + 100 => ::std::option::Option::Some(MessageType::MessageType_DebugLinkDecision), + 101 => ::std::option::Option::Some(MessageType::MessageType_DebugLinkGetState), + 102 => ::std::option::Option::Some(MessageType::MessageType_DebugLinkState), + 103 => ::std::option::Option::Some(MessageType::MessageType_DebugLinkStop), + 104 => ::std::option::Option::Some(MessageType::MessageType_DebugLinkLog), + 110 => ::std::option::Option::Some(MessageType::MessageType_DebugLinkMemoryRead), + 111 => ::std::option::Option::Some(MessageType::MessageType_DebugLinkMemory), + 112 => ::std::option::Option::Some(MessageType::MessageType_DebugLinkMemoryWrite), + 113 => ::std::option::Option::Some(MessageType::MessageType_DebugLinkFlashErase), + 56 => ::std::option::Option::Some(MessageType::MessageType_EthereumGetAddress), + 57 => ::std::option::Option::Some(MessageType::MessageType_EthereumAddress), + 58 => ::std::option::Option::Some(MessageType::MessageType_EthereumSignTx), + 59 => ::std::option::Option::Some(MessageType::MessageType_EthereumTxRequest), + 60 => ::std::option::Option::Some(MessageType::MessageType_EthereumTxAck), + 64 => ::std::option::Option::Some(MessageType::MessageType_EthereumSignMessage), + 65 => ::std::option::Option::Some(MessageType::MessageType_EthereumVerifyMessage), + 66 => ::std::option::Option::Some(MessageType::MessageType_EthereumMessageSignature), + 67 => ::std::option::Option::Some(MessageType::MessageType_NEMGetAddress), + 68 => ::std::option::Option::Some(MessageType::MessageType_NEMAddress), + 69 => ::std::option::Option::Some(MessageType::MessageType_NEMSignTx), + 70 => ::std::option::Option::Some(MessageType::MessageType_NEMSignedTx), + 75 => ::std::option::Option::Some(MessageType::MessageType_NEMDecryptMessage), + 76 => ::std::option::Option::Some(MessageType::MessageType_NEMDecryptedMessage), + 114 => ::std::option::Option::Some(MessageType::MessageType_LiskGetAddress), + 115 => ::std::option::Option::Some(MessageType::MessageType_LiskAddress), + 116 => ::std::option::Option::Some(MessageType::MessageType_LiskSignTx), + 117 => ::std::option::Option::Some(MessageType::MessageType_LiskSignedTx), + 118 => ::std::option::Option::Some(MessageType::MessageType_LiskSignMessage), + 119 => ::std::option::Option::Some(MessageType::MessageType_LiskMessageSignature), + 120 => ::std::option::Option::Some(MessageType::MessageType_LiskVerifyMessage), + 121 => ::std::option::Option::Some(MessageType::MessageType_LiskGetPublicKey), + 122 => ::std::option::Option::Some(MessageType::MessageType_LiskPublicKey), + 150 => ::std::option::Option::Some(MessageType::MessageType_TezosGetAddress), + 151 => ::std::option::Option::Some(MessageType::MessageType_TezosAddress), + 152 => ::std::option::Option::Some(MessageType::MessageType_TezosSignTx), + 153 => ::std::option::Option::Some(MessageType::MessageType_TezosSignedTx), + 154 => ::std::option::Option::Some(MessageType::MessageType_TezosGetPublicKey), + 155 => ::std::option::Option::Some(MessageType::MessageType_TezosPublicKey), + 202 => ::std::option::Option::Some(MessageType::MessageType_StellarSignTx), + 203 => ::std::option::Option::Some(MessageType::MessageType_StellarTxOpRequest), + 207 => ::std::option::Option::Some(MessageType::MessageType_StellarGetAddress), + 208 => ::std::option::Option::Some(MessageType::MessageType_StellarAddress), + 210 => ::std::option::Option::Some(MessageType::MessageType_StellarCreateAccountOp), + 211 => ::std::option::Option::Some(MessageType::MessageType_StellarPaymentOp), + 212 => ::std::option::Option::Some(MessageType::MessageType_StellarPathPaymentOp), + 213 => ::std::option::Option::Some(MessageType::MessageType_StellarManageOfferOp), + 214 => ::std::option::Option::Some(MessageType::MessageType_StellarCreatePassiveOfferOp), + 215 => ::std::option::Option::Some(MessageType::MessageType_StellarSetOptionsOp), + 216 => ::std::option::Option::Some(MessageType::MessageType_StellarChangeTrustOp), + 217 => ::std::option::Option::Some(MessageType::MessageType_StellarAllowTrustOp), + 218 => ::std::option::Option::Some(MessageType::MessageType_StellarAccountMergeOp), + 220 => ::std::option::Option::Some(MessageType::MessageType_StellarManageDataOp), + 221 => ::std::option::Option::Some(MessageType::MessageType_StellarBumpSequenceOp), + 230 => ::std::option::Option::Some(MessageType::MessageType_StellarSignedTx), + 250 => ::std::option::Option::Some(MessageType::MessageType_TronGetAddress), + 251 => ::std::option::Option::Some(MessageType::MessageType_TronAddress), + 252 => ::std::option::Option::Some(MessageType::MessageType_TronSignTx), + 253 => ::std::option::Option::Some(MessageType::MessageType_TronSignedTx), + 303 => ::std::option::Option::Some(MessageType::MessageType_CardanoSignTx), + 304 => ::std::option::Option::Some(MessageType::MessageType_CardanoTxRequest), + 305 => ::std::option::Option::Some(MessageType::MessageType_CardanoGetPublicKey), + 306 => ::std::option::Option::Some(MessageType::MessageType_CardanoPublicKey), + 307 => ::std::option::Option::Some(MessageType::MessageType_CardanoGetAddress), + 308 => ::std::option::Option::Some(MessageType::MessageType_CardanoAddress), + 309 => ::std::option::Option::Some(MessageType::MessageType_CardanoTxAck), + 310 => ::std::option::Option::Some(MessageType::MessageType_CardanoSignedTx), + 350 => ::std::option::Option::Some(MessageType::MessageType_OntologyGetAddress), + 351 => ::std::option::Option::Some(MessageType::MessageType_OntologyAddress), + 352 => ::std::option::Option::Some(MessageType::MessageType_OntologyGetPublicKey), + 353 => ::std::option::Option::Some(MessageType::MessageType_OntologyPublicKey), + 354 => ::std::option::Option::Some(MessageType::MessageType_OntologySignTransfer), + 355 => ::std::option::Option::Some(MessageType::MessageType_OntologySignedTransfer), + 356 => ::std::option::Option::Some(MessageType::MessageType_OntologySignWithdrawOng), + 357 => ::std::option::Option::Some(MessageType::MessageType_OntologySignedWithdrawOng), + 358 => ::std::option::Option::Some(MessageType::MessageType_OntologySignOntIdRegister), + 359 => ::std::option::Option::Some(MessageType::MessageType_OntologySignedOntIdRegister), + 360 => ::std::option::Option::Some(MessageType::MessageType_OntologySignOntIdAddAttributes), + 361 => ::std::option::Option::Some(MessageType::MessageType_OntologySignedOntIdAddAttributes), + 400 => ::std::option::Option::Some(MessageType::MessageType_RippleGetAddress), + 401 => ::std::option::Option::Some(MessageType::MessageType_RippleAddress), + 402 => ::std::option::Option::Some(MessageType::MessageType_RippleSignTx), + 403 => ::std::option::Option::Some(MessageType::MessageType_RippleSignedTx), + 501 => ::std::option::Option::Some(MessageType::MessageType_MoneroTransactionInitRequest), + 502 => ::std::option::Option::Some(MessageType::MessageType_MoneroTransactionInitAck), + 503 => ::std::option::Option::Some(MessageType::MessageType_MoneroTransactionSetInputRequest), + 504 => ::std::option::Option::Some(MessageType::MessageType_MoneroTransactionSetInputAck), + 505 => ::std::option::Option::Some(MessageType::MessageType_MoneroTransactionInputsPermutationRequest), + 506 => ::std::option::Option::Some(MessageType::MessageType_MoneroTransactionInputsPermutationAck), + 507 => ::std::option::Option::Some(MessageType::MessageType_MoneroTransactionInputViniRequest), + 508 => ::std::option::Option::Some(MessageType::MessageType_MoneroTransactionInputViniAck), + 509 => ::std::option::Option::Some(MessageType::MessageType_MoneroTransactionAllInputsSetRequest), + 510 => ::std::option::Option::Some(MessageType::MessageType_MoneroTransactionAllInputsSetAck), + 511 => ::std::option::Option::Some(MessageType::MessageType_MoneroTransactionSetOutputRequest), + 512 => ::std::option::Option::Some(MessageType::MessageType_MoneroTransactionSetOutputAck), + 513 => ::std::option::Option::Some(MessageType::MessageType_MoneroTransactionAllOutSetRequest), + 514 => ::std::option::Option::Some(MessageType::MessageType_MoneroTransactionAllOutSetAck), + 515 => ::std::option::Option::Some(MessageType::MessageType_MoneroTransactionMlsagDoneRequest), + 516 => ::std::option::Option::Some(MessageType::MessageType_MoneroTransactionMlsagDoneAck), + 517 => ::std::option::Option::Some(MessageType::MessageType_MoneroTransactionSignInputRequest), + 518 => ::std::option::Option::Some(MessageType::MessageType_MoneroTransactionSignInputAck), + 519 => ::std::option::Option::Some(MessageType::MessageType_MoneroTransactionFinalRequest), + 520 => ::std::option::Option::Some(MessageType::MessageType_MoneroTransactionFinalAck), + 530 => ::std::option::Option::Some(MessageType::MessageType_MoneroKeyImageExportInitRequest), + 531 => ::std::option::Option::Some(MessageType::MessageType_MoneroKeyImageExportInitAck), + 532 => ::std::option::Option::Some(MessageType::MessageType_MoneroKeyImageSyncStepRequest), + 533 => ::std::option::Option::Some(MessageType::MessageType_MoneroKeyImageSyncStepAck), + 534 => ::std::option::Option::Some(MessageType::MessageType_MoneroKeyImageSyncFinalRequest), + 535 => ::std::option::Option::Some(MessageType::MessageType_MoneroKeyImageSyncFinalAck), + 540 => ::std::option::Option::Some(MessageType::MessageType_MoneroGetAddress), + 541 => ::std::option::Option::Some(MessageType::MessageType_MoneroAddress), + 542 => ::std::option::Option::Some(MessageType::MessageType_MoneroGetWatchKey), + 543 => ::std::option::Option::Some(MessageType::MessageType_MoneroWatchKey), + 546 => ::std::option::Option::Some(MessageType::MessageType_DebugMoneroDiagRequest), + 547 => ::std::option::Option::Some(MessageType::MessageType_DebugMoneroDiagAck), + _ => ::std::option::Option::None + } + } + + fn values() -> &'static [Self] { + static values: &'static [MessageType] = &[ + MessageType::MessageType_Initialize, + MessageType::MessageType_Ping, + MessageType::MessageType_Success, + MessageType::MessageType_Failure, + MessageType::MessageType_ChangePin, + MessageType::MessageType_WipeDevice, + MessageType::MessageType_GetEntropy, + MessageType::MessageType_Entropy, + MessageType::MessageType_LoadDevice, + MessageType::MessageType_ResetDevice, + MessageType::MessageType_Features, + MessageType::MessageType_PinMatrixRequest, + MessageType::MessageType_PinMatrixAck, + MessageType::MessageType_Cancel, + MessageType::MessageType_ClearSession, + MessageType::MessageType_ApplySettings, + MessageType::MessageType_ButtonRequest, + MessageType::MessageType_ButtonAck, + MessageType::MessageType_ApplyFlags, + MessageType::MessageType_BackupDevice, + MessageType::MessageType_EntropyRequest, + MessageType::MessageType_EntropyAck, + MessageType::MessageType_PassphraseRequest, + MessageType::MessageType_PassphraseAck, + MessageType::MessageType_PassphraseStateRequest, + MessageType::MessageType_PassphraseStateAck, + MessageType::MessageType_RecoveryDevice, + MessageType::MessageType_WordRequest, + MessageType::MessageType_WordAck, + MessageType::MessageType_GetFeatures, + MessageType::MessageType_SetU2FCounter, + MessageType::MessageType_FirmwareErase, + MessageType::MessageType_FirmwareUpload, + MessageType::MessageType_FirmwareRequest, + MessageType::MessageType_SelfTest, + MessageType::MessageType_GetPublicKey, + MessageType::MessageType_PublicKey, + MessageType::MessageType_SignTx, + MessageType::MessageType_TxRequest, + MessageType::MessageType_TxAck, + MessageType::MessageType_GetAddress, + MessageType::MessageType_Address, + MessageType::MessageType_SignMessage, + MessageType::MessageType_VerifyMessage, + MessageType::MessageType_MessageSignature, + MessageType::MessageType_CipherKeyValue, + MessageType::MessageType_CipheredKeyValue, + MessageType::MessageType_SignIdentity, + MessageType::MessageType_SignedIdentity, + MessageType::MessageType_GetECDHSessionKey, + MessageType::MessageType_ECDHSessionKey, + MessageType::MessageType_CosiCommit, + MessageType::MessageType_CosiCommitment, + MessageType::MessageType_CosiSign, + MessageType::MessageType_CosiSignature, + MessageType::MessageType_DebugLinkDecision, + MessageType::MessageType_DebugLinkGetState, + MessageType::MessageType_DebugLinkState, + MessageType::MessageType_DebugLinkStop, + MessageType::MessageType_DebugLinkLog, + MessageType::MessageType_DebugLinkMemoryRead, + MessageType::MessageType_DebugLinkMemory, + MessageType::MessageType_DebugLinkMemoryWrite, + MessageType::MessageType_DebugLinkFlashErase, + MessageType::MessageType_EthereumGetAddress, + MessageType::MessageType_EthereumAddress, + MessageType::MessageType_EthereumSignTx, + MessageType::MessageType_EthereumTxRequest, + MessageType::MessageType_EthereumTxAck, + MessageType::MessageType_EthereumSignMessage, + MessageType::MessageType_EthereumVerifyMessage, + MessageType::MessageType_EthereumMessageSignature, + MessageType::MessageType_NEMGetAddress, + MessageType::MessageType_NEMAddress, + MessageType::MessageType_NEMSignTx, + MessageType::MessageType_NEMSignedTx, + MessageType::MessageType_NEMDecryptMessage, + MessageType::MessageType_NEMDecryptedMessage, + MessageType::MessageType_LiskGetAddress, + MessageType::MessageType_LiskAddress, + MessageType::MessageType_LiskSignTx, + MessageType::MessageType_LiskSignedTx, + MessageType::MessageType_LiskSignMessage, + MessageType::MessageType_LiskMessageSignature, + MessageType::MessageType_LiskVerifyMessage, + MessageType::MessageType_LiskGetPublicKey, + MessageType::MessageType_LiskPublicKey, + MessageType::MessageType_TezosGetAddress, + MessageType::MessageType_TezosAddress, + MessageType::MessageType_TezosSignTx, + MessageType::MessageType_TezosSignedTx, + MessageType::MessageType_TezosGetPublicKey, + MessageType::MessageType_TezosPublicKey, + MessageType::MessageType_StellarSignTx, + MessageType::MessageType_StellarTxOpRequest, + MessageType::MessageType_StellarGetAddress, + MessageType::MessageType_StellarAddress, + MessageType::MessageType_StellarCreateAccountOp, + MessageType::MessageType_StellarPaymentOp, + MessageType::MessageType_StellarPathPaymentOp, + MessageType::MessageType_StellarManageOfferOp, + MessageType::MessageType_StellarCreatePassiveOfferOp, + MessageType::MessageType_StellarSetOptionsOp, + MessageType::MessageType_StellarChangeTrustOp, + MessageType::MessageType_StellarAllowTrustOp, + MessageType::MessageType_StellarAccountMergeOp, + MessageType::MessageType_StellarManageDataOp, + MessageType::MessageType_StellarBumpSequenceOp, + MessageType::MessageType_StellarSignedTx, + MessageType::MessageType_TronGetAddress, + MessageType::MessageType_TronAddress, + MessageType::MessageType_TronSignTx, + MessageType::MessageType_TronSignedTx, + MessageType::MessageType_CardanoSignTx, + MessageType::MessageType_CardanoTxRequest, + MessageType::MessageType_CardanoGetPublicKey, + MessageType::MessageType_CardanoPublicKey, + MessageType::MessageType_CardanoGetAddress, + MessageType::MessageType_CardanoAddress, + MessageType::MessageType_CardanoTxAck, + MessageType::MessageType_CardanoSignedTx, + MessageType::MessageType_OntologyGetAddress, + MessageType::MessageType_OntologyAddress, + MessageType::MessageType_OntologyGetPublicKey, + MessageType::MessageType_OntologyPublicKey, + MessageType::MessageType_OntologySignTransfer, + MessageType::MessageType_OntologySignedTransfer, + MessageType::MessageType_OntologySignWithdrawOng, + MessageType::MessageType_OntologySignedWithdrawOng, + MessageType::MessageType_OntologySignOntIdRegister, + MessageType::MessageType_OntologySignedOntIdRegister, + MessageType::MessageType_OntologySignOntIdAddAttributes, + MessageType::MessageType_OntologySignedOntIdAddAttributes, + MessageType::MessageType_RippleGetAddress, + MessageType::MessageType_RippleAddress, + MessageType::MessageType_RippleSignTx, + MessageType::MessageType_RippleSignedTx, + MessageType::MessageType_MoneroTransactionInitRequest, + MessageType::MessageType_MoneroTransactionInitAck, + MessageType::MessageType_MoneroTransactionSetInputRequest, + MessageType::MessageType_MoneroTransactionSetInputAck, + MessageType::MessageType_MoneroTransactionInputsPermutationRequest, + MessageType::MessageType_MoneroTransactionInputsPermutationAck, + MessageType::MessageType_MoneroTransactionInputViniRequest, + MessageType::MessageType_MoneroTransactionInputViniAck, + MessageType::MessageType_MoneroTransactionAllInputsSetRequest, + MessageType::MessageType_MoneroTransactionAllInputsSetAck, + MessageType::MessageType_MoneroTransactionSetOutputRequest, + MessageType::MessageType_MoneroTransactionSetOutputAck, + MessageType::MessageType_MoneroTransactionAllOutSetRequest, + MessageType::MessageType_MoneroTransactionAllOutSetAck, + MessageType::MessageType_MoneroTransactionMlsagDoneRequest, + MessageType::MessageType_MoneroTransactionMlsagDoneAck, + MessageType::MessageType_MoneroTransactionSignInputRequest, + MessageType::MessageType_MoneroTransactionSignInputAck, + MessageType::MessageType_MoneroTransactionFinalRequest, + MessageType::MessageType_MoneroTransactionFinalAck, + MessageType::MessageType_MoneroKeyImageExportInitRequest, + MessageType::MessageType_MoneroKeyImageExportInitAck, + MessageType::MessageType_MoneroKeyImageSyncStepRequest, + MessageType::MessageType_MoneroKeyImageSyncStepAck, + MessageType::MessageType_MoneroKeyImageSyncFinalRequest, + MessageType::MessageType_MoneroKeyImageSyncFinalAck, + MessageType::MessageType_MoneroGetAddress, + MessageType::MessageType_MoneroAddress, + MessageType::MessageType_MoneroGetWatchKey, + MessageType::MessageType_MoneroWatchKey, + MessageType::MessageType_DebugMoneroDiagRequest, + MessageType::MessageType_DebugMoneroDiagAck, + ]; + values + } + + fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::EnumDescriptor, + }; + unsafe { + descriptor.get(|| { + ::protobuf::reflect::EnumDescriptor::new("MessageType", file_descriptor_proto()) + }) + } + } +} + +impl ::std::marker::Copy for MessageType { +} + +impl ::protobuf::reflect::ProtobufValue for MessageType { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) + } +} + +pub mod exts { + use protobuf::Message as Message_imported_for_functions; + + pub const wire_in: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::EnumValueOptions, ::protobuf::types::ProtobufTypeBool> = ::protobuf::ext::ExtFieldOptional { field_number: 50002, phantom: ::std::marker::PhantomData }; + + pub const wire_out: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::EnumValueOptions, ::protobuf::types::ProtobufTypeBool> = ::protobuf::ext::ExtFieldOptional { field_number: 50003, phantom: ::std::marker::PhantomData }; + + pub const wire_debug_in: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::EnumValueOptions, ::protobuf::types::ProtobufTypeBool> = ::protobuf::ext::ExtFieldOptional { field_number: 50004, phantom: ::std::marker::PhantomData }; + + pub const wire_debug_out: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::EnumValueOptions, ::protobuf::types::ProtobufTypeBool> = ::protobuf::ext::ExtFieldOptional { field_number: 50005, phantom: ::std::marker::PhantomData }; + + pub const wire_tiny: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::EnumValueOptions, ::protobuf::types::ProtobufTypeBool> = ::protobuf::ext::ExtFieldOptional { field_number: 50006, phantom: ::std::marker::PhantomData }; + + pub const wire_bootloader: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::EnumValueOptions, ::protobuf::types::ProtobufTypeBool> = ::protobuf::ext::ExtFieldOptional { field_number: 50007, phantom: ::std::marker::PhantomData }; + + pub const wire_no_fsm: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::EnumValueOptions, ::protobuf::types::ProtobufTypeBool> = ::protobuf::ext::ExtFieldOptional { field_number: 50008, phantom: ::std::marker::PhantomData }; +} + +static file_descriptor_proto_data: &'static [u8] = b"\ + \n\x0emessages.proto\x12\x12hw.trezor.messages\x1a\x20google/protobuf/de\ + scriptor.proto*\xc67\n\x0bMessageType\x12$\n\x16MessageType_Initialize\ + \x10\0\x1a\x08\xb0\xb5\x18\x01\x90\xb5\x18\x01\x12\x1a\n\x10MessageType_\ + Ping\x10\x01\x1a\x04\x90\xb5\x18\x01\x12\x1d\n\x13MessageType_Success\ + \x10\x02\x1a\x04\x98\xb5\x18\x01\x12\x1d\n\x13MessageType_Failure\x10\ + \x03\x1a\x04\x98\xb5\x18\x01\x12\x1f\n\x15MessageType_ChangePin\x10\x04\ + \x1a\x04\x90\xb5\x18\x01\x12\x20\n\x16MessageType_WipeDevice\x10\x05\x1a\ + \x04\x90\xb5\x18\x01\x12\x20\n\x16MessageType_GetEntropy\x10\t\x1a\x04\ + \x90\xb5\x18\x01\x12\x1d\n\x13MessageType_Entropy\x10\n\x1a\x04\x98\xb5\ + \x18\x01\x12\x20\n\x16MessageType_LoadDevice\x10\r\x1a\x04\x90\xb5\x18\ + \x01\x12!\n\x17MessageType_ResetDevice\x10\x0e\x1a\x04\x90\xb5\x18\x01\ + \x12\x1e\n\x14MessageType_Features\x10\x11\x1a\x04\x98\xb5\x18\x01\x12&\ + \n\x1cMessageType_PinMatrixRequest\x10\x12\x1a\x04\x98\xb5\x18\x01\x12*\ + \n\x18MessageType_PinMatrixAck\x10\x13\x1a\x0c\x90\xb5\x18\x01\xc0\xb5\ + \x18\x01\xb0\xb5\x18\x01\x12\x20\n\x12MessageType_Cancel\x10\x14\x1a\x08\ + \x90\xb5\x18\x01\xb0\xb5\x18\x01\x12\"\n\x18MessageType_ClearSession\x10\ + \x18\x1a\x04\x90\xb5\x18\x01\x12#\n\x19MessageType_ApplySettings\x10\x19\ + \x1a\x04\x90\xb5\x18\x01\x12#\n\x19MessageType_ButtonRequest\x10\x1a\x1a\ + \x04\x98\xb5\x18\x01\x12'\n\x15MessageType_ButtonAck\x10\x1b\x1a\x0c\xb0\ + \xb5\x18\x01\xc0\xb5\x18\x01\x90\xb5\x18\x01\x12\x20\n\x16MessageType_Ap\ + plyFlags\x10\x1c\x1a\x04\x90\xb5\x18\x01\x12\"\n\x18MessageType_BackupDe\ + vice\x10\"\x1a\x04\x90\xb5\x18\x01\x12$\n\x1aMessageType_EntropyRequest\ + \x10#\x1a\x04\x98\xb5\x18\x01\x12\x20\n\x16MessageType_EntropyAck\x10$\ + \x1a\x04\x90\xb5\x18\x01\x12'\n\x1dMessageType_PassphraseRequest\x10)\ + \x1a\x04\x98\xb5\x18\x01\x12+\n\x19MessageType_PassphraseAck\x10*\x1a\ + \x0c\xc0\xb5\x18\x01\xb0\xb5\x18\x01\x90\xb5\x18\x01\x12,\n\"MessageType\ + _PassphraseStateRequest\x10M\x1a\x04\x98\xb5\x18\x01\x120\n\x1eMessageTy\ + pe_PassphraseStateAck\x10N\x1a\x0c\xb0\xb5\x18\x01\xc0\xb5\x18\x01\x90\ + \xb5\x18\x01\x12$\n\x1aMessageType_RecoveryDevice\x10-\x1a\x04\x90\xb5\ + \x18\x01\x12!\n\x17MessageType_WordRequest\x10.\x1a\x04\x98\xb5\x18\x01\ + \x12\x1d\n\x13MessageType_WordAck\x10/\x1a\x04\x90\xb5\x18\x01\x12!\n\ + \x17MessageType_GetFeatures\x107\x1a\x04\x90\xb5\x18\x01\x12#\n\x19Messa\ + geType_SetU2FCounter\x10?\x1a\x04\x90\xb5\x18\x01\x12'\n\x19MessageType_\ + FirmwareErase\x10\x06\x1a\x08\xb8\xb5\x18\x01\x90\xb5\x18\x01\x12(\n\x1a\ + MessageType_FirmwareUpload\x10\x07\x1a\x08\xb8\xb5\x18\x01\x90\xb5\x18\ + \x01\x12)\n\x1bMessageType_FirmwareRequest\x10\x08\x1a\x08\x98\xb5\x18\ + \x01\xb8\xb5\x18\x01\x12\"\n\x14MessageType_SelfTest\x10\x20\x1a\x08\x90\ + \xb5\x18\x01\xb8\xb5\x18\x01\x12\"\n\x18MessageType_GetPublicKey\x10\x0b\ + \x1a\x04\x90\xb5\x18\x01\x12\x1f\n\x15MessageType_PublicKey\x10\x0c\x1a\ + \x04\x98\xb5\x18\x01\x12\x1c\n\x12MessageType_SignTx\x10\x0f\x1a\x04\x90\ + \xb5\x18\x01\x12\x1f\n\x15MessageType_TxRequest\x10\x15\x1a\x04\x98\xb5\ + \x18\x01\x12\x1b\n\x11MessageType_TxAck\x10\x16\x1a\x04\x90\xb5\x18\x01\ + \x12\x20\n\x16MessageType_GetAddress\x10\x1d\x1a\x04\x90\xb5\x18\x01\x12\ + \x1d\n\x13MessageType_Address\x10\x1e\x1a\x04\x98\xb5\x18\x01\x12!\n\x17\ + MessageType_SignMessage\x10&\x1a\x04\x90\xb5\x18\x01\x12#\n\x19MessageTy\ + pe_VerifyMessage\x10'\x1a\x04\x90\xb5\x18\x01\x12&\n\x1cMessageType_Mess\ + ageSignature\x10(\x1a\x04\x98\xb5\x18\x01\x12$\n\x1aMessageType_CipherKe\ + yValue\x10\x17\x1a\x04\x90\xb5\x18\x01\x12&\n\x1cMessageType_CipheredKey\ + Value\x100\x1a\x04\x98\xb5\x18\x01\x12\"\n\x18MessageType_SignIdentity\ + \x105\x1a\x04\x90\xb5\x18\x01\x12$\n\x1aMessageType_SignedIdentity\x106\ + \x1a\x04\x98\xb5\x18\x01\x12'\n\x1dMessageType_GetECDHSessionKey\x10=\ + \x1a\x04\x90\xb5\x18\x01\x12$\n\x1aMessageType_ECDHSessionKey\x10>\x1a\ + \x04\x98\xb5\x18\x01\x12\x20\n\x16MessageType_CosiCommit\x10G\x1a\x04\ + \x90\xb5\x18\x01\x12$\n\x1aMessageType_CosiCommitment\x10H\x1a\x04\x98\ + \xb5\x18\x01\x12\x1e\n\x14MessageType_CosiSign\x10I\x1a\x04\x90\xb5\x18\ + \x01\x12#\n\x19MessageType_CosiSignature\x10J\x1a\x04\x98\xb5\x18\x01\ + \x12/\n\x1dMessageType_DebugLinkDecision\x10d\x1a\x0c\xb0\xb5\x18\x01\ + \xc0\xb5\x18\x01\xa0\xb5\x18\x01\x12+\n\x1dMessageType_DebugLinkGetState\ + \x10e\x1a\x08\xa0\xb5\x18\x01\xb0\xb5\x18\x01\x12$\n\x1aMessageType_Debu\ + gLinkState\x10f\x1a\x04\xa8\xb5\x18\x01\x12#\n\x19MessageType_DebugLinkS\ + top\x10g\x1a\x04\xa0\xb5\x18\x01\x12\"\n\x18MessageType_DebugLinkLog\x10\ + h\x1a\x04\xa8\xb5\x18\x01\x12)\n\x1fMessageType_DebugLinkMemoryRead\x10n\ + \x1a\x04\xa0\xb5\x18\x01\x12%\n\x1bMessageType_DebugLinkMemory\x10o\x1a\ + \x04\xa8\xb5\x18\x01\x12*\n\x20MessageType_DebugLinkMemoryWrite\x10p\x1a\ + \x04\xa0\xb5\x18\x01\x12)\n\x1fMessageType_DebugLinkFlashErase\x10q\x1a\ + \x04\xa0\xb5\x18\x01\x12(\n\x1eMessageType_EthereumGetAddress\x108\x1a\ + \x04\x90\xb5\x18\x01\x12%\n\x1bMessageType_EthereumAddress\x109\x1a\x04\ + \x98\xb5\x18\x01\x12$\n\x1aMessageType_EthereumSignTx\x10:\x1a\x04\x90\ + \xb5\x18\x01\x12'\n\x1dMessageType_EthereumTxRequest\x10;\x1a\x04\x98\ + \xb5\x18\x01\x12#\n\x19MessageType_EthereumTxAck\x10<\x1a\x04\x90\xb5\ + \x18\x01\x12)\n\x1fMessageType_EthereumSignMessage\x10@\x1a\x04\x90\xb5\ + \x18\x01\x12+\n!MessageType_EthereumVerifyMessage\x10A\x1a\x04\x90\xb5\ + \x18\x01\x12.\n$MessageType_EthereumMessageSignature\x10B\x1a\x04\x98\ + \xb5\x18\x01\x12#\n\x19MessageType_NEMGetAddress\x10C\x1a\x04\x90\xb5\ + \x18\x01\x12\x20\n\x16MessageType_NEMAddress\x10D\x1a\x04\x98\xb5\x18\ + \x01\x12\x1f\n\x15MessageType_NEMSignTx\x10E\x1a\x04\x90\xb5\x18\x01\x12\ + !\n\x17MessageType_NEMSignedTx\x10F\x1a\x04\x98\xb5\x18\x01\x12'\n\x1dMe\ + ssageType_NEMDecryptMessage\x10K\x1a\x04\x90\xb5\x18\x01\x12)\n\x1fMessa\ + geType_NEMDecryptedMessage\x10L\x1a\x04\x98\xb5\x18\x01\x12$\n\x1aMessag\ + eType_LiskGetAddress\x10r\x1a\x04\x90\xb5\x18\x01\x12!\n\x17MessageType_\ + LiskAddress\x10s\x1a\x04\x98\xb5\x18\x01\x12\x20\n\x16MessageType_LiskSi\ + gnTx\x10t\x1a\x04\x90\xb5\x18\x01\x12\"\n\x18MessageType_LiskSignedTx\ + \x10u\x1a\x04\x98\xb5\x18\x01\x12%\n\x1bMessageType_LiskSignMessage\x10v\ + \x1a\x04\x90\xb5\x18\x01\x12*\n\x20MessageType_LiskMessageSignature\x10w\ + \x1a\x04\x98\xb5\x18\x01\x12'\n\x1dMessageType_LiskVerifyMessage\x10x\ + \x1a\x04\x90\xb5\x18\x01\x12&\n\x1cMessageType_LiskGetPublicKey\x10y\x1a\ + \x04\x90\xb5\x18\x01\x12#\n\x19MessageType_LiskPublicKey\x10z\x1a\x04\ + \x98\xb5\x18\x01\x12&\n\x1bMessageType_TezosGetAddress\x10\x96\x01\x1a\ + \x04\x90\xb5\x18\x01\x12#\n\x18MessageType_TezosAddress\x10\x97\x01\x1a\ + \x04\x98\xb5\x18\x01\x12\"\n\x17MessageType_TezosSignTx\x10\x98\x01\x1a\ + \x04\x90\xb5\x18\x01\x12$\n\x19MessageType_TezosSignedTx\x10\x99\x01\x1a\ + \x04\x98\xb5\x18\x01\x12(\n\x1dMessageType_TezosGetPublicKey\x10\x9a\x01\ + \x1a\x04\x90\xb5\x18\x01\x12%\n\x1aMessageType_TezosPublicKey\x10\x9b\ + \x01\x1a\x04\x98\xb5\x18\x01\x12$\n\x19MessageType_StellarSignTx\x10\xca\ + \x01\x1a\x04\x90\xb5\x18\x01\x12)\n\x1eMessageType_StellarTxOpRequest\ + \x10\xcb\x01\x1a\x04\x98\xb5\x18\x01\x12(\n\x1dMessageType_StellarGetAdd\ + ress\x10\xcf\x01\x1a\x04\x90\xb5\x18\x01\x12%\n\x1aMessageType_StellarAd\ + dress\x10\xd0\x01\x1a\x04\x98\xb5\x18\x01\x12-\n\"MessageType_StellarCre\ + ateAccountOp\x10\xd2\x01\x1a\x04\x90\xb5\x18\x01\x12'\n\x1cMessageType_S\ + tellarPaymentOp\x10\xd3\x01\x1a\x04\x90\xb5\x18\x01\x12+\n\x20MessageTyp\ + e_StellarPathPaymentOp\x10\xd4\x01\x1a\x04\x90\xb5\x18\x01\x12+\n\x20Mes\ + sageType_StellarManageOfferOp\x10\xd5\x01\x1a\x04\x90\xb5\x18\x01\x122\n\ + 'MessageType_StellarCreatePassiveOfferOp\x10\xd6\x01\x1a\x04\x90\xb5\x18\ + \x01\x12*\n\x1fMessageType_StellarSetOptionsOp\x10\xd7\x01\x1a\x04\x90\ + \xb5\x18\x01\x12+\n\x20MessageType_StellarChangeTrustOp\x10\xd8\x01\x1a\ + \x04\x90\xb5\x18\x01\x12*\n\x1fMessageType_StellarAllowTrustOp\x10\xd9\ + \x01\x1a\x04\x90\xb5\x18\x01\x12,\n!MessageType_StellarAccountMergeOp\ + \x10\xda\x01\x1a\x04\x90\xb5\x18\x01\x12*\n\x1fMessageType_StellarManage\ + DataOp\x10\xdc\x01\x1a\x04\x90\xb5\x18\x01\x12,\n!MessageType_StellarBum\ + pSequenceOp\x10\xdd\x01\x1a\x04\x90\xb5\x18\x01\x12&\n\x1bMessageType_St\ + ellarSignedTx\x10\xe6\x01\x1a\x04\x98\xb5\x18\x01\x12%\n\x1aMessageType_\ + TronGetAddress\x10\xfa\x01\x1a\x04\x90\xb5\x18\x01\x12\"\n\x17MessageTyp\ + e_TronAddress\x10\xfb\x01\x1a\x04\x98\xb5\x18\x01\x12!\n\x16MessageType_\ + TronSignTx\x10\xfc\x01\x1a\x04\x90\xb5\x18\x01\x12#\n\x18MessageType_Tro\ + nSignedTx\x10\xfd\x01\x1a\x04\x98\xb5\x18\x01\x12$\n\x19MessageType_Card\ + anoSignTx\x10\xaf\x02\x1a\x04\x90\xb5\x18\x01\x12'\n\x1cMessageType_Card\ + anoTxRequest\x10\xb0\x02\x1a\x04\x98\xb5\x18\x01\x12*\n\x1fMessageType_C\ + ardanoGetPublicKey\x10\xb1\x02\x1a\x04\x90\xb5\x18\x01\x12'\n\x1cMessage\ + Type_CardanoPublicKey\x10\xb2\x02\x1a\x04\x98\xb5\x18\x01\x12(\n\x1dMess\ + ageType_CardanoGetAddress\x10\xb3\x02\x1a\x04\x90\xb5\x18\x01\x12%\n\x1a\ + MessageType_CardanoAddress\x10\xb4\x02\x1a\x04\x98\xb5\x18\x01\x12#\n\ + \x18MessageType_CardanoTxAck\x10\xb5\x02\x1a\x04\x90\xb5\x18\x01\x12&\n\ + \x1bMessageType_CardanoSignedTx\x10\xb6\x02\x1a\x04\x98\xb5\x18\x01\x12)\ + \n\x1eMessageType_OntologyGetAddress\x10\xde\x02\x1a\x04\x90\xb5\x18\x01\ + \x12&\n\x1bMessageType_OntologyAddress\x10\xdf\x02\x1a\x04\x98\xb5\x18\ + \x01\x12+\n\x20MessageType_OntologyGetPublicKey\x10\xe0\x02\x1a\x04\x90\ + \xb5\x18\x01\x12(\n\x1dMessageType_OntologyPublicKey\x10\xe1\x02\x1a\x04\ + \x98\xb5\x18\x01\x12+\n\x20MessageType_OntologySignTransfer\x10\xe2\x02\ + \x1a\x04\x90\xb5\x18\x01\x12-\n\"MessageType_OntologySignedTransfer\x10\ + \xe3\x02\x1a\x04\x98\xb5\x18\x01\x12.\n#MessageType_OntologySignWithdraw\ + Ong\x10\xe4\x02\x1a\x04\x90\xb5\x18\x01\x120\n%MessageType_OntologySigne\ + dWithdrawOng\x10\xe5\x02\x1a\x04\x98\xb5\x18\x01\x120\n%MessageType_Onto\ + logySignOntIdRegister\x10\xe6\x02\x1a\x04\x90\xb5\x18\x01\x122\n'Message\ + Type_OntologySignedOntIdRegister\x10\xe7\x02\x1a\x04\x98\xb5\x18\x01\x12\ + 5\n*MessageType_OntologySignOntIdAddAttributes\x10\xe8\x02\x1a\x04\x90\ + \xb5\x18\x01\x127\n,MessageType_OntologySignedOntIdAddAttributes\x10\xe9\ + \x02\x1a\x04\x98\xb5\x18\x01\x12'\n\x1cMessageType_RippleGetAddress\x10\ + \x90\x03\x1a\x04\x90\xb5\x18\x01\x12$\n\x19MessageType_RippleAddress\x10\ + \x91\x03\x1a\x04\x98\xb5\x18\x01\x12#\n\x18MessageType_RippleSignTx\x10\ + \x92\x03\x1a\x04\x90\xb5\x18\x01\x12%\n\x1aMessageType_RippleSignedTx\ + \x10\x93\x03\x1a\x04\x90\xb5\x18\x01\x123\n(MessageType_MoneroTransactio\ + nInitRequest\x10\xf5\x03\x1a\x04\x98\xb5\x18\x01\x12/\n$MessageType_Mone\ + roTransactionInitAck\x10\xf6\x03\x1a\x04\x98\xb5\x18\x01\x127\n,MessageT\ + ype_MoneroTransactionSetInputRequest\x10\xf7\x03\x1a\x04\x98\xb5\x18\x01\ + \x123\n(MessageType_MoneroTransactionSetInputAck\x10\xf8\x03\x1a\x04\x98\ + \xb5\x18\x01\x12@\n5MessageType_MoneroTransactionInputsPermutationReques\ + t\x10\xf9\x03\x1a\x04\x98\xb5\x18\x01\x12<\n1MessageType_MoneroTransacti\ + onInputsPermutationAck\x10\xfa\x03\x1a\x04\x98\xb5\x18\x01\x128\n-Messag\ + eType_MoneroTransactionInputViniRequest\x10\xfb\x03\x1a\x04\x98\xb5\x18\ + \x01\x124\n)MessageType_MoneroTransactionInputViniAck\x10\xfc\x03\x1a\ + \x04\x98\xb5\x18\x01\x12;\n0MessageType_MoneroTransactionAllInputsSetReq\ + uest\x10\xfd\x03\x1a\x04\x98\xb5\x18\x01\x127\n,MessageType_MoneroTransa\ + ctionAllInputsSetAck\x10\xfe\x03\x1a\x04\x98\xb5\x18\x01\x128\n-MessageT\ + ype_MoneroTransactionSetOutputRequest\x10\xff\x03\x1a\x04\x98\xb5\x18\ + \x01\x124\n)MessageType_MoneroTransactionSetOutputAck\x10\x80\x04\x1a\ + \x04\x98\xb5\x18\x01\x128\n-MessageType_MoneroTransactionAllOutSetReques\ + t\x10\x81\x04\x1a\x04\x98\xb5\x18\x01\x124\n)MessageType_MoneroTransacti\ + onAllOutSetAck\x10\x82\x04\x1a\x04\x98\xb5\x18\x01\x128\n-MessageType_Mo\ + neroTransactionMlsagDoneRequest\x10\x83\x04\x1a\x04\x98\xb5\x18\x01\x124\ + \n)MessageType_MoneroTransactionMlsagDoneAck\x10\x84\x04\x1a\x04\x98\xb5\ + \x18\x01\x128\n-MessageType_MoneroTransactionSignInputRequest\x10\x85\ + \x04\x1a\x04\x98\xb5\x18\x01\x124\n)MessageType_MoneroTransactionSignInp\ + utAck\x10\x86\x04\x1a\x04\x98\xb5\x18\x01\x124\n)MessageType_MoneroTrans\ + actionFinalRequest\x10\x87\x04\x1a\x04\x98\xb5\x18\x01\x120\n%MessageTyp\ + e_MoneroTransactionFinalAck\x10\x88\x04\x1a\x04\x98\xb5\x18\x01\x126\n+M\ + essageType_MoneroKeyImageExportInitRequest\x10\x92\x04\x1a\x04\x98\xb5\ + \x18\x01\x122\n'MessageType_MoneroKeyImageExportInitAck\x10\x93\x04\x1a\ + \x04\x98\xb5\x18\x01\x124\n)MessageType_MoneroKeyImageSyncStepRequest\ + \x10\x94\x04\x1a\x04\x98\xb5\x18\x01\x120\n%MessageType_MoneroKeyImageSy\ + ncStepAck\x10\x95\x04\x1a\x04\x98\xb5\x18\x01\x125\n*MessageType_MoneroK\ + eyImageSyncFinalRequest\x10\x96\x04\x1a\x04\x98\xb5\x18\x01\x121\n&Messa\ + geType_MoneroKeyImageSyncFinalAck\x10\x97\x04\x1a\x04\x98\xb5\x18\x01\ + \x12'\n\x1cMessageType_MoneroGetAddress\x10\x9c\x04\x1a\x04\x90\xb5\x18\ + \x01\x12$\n\x19MessageType_MoneroAddress\x10\x9d\x04\x1a\x04\x98\xb5\x18\ + \x01\x12(\n\x1dMessageType_MoneroGetWatchKey\x10\x9e\x04\x1a\x04\x90\xb5\ + \x18\x01\x12%\n\x1aMessageType_MoneroWatchKey\x10\x9f\x04\x1a\x04\x98\ + \xb5\x18\x01\x12-\n\"MessageType_DebugMoneroDiagRequest\x10\xa2\x04\x1a\ + \x04\x90\xb5\x18\x01\x12)\n\x1eMessageType_DebugMoneroDiagAck\x10\xa3\ + \x04\x1a\x04\x98\xb5\x18\x01:<\n\x07wire_in\x18\xd2\x86\x03\x20\x01(\x08\ + \x12!.google.protobuf.EnumValueOptionsR\x06wireIn:>\n\x08wire_out\x18\ + \xd3\x86\x03\x20\x01(\x08\x12!.google.protobuf.EnumValueOptionsR\x07wire\ + Out:G\n\rwire_debug_in\x18\xd4\x86\x03\x20\x01(\x08\x12!.google.protobuf\ + .EnumValueOptionsR\x0bwireDebugIn:I\n\x0ewire_debug_out\x18\xd5\x86\x03\ + \x20\x01(\x08\x12!.google.protobuf.EnumValueOptionsR\x0cwireDebugOut:@\n\ + \twire_tiny\x18\xd6\x86\x03\x20\x01(\x08\x12!.google.protobuf.EnumValueO\ + ptionsR\x08wireTiny:L\n\x0fwire_bootloader\x18\xd7\x86\x03\x20\x01(\x08\ + \x12!.google.protobuf.EnumValueOptionsR\x0ewireBootloader:C\n\x0bwire_no\ + _fsm\x18\xd8\x86\x03\x20\x01(\x08\x12!.google.protobuf.EnumValueOptionsR\ + \twireNoFsmB4\n#com.satoshilabs.trezor.lib.protobufB\rTrezorMessageJ\xae\ + r\n\x07\x12\x05\0\0\xe7\x01\x01\n\x08\n\x01\x0c\x12\x03\0\0\x12\n\x08\n\ + \x01\x02\x12\x03\x01\x08\x1a\n\x08\n\x01\x08\x12\x03\x08\0<\nU\n\x02\x08\ + \x01\x12\x03\x08\0<\x1a#\x20Sugar\x20for\x20easier\x20handling\x20in\x20\ + Java\n2%*\n\x20Messages\x20for\x20TREZOR\x20communication\n\n\x08\n\x01\ + \x08\x12\x03\t\0.\n\t\n\x02\x08\x08\x12\x03\t\0.\n\t\n\x02\x03\0\x12\x03\ + \x0b\x07)\nW\n\x01\x07\x12\x04\x10\0\x18\x01\x1aL*\n\x20Options\x20for\ + \x20specifying\x20message\x20direction\x20and\x20type\x20of\x20wire\x20(\ + normal/debug)\n\nB\n\x02\x07\0\x12\x03\x11\x04\"\"7\x20message\x20can\ + \x20be\x20transmitted\x20via\x20wire\x20from\x20PC\x20to\x20TREZOR\n\n\n\ + \n\x03\x07\0\x02\x12\x03\x10\x07'\n\n\n\x03\x07\0\x04\x12\x03\x11\x04\ + \x0c\n\n\n\x03\x07\0\x05\x12\x03\x11\r\x11\n\n\n\x03\x07\0\x01\x12\x03\ + \x11\x12\x19\n\n\n\x03\x07\0\x03\x12\x03\x11\x1c!\nB\n\x02\x07\x01\x12\ + \x03\x12\x04#\"7\x20message\x20can\x20be\x20transmitted\x20via\x20wire\ + \x20from\x20TREZOR\x20to\x20PC\n\n\n\n\x03\x07\x01\x02\x12\x03\x10\x07'\ + \n\n\n\x03\x07\x01\x04\x12\x03\x12\x04\x0c\n\n\n\x03\x07\x01\x05\x12\x03\ + \x12\r\x11\n\n\n\x03\x07\x01\x01\x12\x03\x12\x12\x1a\n\n\n\x03\x07\x01\ + \x03\x12\x03\x12\x1d\"\nH\n\x02\x07\x02\x12\x03\x13\x04(\"=\x20message\ + \x20can\x20be\x20transmitted\x20via\x20debug\x20wire\x20from\x20PC\x20to\ + \x20TREZOR\n\n\n\n\x03\x07\x02\x02\x12\x03\x10\x07'\n\n\n\x03\x07\x02\ + \x04\x12\x03\x13\x04\x0c\n\n\n\x03\x07\x02\x05\x12\x03\x13\r\x11\n\n\n\ + \x03\x07\x02\x01\x12\x03\x13\x12\x1f\n\n\n\x03\x07\x02\x03\x12\x03\x13\"\ + '\nH\n\x02\x07\x03\x12\x03\x14\x04)\"=\x20message\x20can\x20be\x20transm\ + itted\x20via\x20debug\x20wire\x20from\x20TREZOR\x20to\x20PC\n\n\n\n\x03\ + \x07\x03\x02\x12\x03\x10\x07'\n\n\n\x03\x07\x03\x04\x12\x03\x14\x04\x0c\ + \n\n\n\x03\x07\x03\x05\x12\x03\x14\r\x11\n\n\n\x03\x07\x03\x01\x12\x03\ + \x14\x12\x20\n\n\n\x03\x07\x03\x03\x12\x03\x14#(\nL\n\x02\x07\x04\x12\ + \x03\x15\x04$\"A\x20message\x20is\x20handled\x20by\x20TREZOR\x20when\x20\ + the\x20USB\x20stack\x20is\x20in\x20tiny\x20mode\n\n\n\n\x03\x07\x04\x02\ + \x12\x03\x10\x07'\n\n\n\x03\x07\x04\x04\x12\x03\x15\x04\x0c\n\n\n\x03\ + \x07\x04\x05\x12\x03\x15\r\x11\n\n\n\x03\x07\x04\x01\x12\x03\x15\x12\x1b\ + \n\n\n\x03\x07\x04\x03\x12\x03\x15\x1e#\n9\n\x02\x07\x05\x12\x03\x16\x04\ + *\".\x20message\x20is\x20only\x20handled\x20by\x20TREZOR\x20Bootloader\n\ + \n\n\n\x03\x07\x05\x02\x12\x03\x10\x07'\n\n\n\x03\x07\x05\x04\x12\x03\ + \x16\x04\x0c\n\n\n\x03\x07\x05\x05\x12\x03\x16\r\x11\n\n\n\x03\x07\x05\ + \x01\x12\x03\x16\x12!\n\n\n\x03\x07\x05\x03\x12\x03\x16$)\nR\n\x02\x07\ + \x06\x12\x03\x17\x04&\"G\x20message\x20is\x20not\x20handled\x20by\x20TRE\ + ZOR\x20unless\x20the\x20USB\x20stack\x20is\x20in\x20tiny\x20mode\n\n\n\n\ + \x03\x07\x06\x02\x12\x03\x10\x07'\n\n\n\x03\x07\x06\x04\x12\x03\x17\x04\ + \x0c\n\n\n\x03\x07\x06\x05\x12\x03\x17\r\x11\n\n\n\x03\x07\x06\x01\x12\ + \x03\x17\x12\x1d\n\n\n\x03\x07\x06\x03\x12\x03\x17\x20%\nU\n\x02\x05\0\ + \x12\x05\x1d\0\xe7\x01\x01\x1aH*\n\x20Mapping\x20between\x20TREZOR\x20wi\ + re\x20identifier\x20(uint)\x20and\x20a\x20protobuf\x20message\n\n\n\n\ + \x03\x05\0\x01\x12\x03\x1d\x05\x10\n\x19\n\x04\x05\0\x02\0\x12\x03\x20\ + \x04F\x1a\x0c\x20Management\n\n\x0c\n\x05\x05\0\x02\0\x01\x12\x03\x20\ + \x04\x1a\n\x0c\n\x05\x05\0\x02\0\x02\x12\x03\x20\x1d\x1e\n\x0c\n\x05\x05\ + \0\x02\0\x03\x12\x03\x20\x1fE\n\x0f\n\x08\x05\0\x02\0\x03\xd2\x86\x03\ + \x12\x03\x20\x200\n\x0f\n\x08\x05\0\x02\0\x03\xd6\x86\x03\x12\x03\x202D\ + \n\x0b\n\x04\x05\0\x02\x01\x12\x03!\x04,\n\x0c\n\x05\x05\0\x02\x01\x01\ + \x12\x03!\x04\x14\n\x0c\n\x05\x05\0\x02\x01\x02\x12\x03!\x17\x18\n\x0c\n\ + \x05\x05\0\x02\x01\x03\x12\x03!\x19+\n\x0f\n\x08\x05\0\x02\x01\x03\xd2\ + \x86\x03\x12\x03!\x1a*\n\x0b\n\x04\x05\0\x02\x02\x12\x03\"\x040\n\x0c\n\ + \x05\x05\0\x02\x02\x01\x12\x03\"\x04\x17\n\x0c\n\x05\x05\0\x02\x02\x02\ + \x12\x03\"\x1a\x1b\n\x0c\n\x05\x05\0\x02\x02\x03\x12\x03\"\x1c/\n\x0f\n\ + \x08\x05\0\x02\x02\x03\xd3\x86\x03\x12\x03\"\x1d.\n\x0b\n\x04\x05\0\x02\ + \x03\x12\x03#\x040\n\x0c\n\x05\x05\0\x02\x03\x01\x12\x03#\x04\x17\n\x0c\ + \n\x05\x05\0\x02\x03\x02\x12\x03#\x1a\x1b\n\x0c\n\x05\x05\0\x02\x03\x03\ + \x12\x03#\x1c/\n\x0f\n\x08\x05\0\x02\x03\x03\xd3\x86\x03\x12\x03#\x1d.\n\ + \x0b\n\x04\x05\0\x02\x04\x12\x03$\x041\n\x0c\n\x05\x05\0\x02\x04\x01\x12\ + \x03$\x04\x19\n\x0c\n\x05\x05\0\x02\x04\x02\x12\x03$\x1c\x1d\n\x0c\n\x05\ + \x05\0\x02\x04\x03\x12\x03$\x1e0\n\x0f\n\x08\x05\0\x02\x04\x03\xd2\x86\ + \x03\x12\x03$\x1f/\n\x0b\n\x04\x05\0\x02\x05\x12\x03%\x042\n\x0c\n\x05\ + \x05\0\x02\x05\x01\x12\x03%\x04\x1a\n\x0c\n\x05\x05\0\x02\x05\x02\x12\ + \x03%\x1d\x1e\n\x0c\n\x05\x05\0\x02\x05\x03\x12\x03%\x1f1\n\x0f\n\x08\ + \x05\0\x02\x05\x03\xd2\x86\x03\x12\x03%\x200\n\x0b\n\x04\x05\0\x02\x06\ + \x12\x03&\x042\n\x0c\n\x05\x05\0\x02\x06\x01\x12\x03&\x04\x1a\n\x0c\n\ + \x05\x05\0\x02\x06\x02\x12\x03&\x1d\x1e\n\x0c\n\x05\x05\0\x02\x06\x03\ + \x12\x03&\x1f1\n\x0f\n\x08\x05\0\x02\x06\x03\xd2\x86\x03\x12\x03&\x200\n\ + \x0b\n\x04\x05\0\x02\x07\x12\x03'\x041\n\x0c\n\x05\x05\0\x02\x07\x01\x12\ + \x03'\x04\x17\n\x0c\n\x05\x05\0\x02\x07\x02\x12\x03'\x1a\x1c\n\x0c\n\x05\ + \x05\0\x02\x07\x03\x12\x03'\x1d0\n\x0f\n\x08\x05\0\x02\x07\x03\xd3\x86\ + \x03\x12\x03'\x1e/\n\x0b\n\x04\x05\0\x02\x08\x12\x03(\x043\n\x0c\n\x05\ + \x05\0\x02\x08\x01\x12\x03(\x04\x1a\n\x0c\n\x05\x05\0\x02\x08\x02\x12\ + \x03(\x1d\x1f\n\x0c\n\x05\x05\0\x02\x08\x03\x12\x03(\x202\n\x0f\n\x08\ + \x05\0\x02\x08\x03\xd2\x86\x03\x12\x03(!1\n\x0b\n\x04\x05\0\x02\t\x12\ + \x03)\x044\n\x0c\n\x05\x05\0\x02\t\x01\x12\x03)\x04\x1b\n\x0c\n\x05\x05\ + \0\x02\t\x02\x12\x03)\x1e\x20\n\x0c\n\x05\x05\0\x02\t\x03\x12\x03)!3\n\ + \x0f\n\x08\x05\0\x02\t\x03\xd2\x86\x03\x12\x03)\"2\n\x0b\n\x04\x05\0\x02\ + \n\x12\x03*\x042\n\x0c\n\x05\x05\0\x02\n\x01\x12\x03*\x04\x18\n\x0c\n\ + \x05\x05\0\x02\n\x02\x12\x03*\x1b\x1d\n\x0c\n\x05\x05\0\x02\n\x03\x12\ + \x03*\x1e1\n\x0f\n\x08\x05\0\x02\n\x03\xd3\x86\x03\x12\x03*\x1f0\n\x0b\n\ + \x04\x05\0\x02\x0b\x12\x03+\x04:\n\x0c\n\x05\x05\0\x02\x0b\x01\x12\x03+\ + \x04\x20\n\x0c\n\x05\x05\0\x02\x0b\x02\x12\x03+#%\n\x0c\n\x05\x05\0\x02\ + \x0b\x03\x12\x03+&9\n\x0f\n\x08\x05\0\x02\x0b\x03\xd3\x86\x03\x12\x03+'8\ + \n\x0b\n\x04\x05\0\x02\x0c\x12\x03,\x04_\n\x0c\n\x05\x05\0\x02\x0c\x01\ + \x12\x03,\x04\x1c\n\x0c\n\x05\x05\0\x02\x0c\x02\x12\x03,\x1f!\n\x0c\n\ + \x05\x05\0\x02\x0c\x03\x12\x03,\"^\n\x0f\n\x08\x05\0\x02\x0c\x03\xd2\x86\ + \x03\x12\x03,#3\n\x0f\n\x08\x05\0\x02\x0c\x03\xd6\x86\x03\x12\x03,5G\n\ + \x0f\n\x08\x05\0\x02\x0c\x03\xd8\x86\x03\x12\x03,I]\n\x0b\n\x04\x05\0\ + \x02\r\x12\x03-\x04C\n\x0c\n\x05\x05\0\x02\r\x01\x12\x03-\x04\x16\n\x0c\ + \n\x05\x05\0\x02\r\x02\x12\x03-\x19\x1b\n\x0c\n\x05\x05\0\x02\r\x03\x12\ + \x03-\x1cB\n\x0f\n\x08\x05\0\x02\r\x03\xd2\x86\x03\x12\x03-\x1d-\n\x0f\n\ + \x08\x05\0\x02\r\x03\xd6\x86\x03\x12\x03-/A\n\x0b\n\x04\x05\0\x02\x0e\ + \x12\x03.\x045\n\x0c\n\x05\x05\0\x02\x0e\x01\x12\x03.\x04\x1c\n\x0c\n\ + \x05\x05\0\x02\x0e\x02\x12\x03.\x1f!\n\x0c\n\x05\x05\0\x02\x0e\x03\x12\ + \x03.\"4\n\x0f\n\x08\x05\0\x02\x0e\x03\xd2\x86\x03\x12\x03.#3\n\x0b\n\ + \x04\x05\0\x02\x0f\x12\x03/\x046\n\x0c\n\x05\x05\0\x02\x0f\x01\x12\x03/\ + \x04\x1d\n\x0c\n\x05\x05\0\x02\x0f\x02\x12\x03/\x20\"\n\x0c\n\x05\x05\0\ + \x02\x0f\x03\x12\x03/#5\n\x0f\n\x08\x05\0\x02\x0f\x03\xd2\x86\x03\x12\ + \x03/$4\n\x0b\n\x04\x05\0\x02\x10\x12\x030\x047\n\x0c\n\x05\x05\0\x02\ + \x10\x01\x12\x030\x04\x1d\n\x0c\n\x05\x05\0\x02\x10\x02\x12\x030\x20\"\n\ + \x0c\n\x05\x05\0\x02\x10\x03\x12\x030#6\n\x0f\n\x08\x05\0\x02\x10\x03\ + \xd3\x86\x03\x12\x030$5\n\x0b\n\x04\x05\0\x02\x11\x12\x031\x04\\\n\x0c\n\ + \x05\x05\0\x02\x11\x01\x12\x031\x04\x19\n\x0c\n\x05\x05\0\x02\x11\x02\ + \x12\x031\x1c\x1e\n\x0c\n\x05\x05\0\x02\x11\x03\x12\x031\x1f[\n\x0f\n\ + \x08\x05\0\x02\x11\x03\xd2\x86\x03\x12\x031\x200\n\x0f\n\x08\x05\0\x02\ + \x11\x03\xd6\x86\x03\x12\x0312D\n\x0f\n\x08\x05\0\x02\x11\x03\xd8\x86\ + \x03\x12\x031FZ\n\x0b\n\x04\x05\0\x02\x12\x12\x032\x043\n\x0c\n\x05\x05\ + \0\x02\x12\x01\x12\x032\x04\x1a\n\x0c\n\x05\x05\0\x02\x12\x02\x12\x032\ + \x1d\x1f\n\x0c\n\x05\x05\0\x02\x12\x03\x12\x032\x202\n\x0f\n\x08\x05\0\ + \x02\x12\x03\xd2\x86\x03\x12\x032!1\n\x0b\n\x04\x05\0\x02\x13\x12\x033\ + \x045\n\x0c\n\x05\x05\0\x02\x13\x01\x12\x033\x04\x1c\n\x0c\n\x05\x05\0\ + \x02\x13\x02\x12\x033\x1f!\n\x0c\n\x05\x05\0\x02\x13\x03\x12\x033\"4\n\ + \x0f\n\x08\x05\0\x02\x13\x03\xd2\x86\x03\x12\x033#3\n\x0b\n\x04\x05\0\ + \x02\x14\x12\x034\x048\n\x0c\n\x05\x05\0\x02\x14\x01\x12\x034\x04\x1e\n\ + \x0c\n\x05\x05\0\x02\x14\x02\x12\x034!#\n\x0c\n\x05\x05\0\x02\x14\x03\ + \x12\x034$7\n\x0f\n\x08\x05\0\x02\x14\x03\xd3\x86\x03\x12\x034%6\n\x0b\n\ + \x04\x05\0\x02\x15\x12\x035\x043\n\x0c\n\x05\x05\0\x02\x15\x01\x12\x035\ + \x04\x1a\n\x0c\n\x05\x05\0\x02\x15\x02\x12\x035\x1d\x1f\n\x0c\n\x05\x05\ + \0\x02\x15\x03\x12\x035\x202\n\x0f\n\x08\x05\0\x02\x15\x03\xd2\x86\x03\ + \x12\x035!1\n\x0b\n\x04\x05\0\x02\x16\x12\x036\x04;\n\x0c\n\x05\x05\0\ + \x02\x16\x01\x12\x036\x04!\n\x0c\n\x05\x05\0\x02\x16\x02\x12\x036$&\n\ + \x0c\n\x05\x05\0\x02\x16\x03\x12\x036':\n\x0f\n\x08\x05\0\x02\x16\x03\ + \xd3\x86\x03\x12\x036(9\n\x0b\n\x04\x05\0\x02\x17\x12\x037\x04`\n\x0c\n\ + \x05\x05\0\x02\x17\x01\x12\x037\x04\x1d\n\x0c\n\x05\x05\0\x02\x17\x02\ + \x12\x037\x20\"\n\x0c\n\x05\x05\0\x02\x17\x03\x12\x037#_\n\x0f\n\x08\x05\ + \0\x02\x17\x03\xd2\x86\x03\x12\x037$4\n\x0f\n\x08\x05\0\x02\x17\x03\xd6\ + \x86\x03\x12\x0376H\n\x0f\n\x08\x05\0\x02\x17\x03\xd8\x86\x03\x12\x037J^\ + \n\x0b\n\x04\x05\0\x02\x18\x12\x038\x04@\n\x0c\n\x05\x05\0\x02\x18\x01\ + \x12\x038\x04&\n\x0c\n\x05\x05\0\x02\x18\x02\x12\x038)+\n\x0c\n\x05\x05\ + \0\x02\x18\x03\x12\x038,?\n\x0f\n\x08\x05\0\x02\x18\x03\xd3\x86\x03\x12\ + \x038->\n\x0b\n\x04\x05\0\x02\x19\x12\x039\x04e\n\x0c\n\x05\x05\0\x02\ + \x19\x01\x12\x039\x04\"\n\x0c\n\x05\x05\0\x02\x19\x02\x12\x039%'\n\x0c\n\ + \x05\x05\0\x02\x19\x03\x12\x039(d\n\x0f\n\x08\x05\0\x02\x19\x03\xd2\x86\ + \x03\x12\x039)9\n\x0f\n\x08\x05\0\x02\x19\x03\xd6\x86\x03\x12\x039;M\n\ + \x0f\n\x08\x05\0\x02\x19\x03\xd8\x86\x03\x12\x039Oc\n\x0b\n\x04\x05\0\ + \x02\x1a\x12\x03:\x047\n\x0c\n\x05\x05\0\x02\x1a\x01\x12\x03:\x04\x1e\n\ + \x0c\n\x05\x05\0\x02\x1a\x02\x12\x03:!#\n\x0c\n\x05\x05\0\x02\x1a\x03\ + \x12\x03:$6\n\x0f\n\x08\x05\0\x02\x1a\x03\xd2\x86\x03\x12\x03:%5\n\x0b\n\ + \x04\x05\0\x02\x1b\x12\x03;\x045\n\x0c\n\x05\x05\0\x02\x1b\x01\x12\x03;\ + \x04\x1b\n\x0c\n\x05\x05\0\x02\x1b\x02\x12\x03;\x1e\x20\n\x0c\n\x05\x05\ + \0\x02\x1b\x03\x12\x03;!4\n\x0f\n\x08\x05\0\x02\x1b\x03\xd3\x86\x03\x12\ + \x03;\"3\n\x0b\n\x04\x05\0\x02\x1c\x12\x03<\x040\n\x0c\n\x05\x05\0\x02\ + \x1c\x01\x12\x03<\x04\x17\n\x0c\n\x05\x05\0\x02\x1c\x02\x12\x03<\x1a\x1c\ + \n\x0c\n\x05\x05\0\x02\x1c\x03\x12\x03<\x1d/\n\x0f\n\x08\x05\0\x02\x1c\ + \x03\xd2\x86\x03\x12\x03<\x1e.\n\x0b\n\x04\x05\0\x02\x1d\x12\x03=\x044\n\ + \x0c\n\x05\x05\0\x02\x1d\x01\x12\x03=\x04\x1b\n\x0c\n\x05\x05\0\x02\x1d\ + \x02\x12\x03=\x1e\x20\n\x0c\n\x05\x05\0\x02\x1d\x03\x12\x03=!3\n\x0f\n\ + \x08\x05\0\x02\x1d\x03\xd2\x86\x03\x12\x03=\"2\n\x0b\n\x04\x05\0\x02\x1e\ + \x12\x03>\x046\n\x0c\n\x05\x05\0\x02\x1e\x01\x12\x03>\x04\x1d\n\x0c\n\ + \x05\x05\0\x02\x1e\x02\x12\x03>\x20\"\n\x0c\n\x05\x05\0\x02\x1e\x03\x12\ + \x03>#5\n\x0f\n\x08\x05\0\x02\x1e\x03\xd2\x86\x03\x12\x03>$4\n\x19\n\x04\ + \x05\0\x02\x1f\x12\x03A\x04O\x1a\x0c\x20Bootloader\n\n\x0c\n\x05\x05\0\ + \x02\x1f\x01\x12\x03A\x04\x1d\n\x0c\n\x05\x05\0\x02\x1f\x02\x12\x03A\x20\ + !\n\x0c\n\x05\x05\0\x02\x1f\x03\x12\x03A\"N\n\x0f\n\x08\x05\0\x02\x1f\ + \x03\xd2\x86\x03\x12\x03A#3\n\x0f\n\x08\x05\0\x02\x1f\x03\xd7\x86\x03\ + \x12\x03A5M\n\x0b\n\x04\x05\0\x02\x20\x12\x03B\x04P\n\x0c\n\x05\x05\0\ + \x02\x20\x01\x12\x03B\x04\x1e\n\x0c\n\x05\x05\0\x02\x20\x02\x12\x03B!\"\ + \n\x0c\n\x05\x05\0\x02\x20\x03\x12\x03B#O\n\x0f\n\x08\x05\0\x02\x20\x03\ + \xd2\x86\x03\x12\x03B$4\n\x0f\n\x08\x05\0\x02\x20\x03\xd7\x86\x03\x12\ + \x03B6N\n\x0b\n\x04\x05\0\x02!\x12\x03C\x04R\n\x0c\n\x05\x05\0\x02!\x01\ + \x12\x03C\x04\x1f\n\x0c\n\x05\x05\0\x02!\x02\x12\x03C\"#\n\x0c\n\x05\x05\ + \0\x02!\x03\x12\x03C$Q\n\x0f\n\x08\x05\0\x02!\x03\xd3\x86\x03\x12\x03C%6\ + \n\x0f\n\x08\x05\0\x02!\x03\xd7\x86\x03\x12\x03C8P\n\x0b\n\x04\x05\0\x02\ + \"\x12\x03D\x04K\n\x0c\n\x05\x05\0\x02\"\x01\x12\x03D\x04\x18\n\x0c\n\ + \x05\x05\0\x02\"\x02\x12\x03D\x1b\x1d\n\x0c\n\x05\x05\0\x02\"\x03\x12\ + \x03D\x1eJ\n\x0f\n\x08\x05\0\x02\"\x03\xd2\x86\x03\x12\x03D\x1f/\n\x0f\n\ + \x08\x05\0\x02\"\x03\xd7\x86\x03\x12\x03D1I\n\x16\n\x04\x05\0\x02#\x12\ + \x03G\x045\x1a\t\x20Bitcoin\n\n\x0c\n\x05\x05\0\x02#\x01\x12\x03G\x04\ + \x1c\n\x0c\n\x05\x05\0\x02#\x02\x12\x03G\x1f!\n\x0c\n\x05\x05\0\x02#\x03\ + \x12\x03G\"4\n\x0f\n\x08\x05\0\x02#\x03\xd2\x86\x03\x12\x03G#3\n\x0b\n\ + \x04\x05\0\x02$\x12\x03H\x043\n\x0c\n\x05\x05\0\x02$\x01\x12\x03H\x04\ + \x19\n\x0c\n\x05\x05\0\x02$\x02\x12\x03H\x1c\x1e\n\x0c\n\x05\x05\0\x02$\ + \x03\x12\x03H\x1f2\n\x0f\n\x08\x05\0\x02$\x03\xd3\x86\x03\x12\x03H\x201\ + \n\x0b\n\x04\x05\0\x02%\x12\x03I\x04/\n\x0c\n\x05\x05\0\x02%\x01\x12\x03\ + I\x04\x16\n\x0c\n\x05\x05\0\x02%\x02\x12\x03I\x19\x1b\n\x0c\n\x05\x05\0\ + \x02%\x03\x12\x03I\x1c.\n\x0f\n\x08\x05\0\x02%\x03\xd2\x86\x03\x12\x03I\ + \x1d-\n\x0b\n\x04\x05\0\x02&\x12\x03J\x043\n\x0c\n\x05\x05\0\x02&\x01\ + \x12\x03J\x04\x19\n\x0c\n\x05\x05\0\x02&\x02\x12\x03J\x1c\x1e\n\x0c\n\ + \x05\x05\0\x02&\x03\x12\x03J\x1f2\n\x0f\n\x08\x05\0\x02&\x03\xd3\x86\x03\ + \x12\x03J\x201\n\x0b\n\x04\x05\0\x02'\x12\x03K\x04.\n\x0c\n\x05\x05\0\ + \x02'\x01\x12\x03K\x04\x15\n\x0c\n\x05\x05\0\x02'\x02\x12\x03K\x18\x1a\n\ + \x0c\n\x05\x05\0\x02'\x03\x12\x03K\x1b-\n\x0f\n\x08\x05\0\x02'\x03\xd2\ + \x86\x03\x12\x03K\x1c,\n\x0b\n\x04\x05\0\x02(\x12\x03L\x043\n\x0c\n\x05\ + \x05\0\x02(\x01\x12\x03L\x04\x1a\n\x0c\n\x05\x05\0\x02(\x02\x12\x03L\x1d\ + \x1f\n\x0c\n\x05\x05\0\x02(\x03\x12\x03L\x202\n\x0f\n\x08\x05\0\x02(\x03\ + \xd2\x86\x03\x12\x03L!1\n\x0b\n\x04\x05\0\x02)\x12\x03M\x041\n\x0c\n\x05\ + \x05\0\x02)\x01\x12\x03M\x04\x17\n\x0c\n\x05\x05\0\x02)\x02\x12\x03M\x1a\ + \x1c\n\x0c\n\x05\x05\0\x02)\x03\x12\x03M\x1d0\n\x0f\n\x08\x05\0\x02)\x03\ + \xd3\x86\x03\x12\x03M\x1e/\n\x0b\n\x04\x05\0\x02*\x12\x03N\x044\n\x0c\n\ + \x05\x05\0\x02*\x01\x12\x03N\x04\x1b\n\x0c\n\x05\x05\0\x02*\x02\x12\x03N\ + \x1e\x20\n\x0c\n\x05\x05\0\x02*\x03\x12\x03N!3\n\x0f\n\x08\x05\0\x02*\ + \x03\xd2\x86\x03\x12\x03N\"2\n\x0b\n\x04\x05\0\x02+\x12\x03O\x046\n\x0c\ + \n\x05\x05\0\x02+\x01\x12\x03O\x04\x1d\n\x0c\n\x05\x05\0\x02+\x02\x12\ + \x03O\x20\"\n\x0c\n\x05\x05\0\x02+\x03\x12\x03O#5\n\x0f\n\x08\x05\0\x02+\ + \x03\xd2\x86\x03\x12\x03O$4\n\x0b\n\x04\x05\0\x02,\x12\x03P\x04:\n\x0c\n\ + \x05\x05\0\x02,\x01\x12\x03P\x04\x20\n\x0c\n\x05\x05\0\x02,\x02\x12\x03P\ + #%\n\x0c\n\x05\x05\0\x02,\x03\x12\x03P&9\n\x0f\n\x08\x05\0\x02,\x03\xd3\ + \x86\x03\x12\x03P'8\n\x15\n\x04\x05\0\x02-\x12\x03S\x047\x1a\x08\x20Cryp\ + to\n\n\x0c\n\x05\x05\0\x02-\x01\x12\x03S\x04\x1e\n\x0c\n\x05\x05\0\x02-\ + \x02\x12\x03S!#\n\x0c\n\x05\x05\0\x02-\x03\x12\x03S$6\n\x0f\n\x08\x05\0\ + \x02-\x03\xd2\x86\x03\x12\x03S%5\n\x0b\n\x04\x05\0\x02.\x12\x03T\x04:\n\ + \x0c\n\x05\x05\0\x02.\x01\x12\x03T\x04\x20\n\x0c\n\x05\x05\0\x02.\x02\ + \x12\x03T#%\n\x0c\n\x05\x05\0\x02.\x03\x12\x03T&9\n\x0f\n\x08\x05\0\x02.\ + \x03\xd3\x86\x03\x12\x03T'8\n\x0b\n\x04\x05\0\x02/\x12\x03U\x045\n\x0c\n\ + \x05\x05\0\x02/\x01\x12\x03U\x04\x1c\n\x0c\n\x05\x05\0\x02/\x02\x12\x03U\ + \x1f!\n\x0c\n\x05\x05\0\x02/\x03\x12\x03U\"4\n\x0f\n\x08\x05\0\x02/\x03\ + \xd2\x86\x03\x12\x03U#3\n\x0b\n\x04\x05\0\x020\x12\x03V\x048\n\x0c\n\x05\ + \x05\0\x020\x01\x12\x03V\x04\x1e\n\x0c\n\x05\x05\0\x020\x02\x12\x03V!#\n\ + \x0c\n\x05\x05\0\x020\x03\x12\x03V$7\n\x0f\n\x08\x05\0\x020\x03\xd3\x86\ + \x03\x12\x03V%6\n\x0b\n\x04\x05\0\x021\x12\x03W\x04:\n\x0c\n\x05\x05\0\ + \x021\x01\x12\x03W\x04!\n\x0c\n\x05\x05\0\x021\x02\x12\x03W$&\n\x0c\n\ + \x05\x05\0\x021\x03\x12\x03W'9\n\x0f\n\x08\x05\0\x021\x03\xd2\x86\x03\ + \x12\x03W(8\n\x0b\n\x04\x05\0\x022\x12\x03X\x048\n\x0c\n\x05\x05\0\x022\ + \x01\x12\x03X\x04\x1e\n\x0c\n\x05\x05\0\x022\x02\x12\x03X!#\n\x0c\n\x05\ + \x05\0\x022\x03\x12\x03X$7\n\x0f\n\x08\x05\0\x022\x03\xd3\x86\x03\x12\ + \x03X%6\n\x0b\n\x04\x05\0\x023\x12\x03Y\x043\n\x0c\n\x05\x05\0\x023\x01\ + \x12\x03Y\x04\x1a\n\x0c\n\x05\x05\0\x023\x02\x12\x03Y\x1d\x1f\n\x0c\n\ + \x05\x05\0\x023\x03\x12\x03Y\x202\n\x0f\n\x08\x05\0\x023\x03\xd2\x86\x03\ + \x12\x03Y!1\n\x0b\n\x04\x05\0\x024\x12\x03Z\x048\n\x0c\n\x05\x05\0\x024\ + \x01\x12\x03Z\x04\x1e\n\x0c\n\x05\x05\0\x024\x02\x12\x03Z!#\n\x0c\n\x05\ + \x05\0\x024\x03\x12\x03Z$7\n\x0f\n\x08\x05\0\x024\x03\xd3\x86\x03\x12\ + \x03Z%6\n\x0b\n\x04\x05\0\x025\x12\x03[\x041\n\x0c\n\x05\x05\0\x025\x01\ + \x12\x03[\x04\x18\n\x0c\n\x05\x05\0\x025\x02\x12\x03[\x1b\x1d\n\x0c\n\ + \x05\x05\0\x025\x03\x12\x03[\x1e0\n\x0f\n\x08\x05\0\x025\x03\xd2\x86\x03\ + \x12\x03[\x1f/\n\x0b\n\x04\x05\0\x026\x12\x03\\\x047\n\x0c\n\x05\x05\0\ + \x026\x01\x12\x03\\\x04\x1d\n\x0c\n\x05\x05\0\x026\x02\x12\x03\\\x20\"\n\ + \x0c\n\x05\x05\0\x026\x03\x12\x03\\#6\n\x0f\n\x08\x05\0\x026\x03\xd3\x86\ + \x03\x12\x03\\$5\n\x14\n\x04\x05\0\x027\x12\x03_\x04k\x1a\x07\x20Debug\n\ + \n\x0c\n\x05\x05\0\x027\x01\x12\x03_\x04!\n\x0c\n\x05\x05\0\x027\x02\x12\ + \x03_$'\n\x0c\n\x05\x05\0\x027\x03\x12\x03_(j\n\x0f\n\x08\x05\0\x027\x03\ + \xd4\x86\x03\x12\x03_)?\n\x0f\n\x08\x05\0\x027\x03\xd6\x86\x03\x12\x03_A\ + S\n\x0f\n\x08\x05\0\x027\x03\xd8\x86\x03\x12\x03_Ui\n\x0b\n\x04\x05\0\ + \x028\x12\x03`\x04U\n\x0c\n\x05\x05\0\x028\x01\x12\x03`\x04!\n\x0c\n\x05\ + \x05\0\x028\x02\x12\x03`$'\n\x0c\n\x05\x05\0\x028\x03\x12\x03`(T\n\x0f\n\ + \x08\x05\0\x028\x03\xd4\x86\x03\x12\x03`)?\n\x0f\n\x08\x05\0\x028\x03\ + \xd6\x86\x03\x12\x03`AS\n\x0b\n\x04\x05\0\x029\x12\x03a\x04?\n\x0c\n\x05\ + \x05\0\x029\x01\x12\x03a\x04\x1e\n\x0c\n\x05\x05\0\x029\x02\x12\x03a!$\n\ + \x0c\n\x05\x05\0\x029\x03\x12\x03a%>\n\x0f\n\x08\x05\0\x029\x03\xd5\x86\ + \x03\x12\x03a&=\n\x0b\n\x04\x05\0\x02:\x12\x03b\x04=\n\x0c\n\x05\x05\0\ + \x02:\x01\x12\x03b\x04\x1d\n\x0c\n\x05\x05\0\x02:\x02\x12\x03b\x20#\n\ + \x0c\n\x05\x05\0\x02:\x03\x12\x03b$<\n\x0f\n\x08\x05\0\x02:\x03\xd4\x86\ + \x03\x12\x03b%;\n\x0b\n\x04\x05\0\x02;\x12\x03c\x04=\n\x0c\n\x05\x05\0\ + \x02;\x01\x12\x03c\x04\x1c\n\x0c\n\x05\x05\0\x02;\x02\x12\x03c\x1f\"\n\ + \x0c\n\x05\x05\0\x02;\x03\x12\x03c#<\n\x0f\n\x08\x05\0\x02;\x03\xd5\x86\ + \x03\x12\x03c$;\n\x0b\n\x04\x05\0\x02<\x12\x03d\x04C\n\x0c\n\x05\x05\0\ + \x02<\x01\x12\x03d\x04#\n\x0c\n\x05\x05\0\x02<\x02\x12\x03d&)\n\x0c\n\ + \x05\x05\0\x02<\x03\x12\x03d*B\n\x0f\n\x08\x05\0\x02<\x03\xd4\x86\x03\ + \x12\x03d+A\n\x0b\n\x04\x05\0\x02=\x12\x03e\x04@\n\x0c\n\x05\x05\0\x02=\ + \x01\x12\x03e\x04\x1f\n\x0c\n\x05\x05\0\x02=\x02\x12\x03e\"%\n\x0c\n\x05\ + \x05\0\x02=\x03\x12\x03e&?\n\x0f\n\x08\x05\0\x02=\x03\xd5\x86\x03\x12\ + \x03e'>\n\x0b\n\x04\x05\0\x02>\x12\x03f\x04D\n\x0c\n\x05\x05\0\x02>\x01\ + \x12\x03f\x04$\n\x0c\n\x05\x05\0\x02>\x02\x12\x03f'*\n\x0c\n\x05\x05\0\ + \x02>\x03\x12\x03f+C\n\x0f\n\x08\x05\0\x02>\x03\xd4\x86\x03\x12\x03f,B\n\ + \x0b\n\x04\x05\0\x02?\x12\x03g\x04C\n\x0c\n\x05\x05\0\x02?\x01\x12\x03g\ + \x04#\n\x0c\n\x05\x05\0\x02?\x02\x12\x03g&)\n\x0c\n\x05\x05\0\x02?\x03\ + \x12\x03g*B\n\x0f\n\x08\x05\0\x02?\x03\xd4\x86\x03\x12\x03g+A\n\x17\n\ + \x04\x05\0\x02@\x12\x03j\x04;\x1a\n\x20Ethereum\n\n\x0c\n\x05\x05\0\x02@\ + \x01\x12\x03j\x04\"\n\x0c\n\x05\x05\0\x02@\x02\x12\x03j%'\n\x0c\n\x05\ + \x05\0\x02@\x03\x12\x03j(:\n\x0f\n\x08\x05\0\x02@\x03\xd2\x86\x03\x12\ + \x03j)9\n\x0b\n\x04\x05\0\x02A\x12\x03k\x049\n\x0c\n\x05\x05\0\x02A\x01\ + \x12\x03k\x04\x1f\n\x0c\n\x05\x05\0\x02A\x02\x12\x03k\"$\n\x0c\n\x05\x05\ + \0\x02A\x03\x12\x03k%8\n\x0f\n\x08\x05\0\x02A\x03\xd3\x86\x03\x12\x03k&7\ + \n\x0b\n\x04\x05\0\x02B\x12\x03l\x047\n\x0c\n\x05\x05\0\x02B\x01\x12\x03\ + l\x04\x1e\n\x0c\n\x05\x05\0\x02B\x02\x12\x03l!#\n\x0c\n\x05\x05\0\x02B\ + \x03\x12\x03l$6\n\x0f\n\x08\x05\0\x02B\x03\xd2\x86\x03\x12\x03l%5\n\x0b\ + \n\x04\x05\0\x02C\x12\x03m\x04;\n\x0c\n\x05\x05\0\x02C\x01\x12\x03m\x04!\ + \n\x0c\n\x05\x05\0\x02C\x02\x12\x03m$&\n\x0c\n\x05\x05\0\x02C\x03\x12\ + \x03m':\n\x0f\n\x08\x05\0\x02C\x03\xd3\x86\x03\x12\x03m(9\n\x0b\n\x04\ + \x05\0\x02D\x12\x03n\x046\n\x0c\n\x05\x05\0\x02D\x01\x12\x03n\x04\x1d\n\ + \x0c\n\x05\x05\0\x02D\x02\x12\x03n\x20\"\n\x0c\n\x05\x05\0\x02D\x03\x12\ + \x03n#5\n\x0f\n\x08\x05\0\x02D\x03\xd2\x86\x03\x12\x03n$4\n\x0b\n\x04\ + \x05\0\x02E\x12\x03o\x04<\n\x0c\n\x05\x05\0\x02E\x01\x12\x03o\x04#\n\x0c\ + \n\x05\x05\0\x02E\x02\x12\x03o&(\n\x0c\n\x05\x05\0\x02E\x03\x12\x03o);\n\ + \x0f\n\x08\x05\0\x02E\x03\xd2\x86\x03\x12\x03o*:\n\x0b\n\x04\x05\0\x02F\ + \x12\x03p\x04>\n\x0c\n\x05\x05\0\x02F\x01\x12\x03p\x04%\n\x0c\n\x05\x05\ + \0\x02F\x02\x12\x03p(*\n\x0c\n\x05\x05\0\x02F\x03\x12\x03p+=\n\x0f\n\x08\ + \x05\0\x02F\x03\xd2\x86\x03\x12\x03p,<\n\x0b\n\x04\x05\0\x02G\x12\x03q\ + \x04B\n\x0c\n\x05\x05\0\x02G\x01\x12\x03q\x04(\n\x0c\n\x05\x05\0\x02G\ + \x02\x12\x03q+-\n\x0c\n\x05\x05\0\x02G\x03\x12\x03q.A\n\x0f\n\x08\x05\0\ + \x02G\x03\xd3\x86\x03\x12\x03q/@\n\x12\n\x04\x05\0\x02H\x12\x03t\x046\ + \x1a\x05\x20NEM\n\n\x0c\n\x05\x05\0\x02H\x01\x12\x03t\x04\x1d\n\x0c\n\ + \x05\x05\0\x02H\x02\x12\x03t\x20\"\n\x0c\n\x05\x05\0\x02H\x03\x12\x03t#5\ + \n\x0f\n\x08\x05\0\x02H\x03\xd2\x86\x03\x12\x03t$4\n\x0b\n\x04\x05\0\x02\ + I\x12\x03u\x044\n\x0c\n\x05\x05\0\x02I\x01\x12\x03u\x04\x1a\n\x0c\n\x05\ + \x05\0\x02I\x02\x12\x03u\x1d\x1f\n\x0c\n\x05\x05\0\x02I\x03\x12\x03u\x20\ + 3\n\x0f\n\x08\x05\0\x02I\x03\xd3\x86\x03\x12\x03u!2\n\x0b\n\x04\x05\0\ + \x02J\x12\x03v\x042\n\x0c\n\x05\x05\0\x02J\x01\x12\x03v\x04\x19\n\x0c\n\ + \x05\x05\0\x02J\x02\x12\x03v\x1c\x1e\n\x0c\n\x05\x05\0\x02J\x03\x12\x03v\ + \x1f1\n\x0f\n\x08\x05\0\x02J\x03\xd2\x86\x03\x12\x03v\x200\n\x0b\n\x04\ + \x05\0\x02K\x12\x03w\x045\n\x0c\n\x05\x05\0\x02K\x01\x12\x03w\x04\x1b\n\ + \x0c\n\x05\x05\0\x02K\x02\x12\x03w\x1e\x20\n\x0c\n\x05\x05\0\x02K\x03\ + \x12\x03w!4\n\x0f\n\x08\x05\0\x02K\x03\xd3\x86\x03\x12\x03w\"3\n\x0b\n\ + \x04\x05\0\x02L\x12\x03x\x04:\n\x0c\n\x05\x05\0\x02L\x01\x12\x03x\x04!\n\ + \x0c\n\x05\x05\0\x02L\x02\x12\x03x$&\n\x0c\n\x05\x05\0\x02L\x03\x12\x03x\ + '9\n\x0f\n\x08\x05\0\x02L\x03\xd2\x86\x03\x12\x03x(8\n\x0b\n\x04\x05\0\ + \x02M\x12\x03y\x04=\n\x0c\n\x05\x05\0\x02M\x01\x12\x03y\x04#\n\x0c\n\x05\ + \x05\0\x02M\x02\x12\x03y&(\n\x0c\n\x05\x05\0\x02M\x03\x12\x03y)<\n\x0f\n\ + \x08\x05\0\x02M\x03\xd3\x86\x03\x12\x03y*;\n\x13\n\x04\x05\0\x02N\x12\ + \x03|\x048\x1a\x06\x20Lisk\n\n\x0c\n\x05\x05\0\x02N\x01\x12\x03|\x04\x1e\ + \n\x0c\n\x05\x05\0\x02N\x02\x12\x03|!$\n\x0c\n\x05\x05\0\x02N\x03\x12\ + \x03|%7\n\x0f\n\x08\x05\0\x02N\x03\xd2\x86\x03\x12\x03|&6\n\x0b\n\x04\ + \x05\0\x02O\x12\x03}\x046\n\x0c\n\x05\x05\0\x02O\x01\x12\x03}\x04\x1b\n\ + \x0c\n\x05\x05\0\x02O\x02\x12\x03}\x1e!\n\x0c\n\x05\x05\0\x02O\x03\x12\ + \x03}\"5\n\x0f\n\x08\x05\0\x02O\x03\xd3\x86\x03\x12\x03}#4\n\x0b\n\x04\ + \x05\0\x02P\x12\x03~\x044\n\x0c\n\x05\x05\0\x02P\x01\x12\x03~\x04\x1a\n\ + \x0c\n\x05\x05\0\x02P\x02\x12\x03~\x1d\x20\n\x0c\n\x05\x05\0\x02P\x03\ + \x12\x03~!3\n\x0f\n\x08\x05\0\x02P\x03\xd2\x86\x03\x12\x03~\"2\n\x0b\n\ + \x04\x05\0\x02Q\x12\x03\x7f\x047\n\x0c\n\x05\x05\0\x02Q\x01\x12\x03\x7f\ + \x04\x1c\n\x0c\n\x05\x05\0\x02Q\x02\x12\x03\x7f\x1f\"\n\x0c\n\x05\x05\0\ + \x02Q\x03\x12\x03\x7f#6\n\x0f\n\x08\x05\0\x02Q\x03\xd3\x86\x03\x12\x03\ + \x7f$5\n\x0c\n\x04\x05\0\x02R\x12\x04\x80\x01\x049\n\r\n\x05\x05\0\x02R\ + \x01\x12\x04\x80\x01\x04\x1f\n\r\n\x05\x05\0\x02R\x02\x12\x04\x80\x01\"%\ + \n\r\n\x05\x05\0\x02R\x03\x12\x04\x80\x01&8\n\x10\n\x08\x05\0\x02R\x03\ + \xd2\x86\x03\x12\x04\x80\x01'7\n\x0c\n\x04\x05\0\x02S\x12\x04\x81\x01\ + \x04?\n\r\n\x05\x05\0\x02S\x01\x12\x04\x81\x01\x04$\n\r\n\x05\x05\0\x02S\ + \x02\x12\x04\x81\x01'*\n\r\n\x05\x05\0\x02S\x03\x12\x04\x81\x01+>\n\x10\ + \n\x08\x05\0\x02S\x03\xd3\x86\x03\x12\x04\x81\x01,=\n\x0c\n\x04\x05\0\ + \x02T\x12\x04\x82\x01\x04;\n\r\n\x05\x05\0\x02T\x01\x12\x04\x82\x01\x04!\ + \n\r\n\x05\x05\0\x02T\x02\x12\x04\x82\x01$'\n\r\n\x05\x05\0\x02T\x03\x12\ + \x04\x82\x01(:\n\x10\n\x08\x05\0\x02T\x03\xd2\x86\x03\x12\x04\x82\x01)9\ + \n\x0c\n\x04\x05\0\x02U\x12\x04\x83\x01\x04:\n\r\n\x05\x05\0\x02U\x01\ + \x12\x04\x83\x01\x04\x20\n\r\n\x05\x05\0\x02U\x02\x12\x04\x83\x01#&\n\r\ + \n\x05\x05\0\x02U\x03\x12\x04\x83\x01'9\n\x10\n\x08\x05\0\x02U\x03\xd2\ + \x86\x03\x12\x04\x83\x01(8\n\x0c\n\x04\x05\0\x02V\x12\x04\x84\x01\x048\n\ + \r\n\x05\x05\0\x02V\x01\x12\x04\x84\x01\x04\x1d\n\r\n\x05\x05\0\x02V\x02\ + \x12\x04\x84\x01\x20#\n\r\n\x05\x05\0\x02V\x03\x12\x04\x84\x01$7\n\x10\n\ + \x08\x05\0\x02V\x03\xd3\x86\x03\x12\x04\x84\x01%6\n\x15\n\x04\x05\0\x02W\ + \x12\x04\x87\x01\x049\x1a\x07\x20Tezos\n\n\r\n\x05\x05\0\x02W\x01\x12\ + \x04\x87\x01\x04\x1f\n\r\n\x05\x05\0\x02W\x02\x12\x04\x87\x01\"%\n\r\n\ + \x05\x05\0\x02W\x03\x12\x04\x87\x01&8\n\x10\n\x08\x05\0\x02W\x03\xd2\x86\ + \x03\x12\x04\x87\x01'7\n\x0c\n\x04\x05\0\x02X\x12\x04\x88\x01\x047\n\r\n\ + \x05\x05\0\x02X\x01\x12\x04\x88\x01\x04\x1c\n\r\n\x05\x05\0\x02X\x02\x12\ + \x04\x88\x01\x1f\"\n\r\n\x05\x05\0\x02X\x03\x12\x04\x88\x01#6\n\x10\n\ + \x08\x05\0\x02X\x03\xd3\x86\x03\x12\x04\x88\x01$5\n\x0c\n\x04\x05\0\x02Y\ + \x12\x04\x89\x01\x045\n\r\n\x05\x05\0\x02Y\x01\x12\x04\x89\x01\x04\x1b\n\ + \r\n\x05\x05\0\x02Y\x02\x12\x04\x89\x01\x1e!\n\r\n\x05\x05\0\x02Y\x03\ + \x12\x04\x89\x01\"4\n\x10\n\x08\x05\0\x02Y\x03\xd2\x86\x03\x12\x04\x89\ + \x01#3\n\x0c\n\x04\x05\0\x02Z\x12\x04\x8a\x01\x048\n\r\n\x05\x05\0\x02Z\ + \x01\x12\x04\x8a\x01\x04\x1d\n\r\n\x05\x05\0\x02Z\x02\x12\x04\x8a\x01\ + \x20#\n\r\n\x05\x05\0\x02Z\x03\x12\x04\x8a\x01$7\n\x10\n\x08\x05\0\x02Z\ + \x03\xd3\x86\x03\x12\x04\x8a\x01%6\n\x0c\n\x04\x05\0\x02[\x12\x04\x8b\ + \x01\x04;\n\r\n\x05\x05\0\x02[\x01\x12\x04\x8b\x01\x04!\n\r\n\x05\x05\0\ + \x02[\x02\x12\x04\x8b\x01$'\n\r\n\x05\x05\0\x02[\x03\x12\x04\x8b\x01(:\n\ + \x10\n\x08\x05\0\x02[\x03\xd2\x86\x03\x12\x04\x8b\x01)9\n\x0c\n\x04\x05\ + \0\x02\\\x12\x04\x8c\x01\x049\n\r\n\x05\x05\0\x02\\\x01\x12\x04\x8c\x01\ + \x04\x1e\n\r\n\x05\x05\0\x02\\\x02\x12\x04\x8c\x01!$\n\r\n\x05\x05\0\x02\ + \\\x03\x12\x04\x8c\x01%8\n\x10\n\x08\x05\0\x02\\\x03\xd3\x86\x03\x12\x04\ + \x8c\x01&7\n\x17\n\x04\x05\0\x02]\x12\x04\x8f\x01\x047\x1a\t\x20Stellar\ + \n\n\r\n\x05\x05\0\x02]\x01\x12\x04\x8f\x01\x04\x1d\n\r\n\x05\x05\0\x02]\ + \x02\x12\x04\x8f\x01\x20#\n\r\n\x05\x05\0\x02]\x03\x12\x04\x8f\x01$6\n\ + \x10\n\x08\x05\0\x02]\x03\xd2\x86\x03\x12\x04\x8f\x01%5\n\x0c\n\x04\x05\ + \0\x02^\x12\x04\x90\x01\x04=\n\r\n\x05\x05\0\x02^\x01\x12\x04\x90\x01\ + \x04\"\n\r\n\x05\x05\0\x02^\x02\x12\x04\x90\x01%(\n\r\n\x05\x05\0\x02^\ + \x03\x12\x04\x90\x01)<\n\x10\n\x08\x05\0\x02^\x03\xd3\x86\x03\x12\x04\ + \x90\x01*;\n\x0c\n\x04\x05\0\x02_\x12\x04\x91\x01\x04;\n\r\n\x05\x05\0\ + \x02_\x01\x12\x04\x91\x01\x04!\n\r\n\x05\x05\0\x02_\x02\x12\x04\x91\x01$\ + '\n\r\n\x05\x05\0\x02_\x03\x12\x04\x91\x01(:\n\x10\n\x08\x05\0\x02_\x03\ + \xd2\x86\x03\x12\x04\x91\x01)9\n\x0c\n\x04\x05\0\x02`\x12\x04\x92\x01\ + \x049\n\r\n\x05\x05\0\x02`\x01\x12\x04\x92\x01\x04\x1e\n\r\n\x05\x05\0\ + \x02`\x02\x12\x04\x92\x01!$\n\r\n\x05\x05\0\x02`\x03\x12\x04\x92\x01%8\n\ + \x10\n\x08\x05\0\x02`\x03\xd3\x86\x03\x12\x04\x92\x01&7\n\x0c\n\x04\x05\ + \0\x02a\x12\x04\x93\x01\x04@\n\r\n\x05\x05\0\x02a\x01\x12\x04\x93\x01\ + \x04&\n\r\n\x05\x05\0\x02a\x02\x12\x04\x93\x01),\n\r\n\x05\x05\0\x02a\ + \x03\x12\x04\x93\x01-?\n\x10\n\x08\x05\0\x02a\x03\xd2\x86\x03\x12\x04\ + \x93\x01.>\n\x0c\n\x04\x05\0\x02b\x12\x04\x94\x01\x04:\n\r\n\x05\x05\0\ + \x02b\x01\x12\x04\x94\x01\x04\x20\n\r\n\x05\x05\0\x02b\x02\x12\x04\x94\ + \x01#&\n\r\n\x05\x05\0\x02b\x03\x12\x04\x94\x01'9\n\x10\n\x08\x05\0\x02b\ + \x03\xd2\x86\x03\x12\x04\x94\x01(8\n\x0c\n\x04\x05\0\x02c\x12\x04\x95\ + \x01\x04>\n\r\n\x05\x05\0\x02c\x01\x12\x04\x95\x01\x04$\n\r\n\x05\x05\0\ + \x02c\x02\x12\x04\x95\x01'*\n\r\n\x05\x05\0\x02c\x03\x12\x04\x95\x01+=\n\ + \x10\n\x08\x05\0\x02c\x03\xd2\x86\x03\x12\x04\x95\x01,<\n\x0c\n\x04\x05\ + \0\x02d\x12\x04\x96\x01\x04>\n\r\n\x05\x05\0\x02d\x01\x12\x04\x96\x01\ + \x04$\n\r\n\x05\x05\0\x02d\x02\x12\x04\x96\x01'*\n\r\n\x05\x05\0\x02d\ + \x03\x12\x04\x96\x01+=\n\x10\n\x08\x05\0\x02d\x03\xd2\x86\x03\x12\x04\ + \x96\x01,<\n\x0c\n\x04\x05\0\x02e\x12\x04\x97\x01\x04E\n\r\n\x05\x05\0\ + \x02e\x01\x12\x04\x97\x01\x04+\n\r\n\x05\x05\0\x02e\x02\x12\x04\x97\x01.\ + 1\n\r\n\x05\x05\0\x02e\x03\x12\x04\x97\x012D\n\x10\n\x08\x05\0\x02e\x03\ + \xd2\x86\x03\x12\x04\x97\x013C\n\x0c\n\x04\x05\0\x02f\x12\x04\x98\x01\ + \x04=\n\r\n\x05\x05\0\x02f\x01\x12\x04\x98\x01\x04#\n\r\n\x05\x05\0\x02f\ + \x02\x12\x04\x98\x01&)\n\r\n\x05\x05\0\x02f\x03\x12\x04\x98\x01*<\n\x10\ + \n\x08\x05\0\x02f\x03\xd2\x86\x03\x12\x04\x98\x01+;\n\x0c\n\x04\x05\0\ + \x02g\x12\x04\x99\x01\x04>\n\r\n\x05\x05\0\x02g\x01\x12\x04\x99\x01\x04$\ + \n\r\n\x05\x05\0\x02g\x02\x12\x04\x99\x01'*\n\r\n\x05\x05\0\x02g\x03\x12\ + \x04\x99\x01+=\n\x10\n\x08\x05\0\x02g\x03\xd2\x86\x03\x12\x04\x99\x01,<\ + \n\x0c\n\x04\x05\0\x02h\x12\x04\x9a\x01\x04=\n\r\n\x05\x05\0\x02h\x01\ + \x12\x04\x9a\x01\x04#\n\r\n\x05\x05\0\x02h\x02\x12\x04\x9a\x01&)\n\r\n\ + \x05\x05\0\x02h\x03\x12\x04\x9a\x01*<\n\x10\n\x08\x05\0\x02h\x03\xd2\x86\ + \x03\x12\x04\x9a\x01+;\n\x0c\n\x04\x05\0\x02i\x12\x04\x9b\x01\x04?\n\r\n\ + \x05\x05\0\x02i\x01\x12\x04\x9b\x01\x04%\n\r\n\x05\x05\0\x02i\x02\x12\ + \x04\x9b\x01(+\n\r\n\x05\x05\0\x02i\x03\x12\x04\x9b\x01,>\n\x10\n\x08\ + \x05\0\x02i\x03\xd2\x86\x03\x12\x04\x9b\x01-=\nV\n\x04\x05\0\x02j\x12\ + \x04\x9d\x01\x04=\x1aH\x20omitted:\x20StellarInflationOp\x20is\x20not\ + \x20a\x20supported\x20operation,\x20would\x20be\x20219\n\n\r\n\x05\x05\0\ + \x02j\x01\x12\x04\x9d\x01\x04#\n\r\n\x05\x05\0\x02j\x02\x12\x04\x9d\x01&\ + )\n\r\n\x05\x05\0\x02j\x03\x12\x04\x9d\x01*<\n\x10\n\x08\x05\0\x02j\x03\ + \xd2\x86\x03\x12\x04\x9d\x01+;\n\x0c\n\x04\x05\0\x02k\x12\x04\x9e\x01\ + \x04?\n\r\n\x05\x05\0\x02k\x01\x12\x04\x9e\x01\x04%\n\r\n\x05\x05\0\x02k\ + \x02\x12\x04\x9e\x01(+\n\r\n\x05\x05\0\x02k\x03\x12\x04\x9e\x01,>\n\x10\ + \n\x08\x05\0\x02k\x03\xd2\x86\x03\x12\x04\x9e\x01-=\n\x0c\n\x04\x05\0\ + \x02l\x12\x04\x9f\x01\x04:\n\r\n\x05\x05\0\x02l\x01\x12\x04\x9f\x01\x04\ + \x1f\n\r\n\x05\x05\0\x02l\x02\x12\x04\x9f\x01\"%\n\r\n\x05\x05\0\x02l\ + \x03\x12\x04\x9f\x01&9\n\x10\n\x08\x05\0\x02l\x03\xd3\x86\x03\x12\x04\ + \x9f\x01'8\n\x14\n\x04\x05\0\x02m\x12\x04\xa2\x01\x048\x1a\x06\x20TRON\n\ + \n\r\n\x05\x05\0\x02m\x01\x12\x04\xa2\x01\x04\x1e\n\r\n\x05\x05\0\x02m\ + \x02\x12\x04\xa2\x01!$\n\r\n\x05\x05\0\x02m\x03\x12\x04\xa2\x01%7\n\x10\ + \n\x08\x05\0\x02m\x03\xd2\x86\x03\x12\x04\xa2\x01&6\n\x0c\n\x04\x05\0\ + \x02n\x12\x04\xa3\x01\x046\n\r\n\x05\x05\0\x02n\x01\x12\x04\xa3\x01\x04\ + \x1b\n\r\n\x05\x05\0\x02n\x02\x12\x04\xa3\x01\x1e!\n\r\n\x05\x05\0\x02n\ + \x03\x12\x04\xa3\x01\"5\n\x10\n\x08\x05\0\x02n\x03\xd3\x86\x03\x12\x04\ + \xa3\x01#4\n\x0c\n\x04\x05\0\x02o\x12\x04\xa4\x01\x044\n\r\n\x05\x05\0\ + \x02o\x01\x12\x04\xa4\x01\x04\x1a\n\r\n\x05\x05\0\x02o\x02\x12\x04\xa4\ + \x01\x1d\x20\n\r\n\x05\x05\0\x02o\x03\x12\x04\xa4\x01!3\n\x10\n\x08\x05\ + \0\x02o\x03\xd2\x86\x03\x12\x04\xa4\x01\"2\n\x0c\n\x04\x05\0\x02p\x12\ + \x04\xa5\x01\x047\n\r\n\x05\x05\0\x02p\x01\x12\x04\xa5\x01\x04\x1c\n\r\n\ + \x05\x05\0\x02p\x02\x12\x04\xa5\x01\x1f\"\n\r\n\x05\x05\0\x02p\x03\x12\ + \x04\xa5\x01#6\n\x10\n\x08\x05\0\x02p\x03\xd3\x86\x03\x12\x04\xa5\x01$5\ + \n?\n\x04\x05\0\x02q\x12\x04\xa9\x01\x047\x1a1\x20Cardano\n\x20dropped\ + \x20Sign/VerifyMessage\x20ids\x20300-302\n\n\r\n\x05\x05\0\x02q\x01\x12\ + \x04\xa9\x01\x04\x1d\n\r\n\x05\x05\0\x02q\x02\x12\x04\xa9\x01\x20#\n\r\n\ + \x05\x05\0\x02q\x03\x12\x04\xa9\x01$6\n\x10\n\x08\x05\0\x02q\x03\xd2\x86\ + \x03\x12\x04\xa9\x01%5\n\x0c\n\x04\x05\0\x02r\x12\x04\xaa\x01\x04;\n\r\n\ + \x05\x05\0\x02r\x01\x12\x04\xaa\x01\x04\x20\n\r\n\x05\x05\0\x02r\x02\x12\ + \x04\xaa\x01#&\n\r\n\x05\x05\0\x02r\x03\x12\x04\xaa\x01':\n\x10\n\x08\ + \x05\0\x02r\x03\xd3\x86\x03\x12\x04\xaa\x01(9\n\x0c\n\x04\x05\0\x02s\x12\ + \x04\xab\x01\x04=\n\r\n\x05\x05\0\x02s\x01\x12\x04\xab\x01\x04#\n\r\n\ + \x05\x05\0\x02s\x02\x12\x04\xab\x01&)\n\r\n\x05\x05\0\x02s\x03\x12\x04\ + \xab\x01*<\n\x10\n\x08\x05\0\x02s\x03\xd2\x86\x03\x12\x04\xab\x01+;\n\ + \x0c\n\x04\x05\0\x02t\x12\x04\xac\x01\x04;\n\r\n\x05\x05\0\x02t\x01\x12\ + \x04\xac\x01\x04\x20\n\r\n\x05\x05\0\x02t\x02\x12\x04\xac\x01#&\n\r\n\ + \x05\x05\0\x02t\x03\x12\x04\xac\x01':\n\x10\n\x08\x05\0\x02t\x03\xd3\x86\ + \x03\x12\x04\xac\x01(9\n\x0c\n\x04\x05\0\x02u\x12\x04\xad\x01\x04;\n\r\n\ + \x05\x05\0\x02u\x01\x12\x04\xad\x01\x04!\n\r\n\x05\x05\0\x02u\x02\x12\ + \x04\xad\x01$'\n\r\n\x05\x05\0\x02u\x03\x12\x04\xad\x01(:\n\x10\n\x08\ + \x05\0\x02u\x03\xd2\x86\x03\x12\x04\xad\x01)9\n\x0c\n\x04\x05\0\x02v\x12\ + \x04\xae\x01\x049\n\r\n\x05\x05\0\x02v\x01\x12\x04\xae\x01\x04\x1e\n\r\n\ + \x05\x05\0\x02v\x02\x12\x04\xae\x01!$\n\r\n\x05\x05\0\x02v\x03\x12\x04\ + \xae\x01%8\n\x10\n\x08\x05\0\x02v\x03\xd3\x86\x03\x12\x04\xae\x01&7\n\ + \x0c\n\x04\x05\0\x02w\x12\x04\xaf\x01\x046\n\r\n\x05\x05\0\x02w\x01\x12\ + \x04\xaf\x01\x04\x1c\n\r\n\x05\x05\0\x02w\x02\x12\x04\xaf\x01\x1f\"\n\r\ + \n\x05\x05\0\x02w\x03\x12\x04\xaf\x01#5\n\x10\n\x08\x05\0\x02w\x03\xd2\ + \x86\x03\x12\x04\xaf\x01$4\n\x0c\n\x04\x05\0\x02x\x12\x04\xb0\x01\x04:\n\ + \r\n\x05\x05\0\x02x\x01\x12\x04\xb0\x01\x04\x1f\n\r\n\x05\x05\0\x02x\x02\ + \x12\x04\xb0\x01\"%\n\r\n\x05\x05\0\x02x\x03\x12\x04\xb0\x01&9\n\x10\n\ + \x08\x05\0\x02x\x03\xd3\x86\x03\x12\x04\xb0\x01'8\n\x18\n\x04\x05\0\x02y\ + \x12\x04\xb3\x01\x04<\x1a\n\x20Ontology\n\n\r\n\x05\x05\0\x02y\x01\x12\ + \x04\xb3\x01\x04\"\n\r\n\x05\x05\0\x02y\x02\x12\x04\xb3\x01%(\n\r\n\x05\ + \x05\0\x02y\x03\x12\x04\xb3\x01);\n\x10\n\x08\x05\0\x02y\x03\xd2\x86\x03\ + \x12\x04\xb3\x01*:\n\x0c\n\x04\x05\0\x02z\x12\x04\xb4\x01\x04:\n\r\n\x05\ + \x05\0\x02z\x01\x12\x04\xb4\x01\x04\x1f\n\r\n\x05\x05\0\x02z\x02\x12\x04\ + \xb4\x01\"%\n\r\n\x05\x05\0\x02z\x03\x12\x04\xb4\x01&9\n\x10\n\x08\x05\0\ + \x02z\x03\xd3\x86\x03\x12\x04\xb4\x01'8\n\x0c\n\x04\x05\0\x02{\x12\x04\ + \xb5\x01\x04>\n\r\n\x05\x05\0\x02{\x01\x12\x04\xb5\x01\x04$\n\r\n\x05\ + \x05\0\x02{\x02\x12\x04\xb5\x01'*\n\r\n\x05\x05\0\x02{\x03\x12\x04\xb5\ + \x01+=\n\x10\n\x08\x05\0\x02{\x03\xd2\x86\x03\x12\x04\xb5\x01,<\n\x0c\n\ + \x04\x05\0\x02|\x12\x04\xb6\x01\x04<\n\r\n\x05\x05\0\x02|\x01\x12\x04\ + \xb6\x01\x04!\n\r\n\x05\x05\0\x02|\x02\x12\x04\xb6\x01$'\n\r\n\x05\x05\0\ + \x02|\x03\x12\x04\xb6\x01(;\n\x10\n\x08\x05\0\x02|\x03\xd3\x86\x03\x12\ + \x04\xb6\x01):\n\x0c\n\x04\x05\0\x02}\x12\x04\xb7\x01\x04>\n\r\n\x05\x05\ + \0\x02}\x01\x12\x04\xb7\x01\x04$\n\r\n\x05\x05\0\x02}\x02\x12\x04\xb7\ + \x01'*\n\r\n\x05\x05\0\x02}\x03\x12\x04\xb7\x01+=\n\x10\n\x08\x05\0\x02}\ + \x03\xd2\x86\x03\x12\x04\xb7\x01,<\n\x0c\n\x04\x05\0\x02~\x12\x04\xb8\ + \x01\x04A\n\r\n\x05\x05\0\x02~\x01\x12\x04\xb8\x01\x04&\n\r\n\x05\x05\0\ + \x02~\x02\x12\x04\xb8\x01),\n\r\n\x05\x05\0\x02~\x03\x12\x04\xb8\x01-@\n\ + \x10\n\x08\x05\0\x02~\x03\xd3\x86\x03\x12\x04\xb8\x01.?\n\x0c\n\x04\x05\ + \0\x02\x7f\x12\x04\xb9\x01\x04A\n\r\n\x05\x05\0\x02\x7f\x01\x12\x04\xb9\ + \x01\x04'\n\r\n\x05\x05\0\x02\x7f\x02\x12\x04\xb9\x01*-\n\r\n\x05\x05\0\ + \x02\x7f\x03\x12\x04\xb9\x01.@\n\x10\n\x08\x05\0\x02\x7f\x03\xd2\x86\x03\ + \x12\x04\xb9\x01/?\n\r\n\x05\x05\0\x02\x80\x01\x12\x04\xba\x01\x04D\n\ + \x0e\n\x06\x05\0\x02\x80\x01\x01\x12\x04\xba\x01\x04)\n\x0e\n\x06\x05\0\ + \x02\x80\x01\x02\x12\x04\xba\x01,/\n\x0e\n\x06\x05\0\x02\x80\x01\x03\x12\ + \x04\xba\x010C\n\x11\n\t\x05\0\x02\x80\x01\x03\xd3\x86\x03\x12\x04\xba\ + \x011B\n\r\n\x05\x05\0\x02\x81\x01\x12\x04\xbb\x01\x04C\n\x0e\n\x06\x05\ + \0\x02\x81\x01\x01\x12\x04\xbb\x01\x04)\n\x0e\n\x06\x05\0\x02\x81\x01\ + \x02\x12\x04\xbb\x01,/\n\x0e\n\x06\x05\0\x02\x81\x01\x03\x12\x04\xbb\x01\ + 0B\n\x11\n\t\x05\0\x02\x81\x01\x03\xd2\x86\x03\x12\x04\xbb\x011A\n\r\n\ + \x05\x05\0\x02\x82\x01\x12\x04\xbc\x01\x04F\n\x0e\n\x06\x05\0\x02\x82\ + \x01\x01\x12\x04\xbc\x01\x04+\n\x0e\n\x06\x05\0\x02\x82\x01\x02\x12\x04\ + \xbc\x01.1\n\x0e\n\x06\x05\0\x02\x82\x01\x03\x12\x04\xbc\x012E\n\x11\n\t\ + \x05\0\x02\x82\x01\x03\xd3\x86\x03\x12\x04\xbc\x013D\n\r\n\x05\x05\0\x02\ + \x83\x01\x12\x04\xbd\x01\x04H\n\x0e\n\x06\x05\0\x02\x83\x01\x01\x12\x04\ + \xbd\x01\x04.\n\x0e\n\x06\x05\0\x02\x83\x01\x02\x12\x04\xbd\x0114\n\x0e\ + \n\x06\x05\0\x02\x83\x01\x03\x12\x04\xbd\x015G\n\x11\n\t\x05\0\x02\x83\ + \x01\x03\xd2\x86\x03\x12\x04\xbd\x016F\n\r\n\x05\x05\0\x02\x84\x01\x12\ + \x04\xbe\x01\x04K\n\x0e\n\x06\x05\0\x02\x84\x01\x01\x12\x04\xbe\x01\x040\ + \n\x0e\n\x06\x05\0\x02\x84\x01\x02\x12\x04\xbe\x0136\n\x0e\n\x06\x05\0\ + \x02\x84\x01\x03\x12\x04\xbe\x017J\n\x11\n\t\x05\0\x02\x84\x01\x03\xd3\ + \x86\x03\x12\x04\xbe\x018I\n\x17\n\x05\x05\0\x02\x85\x01\x12\x04\xc1\x01\ + \x04:\x1a\x08\x20Ripple\n\n\x0e\n\x06\x05\0\x02\x85\x01\x01\x12\x04\xc1\ + \x01\x04\x20\n\x0e\n\x06\x05\0\x02\x85\x01\x02\x12\x04\xc1\x01#&\n\x0e\n\ + \x06\x05\0\x02\x85\x01\x03\x12\x04\xc1\x01'9\n\x11\n\t\x05\0\x02\x85\x01\ + \x03\xd2\x86\x03\x12\x04\xc1\x01(8\n\r\n\x05\x05\0\x02\x86\x01\x12\x04\ + \xc2\x01\x048\n\x0e\n\x06\x05\0\x02\x86\x01\x01\x12\x04\xc2\x01\x04\x1d\ + \n\x0e\n\x06\x05\0\x02\x86\x01\x02\x12\x04\xc2\x01\x20#\n\x0e\n\x06\x05\ + \0\x02\x86\x01\x03\x12\x04\xc2\x01$7\n\x11\n\t\x05\0\x02\x86\x01\x03\xd3\ + \x86\x03\x12\x04\xc2\x01%6\n\r\n\x05\x05\0\x02\x87\x01\x12\x04\xc3\x01\ + \x046\n\x0e\n\x06\x05\0\x02\x87\x01\x01\x12\x04\xc3\x01\x04\x1c\n\x0e\n\ + \x06\x05\0\x02\x87\x01\x02\x12\x04\xc3\x01\x1f\"\n\x0e\n\x06\x05\0\x02\ + \x87\x01\x03\x12\x04\xc3\x01#5\n\x11\n\t\x05\0\x02\x87\x01\x03\xd2\x86\ + \x03\x12\x04\xc3\x01$4\n\r\n\x05\x05\0\x02\x88\x01\x12\x04\xc4\x01\x048\ + \n\x0e\n\x06\x05\0\x02\x88\x01\x01\x12\x04\xc4\x01\x04\x1e\n\x0e\n\x06\ + \x05\0\x02\x88\x01\x02\x12\x04\xc4\x01!$\n\x0e\n\x06\x05\0\x02\x88\x01\ + \x03\x12\x04\xc4\x01%7\n\x11\n\t\x05\0\x02\x88\x01\x03\xd2\x86\x03\x12\ + \x04\xc4\x01&6\n\x17\n\x05\x05\0\x02\x89\x01\x12\x04\xc7\x01\x04G\x1a\ + \x08\x20Monero\n\n\x0e\n\x06\x05\0\x02\x89\x01\x01\x12\x04\xc7\x01\x04,\ + \n\x0e\n\x06\x05\0\x02\x89\x01\x02\x12\x04\xc7\x01/2\n\x0e\n\x06\x05\0\ + \x02\x89\x01\x03\x12\x04\xc7\x013F\n\x11\n\t\x05\0\x02\x89\x01\x03\xd3\ + \x86\x03\x12\x04\xc7\x014E\n\r\n\x05\x05\0\x02\x8a\x01\x12\x04\xc8\x01\ + \x04C\n\x0e\n\x06\x05\0\x02\x8a\x01\x01\x12\x04\xc8\x01\x04(\n\x0e\n\x06\ + \x05\0\x02\x8a\x01\x02\x12\x04\xc8\x01+.\n\x0e\n\x06\x05\0\x02\x8a\x01\ + \x03\x12\x04\xc8\x01/B\n\x11\n\t\x05\0\x02\x8a\x01\x03\xd3\x86\x03\x12\ + \x04\xc8\x010A\n\r\n\x05\x05\0\x02\x8b\x01\x12\x04\xc9\x01\x04K\n\x0e\n\ + \x06\x05\0\x02\x8b\x01\x01\x12\x04\xc9\x01\x040\n\x0e\n\x06\x05\0\x02\ + \x8b\x01\x02\x12\x04\xc9\x0136\n\x0e\n\x06\x05\0\x02\x8b\x01\x03\x12\x04\ + \xc9\x017J\n\x11\n\t\x05\0\x02\x8b\x01\x03\xd3\x86\x03\x12\x04\xc9\x018I\ + \n\r\n\x05\x05\0\x02\x8c\x01\x12\x04\xca\x01\x04G\n\x0e\n\x06\x05\0\x02\ + \x8c\x01\x01\x12\x04\xca\x01\x04,\n\x0e\n\x06\x05\0\x02\x8c\x01\x02\x12\ + \x04\xca\x01/2\n\x0e\n\x06\x05\0\x02\x8c\x01\x03\x12\x04\xca\x013F\n\x11\ + \n\t\x05\0\x02\x8c\x01\x03\xd3\x86\x03\x12\x04\xca\x014E\n\r\n\x05\x05\0\ + \x02\x8d\x01\x12\x04\xcb\x01\x04T\n\x0e\n\x06\x05\0\x02\x8d\x01\x01\x12\ + \x04\xcb\x01\x049\n\x0e\n\x06\x05\0\x02\x8d\x01\x02\x12\x04\xcb\x01\ + \n\r\n\x05\x05\0\x02\xa8\x01\x12\x04\xe6\x01\x04=\n\x0e\n\x06\x05\0\x02\ + \xa8\x01\x01\x12\x04\xe6\x01\x04\"\n\x0e\n\x06\x05\0\x02\xa8\x01\x02\x12\ + \x04\xe6\x01%(\n\x0e\n\x06\x05\0\x02\xa8\x01\x03\x12\x04\xe6\x01)<\n\x11\ + \n\t\x05\0\x02\xa8\x01\x03\xd3\x86\x03\x12\x04\xe6\x01*;\ +"; + +static mut file_descriptor_proto_lazy: ::protobuf::lazy::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::descriptor::FileDescriptorProto, +}; + +fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto { + ::protobuf::parse_from_bytes(file_descriptor_proto_data).unwrap() +} + +pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { + unsafe { + file_descriptor_proto_lazy.get(|| { + parse_descriptor_proto() + }) + } +} diff --git a/src/protos/messages_bitcoin.rs b/src/protos/messages_bitcoin.rs new file mode 100644 index 0000000..ba277f2 --- /dev/null +++ b/src/protos/messages_bitcoin.rs @@ -0,0 +1,6678 @@ +// This file is generated by rust-protobuf 2.0.4. Do not edit +// @generated + +// https://github.com/Manishearth/rust-clippy/issues/702 +#![allow(unknown_lints)] +#![allow(clippy)] + +#![cfg_attr(rustfmt, rustfmt_skip)] + +#![allow(box_pointers)] +#![allow(dead_code)] +#![allow(missing_docs)] +#![allow(non_camel_case_types)] +#![allow(non_snake_case)] +#![allow(non_upper_case_globals)] +#![allow(trivial_casts)] +#![allow(unsafe_code)] +#![allow(unused_imports)] +#![allow(unused_results)] + +use protobuf::Message as Message_imported_for_functions; +use protobuf::ProtobufEnum as ProtobufEnum_imported_for_functions; + +#[derive(PartialEq,Clone,Default)] +pub struct MultisigRedeemScriptType { + // message fields + pubkeys: ::protobuf::RepeatedField, + signatures: ::protobuf::RepeatedField<::std::vec::Vec>, + m: ::std::option::Option, + // special fields + unknown_fields: ::protobuf::UnknownFields, + cached_size: ::protobuf::CachedSize, +} + +impl MultisigRedeemScriptType { + pub fn new() -> MultisigRedeemScriptType { + ::std::default::Default::default() + } + + // repeated .hw.trezor.messages.bitcoin.MultisigRedeemScriptType.HDNodePathType pubkeys = 1; + + pub fn clear_pubkeys(&mut self) { + self.pubkeys.clear(); + } + + // Param is passed by value, moved + pub fn set_pubkeys(&mut self, v: ::protobuf::RepeatedField) { + self.pubkeys = v; + } + + // Mutable pointer to the field. + pub fn mut_pubkeys(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.pubkeys + } + + // Take field + pub fn take_pubkeys(&mut self) -> ::protobuf::RepeatedField { + ::std::mem::replace(&mut self.pubkeys, ::protobuf::RepeatedField::new()) + } + + pub fn get_pubkeys(&self) -> &[MultisigRedeemScriptType_HDNodePathType] { + &self.pubkeys + } + + // repeated bytes signatures = 2; + + pub fn clear_signatures(&mut self) { + self.signatures.clear(); + } + + // Param is passed by value, moved + pub fn set_signatures(&mut self, v: ::protobuf::RepeatedField<::std::vec::Vec>) { + self.signatures = v; + } + + // Mutable pointer to the field. + pub fn mut_signatures(&mut self) -> &mut ::protobuf::RepeatedField<::std::vec::Vec> { + &mut self.signatures + } + + // Take field + pub fn take_signatures(&mut self) -> ::protobuf::RepeatedField<::std::vec::Vec> { + ::std::mem::replace(&mut self.signatures, ::protobuf::RepeatedField::new()) + } + + pub fn get_signatures(&self) -> &[::std::vec::Vec] { + &self.signatures + } + + // optional uint32 m = 3; + + pub fn clear_m(&mut self) { + self.m = ::std::option::Option::None; + } + + pub fn has_m(&self) -> bool { + self.m.is_some() + } + + // Param is passed by value, moved + pub fn set_m(&mut self, v: u32) { + self.m = ::std::option::Option::Some(v); + } + + pub fn get_m(&self) -> u32 { + self.m.unwrap_or(0) + } +} + +impl ::protobuf::Message for MultisigRedeemScriptType { + fn is_initialized(&self) -> bool { + for v in &self.pubkeys { + if !v.is_initialized() { + return false; + } + }; + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.pubkeys)?; + }, + 2 => { + ::protobuf::rt::read_repeated_bytes_into(wire_type, is, &mut self.signatures)?; + }, + 3 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_uint32()?; + self.m = ::std::option::Option::Some(tmp); + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + for value in &self.pubkeys { + let len = value.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + }; + for value in &self.signatures { + my_size += ::protobuf::rt::bytes_size(2, &value); + }; + if let Some(v) = self.m { + my_size += ::protobuf::rt::value_size(3, v, ::protobuf::wire_format::WireTypeVarint); + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + for v in &self.pubkeys { + os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + }; + for v in &self.signatures { + os.write_bytes(2, &v)?; + }; + if let Some(v) = self.m { + os.write_uint32(3, v)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &::std::any::Any { + self as &::std::any::Any + } + fn as_any_mut(&mut self) -> &mut ::std::any::Any { + self as &mut ::std::any::Any + } + fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> MultisigRedeemScriptType { + MultisigRedeemScriptType::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "pubkeys", + |m: &MultisigRedeemScriptType| { &m.pubkeys }, + |m: &mut MultisigRedeemScriptType| { &mut m.pubkeys }, + )); + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "signatures", + |m: &MultisigRedeemScriptType| { &m.signatures }, + |m: &mut MultisigRedeemScriptType| { &mut m.signatures }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( + "m", + |m: &MultisigRedeemScriptType| { &m.m }, + |m: &mut MultisigRedeemScriptType| { &mut m.m }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "MultisigRedeemScriptType", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static MultisigRedeemScriptType { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const MultisigRedeemScriptType, + }; + unsafe { + instance.get(MultisigRedeemScriptType::new) + } + } +} + +impl ::protobuf::Clear for MultisigRedeemScriptType { + fn clear(&mut self) { + self.clear_pubkeys(); + self.clear_signatures(); + self.clear_m(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for MultisigRedeemScriptType { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for MultisigRedeemScriptType { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct MultisigRedeemScriptType_HDNodePathType { + // message fields + node: ::protobuf::SingularPtrField, + address_n: ::std::vec::Vec, + // special fields + unknown_fields: ::protobuf::UnknownFields, + cached_size: ::protobuf::CachedSize, +} + +impl MultisigRedeemScriptType_HDNodePathType { + pub fn new() -> MultisigRedeemScriptType_HDNodePathType { + ::std::default::Default::default() + } + + // required .hw.trezor.messages.common.HDNodeType node = 1; + + pub fn clear_node(&mut self) { + self.node.clear(); + } + + pub fn has_node(&self) -> bool { + self.node.is_some() + } + + // Param is passed by value, moved + pub fn set_node(&mut self, v: super::messages_common::HDNodeType) { + self.node = ::protobuf::SingularPtrField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_node(&mut self) -> &mut super::messages_common::HDNodeType { + if self.node.is_none() { + self.node.set_default(); + } + self.node.as_mut().unwrap() + } + + // Take field + pub fn take_node(&mut self) -> super::messages_common::HDNodeType { + self.node.take().unwrap_or_else(|| super::messages_common::HDNodeType::new()) + } + + pub fn get_node(&self) -> &super::messages_common::HDNodeType { + self.node.as_ref().unwrap_or_else(|| super::messages_common::HDNodeType::default_instance()) + } + + // repeated uint32 address_n = 2; + + pub fn clear_address_n(&mut self) { + self.address_n.clear(); + } + + // Param is passed by value, moved + pub fn set_address_n(&mut self, v: ::std::vec::Vec) { + self.address_n = v; + } + + // Mutable pointer to the field. + pub fn mut_address_n(&mut self) -> &mut ::std::vec::Vec { + &mut self.address_n + } + + // Take field + pub fn take_address_n(&mut self) -> ::std::vec::Vec { + ::std::mem::replace(&mut self.address_n, ::std::vec::Vec::new()) + } + + pub fn get_address_n(&self) -> &[u32] { + &self.address_n + } +} + +impl ::protobuf::Message for MultisigRedeemScriptType_HDNodePathType { + fn is_initialized(&self) -> bool { + if self.node.is_none() { + return false; + } + for v in &self.node { + if !v.is_initialized() { + return false; + } + }; + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.node)?; + }, + 2 => { + ::protobuf::rt::read_repeated_uint32_into(wire_type, is, &mut self.address_n)?; + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if let Some(ref v) = self.node.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + } + for value in &self.address_n { + my_size += ::protobuf::rt::value_size(2, *value, ::protobuf::wire_format::WireTypeVarint); + }; + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + if let Some(ref v) = self.node.as_ref() { + os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + } + for v in &self.address_n { + os.write_uint32(2, *v)?; + }; + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &::std::any::Any { + self as &::std::any::Any + } + fn as_any_mut(&mut self) -> &mut ::std::any::Any { + self as &mut ::std::any::Any + } + fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> MultisigRedeemScriptType_HDNodePathType { + MultisigRedeemScriptType_HDNodePathType::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "node", + |m: &MultisigRedeemScriptType_HDNodePathType| { &m.node }, + |m: &mut MultisigRedeemScriptType_HDNodePathType| { &mut m.node }, + )); + fields.push(::protobuf::reflect::accessor::make_vec_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( + "address_n", + |m: &MultisigRedeemScriptType_HDNodePathType| { &m.address_n }, + |m: &mut MultisigRedeemScriptType_HDNodePathType| { &mut m.address_n }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "MultisigRedeemScriptType_HDNodePathType", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static MultisigRedeemScriptType_HDNodePathType { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const MultisigRedeemScriptType_HDNodePathType, + }; + unsafe { + instance.get(MultisigRedeemScriptType_HDNodePathType::new) + } + } +} + +impl ::protobuf::Clear for MultisigRedeemScriptType_HDNodePathType { + fn clear(&mut self) { + self.clear_node(); + self.clear_address_n(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for MultisigRedeemScriptType_HDNodePathType { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for MultisigRedeemScriptType_HDNodePathType { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct GetPublicKey { + // message fields + address_n: ::std::vec::Vec, + ecdsa_curve_name: ::protobuf::SingularField<::std::string::String>, + show_display: ::std::option::Option, + coin_name: ::protobuf::SingularField<::std::string::String>, + script_type: ::std::option::Option, + // special fields + unknown_fields: ::protobuf::UnknownFields, + cached_size: ::protobuf::CachedSize, +} + +impl GetPublicKey { + pub fn new() -> GetPublicKey { + ::std::default::Default::default() + } + + // repeated uint32 address_n = 1; + + pub fn clear_address_n(&mut self) { + self.address_n.clear(); + } + + // Param is passed by value, moved + pub fn set_address_n(&mut self, v: ::std::vec::Vec) { + self.address_n = v; + } + + // Mutable pointer to the field. + pub fn mut_address_n(&mut self) -> &mut ::std::vec::Vec { + &mut self.address_n + } + + // Take field + pub fn take_address_n(&mut self) -> ::std::vec::Vec { + ::std::mem::replace(&mut self.address_n, ::std::vec::Vec::new()) + } + + pub fn get_address_n(&self) -> &[u32] { + &self.address_n + } + + // optional string ecdsa_curve_name = 2; + + pub fn clear_ecdsa_curve_name(&mut self) { + self.ecdsa_curve_name.clear(); + } + + pub fn has_ecdsa_curve_name(&self) -> bool { + self.ecdsa_curve_name.is_some() + } + + // Param is passed by value, moved + pub fn set_ecdsa_curve_name(&mut self, v: ::std::string::String) { + self.ecdsa_curve_name = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_ecdsa_curve_name(&mut self) -> &mut ::std::string::String { + if self.ecdsa_curve_name.is_none() { + self.ecdsa_curve_name.set_default(); + } + self.ecdsa_curve_name.as_mut().unwrap() + } + + // Take field + pub fn take_ecdsa_curve_name(&mut self) -> ::std::string::String { + self.ecdsa_curve_name.take().unwrap_or_else(|| ::std::string::String::new()) + } + + pub fn get_ecdsa_curve_name(&self) -> &str { + match self.ecdsa_curve_name.as_ref() { + Some(v) => &v, + None => "", + } + } + + // optional bool show_display = 3; + + pub fn clear_show_display(&mut self) { + self.show_display = ::std::option::Option::None; + } + + pub fn has_show_display(&self) -> bool { + self.show_display.is_some() + } + + // Param is passed by value, moved + pub fn set_show_display(&mut self, v: bool) { + self.show_display = ::std::option::Option::Some(v); + } + + pub fn get_show_display(&self) -> bool { + self.show_display.unwrap_or(false) + } + + // optional string coin_name = 4; + + pub fn clear_coin_name(&mut self) { + self.coin_name.clear(); + } + + pub fn has_coin_name(&self) -> bool { + self.coin_name.is_some() + } + + // Param is passed by value, moved + pub fn set_coin_name(&mut self, v: ::std::string::String) { + self.coin_name = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_coin_name(&mut self) -> &mut ::std::string::String { + if self.coin_name.is_none() { + self.coin_name.set_default(); + } + self.coin_name.as_mut().unwrap() + } + + // Take field + pub fn take_coin_name(&mut self) -> ::std::string::String { + self.coin_name.take().unwrap_or_else(|| ::std::string::String::new()) + } + + pub fn get_coin_name(&self) -> &str { + match self.coin_name.as_ref() { + Some(v) => &v, + None => "Bitcoin", + } + } + + // optional .hw.trezor.messages.bitcoin.InputScriptType script_type = 5; + + pub fn clear_script_type(&mut self) { + self.script_type = ::std::option::Option::None; + } + + pub fn has_script_type(&self) -> bool { + self.script_type.is_some() + } + + // Param is passed by value, moved + pub fn set_script_type(&mut self, v: InputScriptType) { + self.script_type = ::std::option::Option::Some(v); + } + + pub fn get_script_type(&self) -> InputScriptType { + self.script_type.unwrap_or(InputScriptType::SPENDADDRESS) + } +} + +impl ::protobuf::Message for GetPublicKey { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_repeated_uint32_into(wire_type, is, &mut self.address_n)?; + }, + 2 => { + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.ecdsa_curve_name)?; + }, + 3 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_bool()?; + self.show_display = ::std::option::Option::Some(tmp); + }, + 4 => { + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.coin_name)?; + }, + 5 => { + ::protobuf::rt::read_proto2_enum_with_unknown_fields_into(wire_type, is, &mut self.script_type, 5, &mut self.unknown_fields)? + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + for value in &self.address_n { + my_size += ::protobuf::rt::value_size(1, *value, ::protobuf::wire_format::WireTypeVarint); + }; + if let Some(ref v) = self.ecdsa_curve_name.as_ref() { + my_size += ::protobuf::rt::string_size(2, &v); + } + if let Some(v) = self.show_display { + my_size += 2; + } + if let Some(ref v) = self.coin_name.as_ref() { + my_size += ::protobuf::rt::string_size(4, &v); + } + if let Some(v) = self.script_type { + my_size += ::protobuf::rt::enum_size(5, v); + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + for v in &self.address_n { + os.write_uint32(1, *v)?; + }; + if let Some(ref v) = self.ecdsa_curve_name.as_ref() { + os.write_string(2, &v)?; + } + if let Some(v) = self.show_display { + os.write_bool(3, v)?; + } + if let Some(ref v) = self.coin_name.as_ref() { + os.write_string(4, &v)?; + } + if let Some(v) = self.script_type { + os.write_enum(5, v.value())?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &::std::any::Any { + self as &::std::any::Any + } + fn as_any_mut(&mut self) -> &mut ::std::any::Any { + self as &mut ::std::any::Any + } + fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> GetPublicKey { + GetPublicKey::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_vec_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( + "address_n", + |m: &GetPublicKey| { &m.address_n }, + |m: &mut GetPublicKey| { &mut m.address_n }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "ecdsa_curve_name", + |m: &GetPublicKey| { &m.ecdsa_curve_name }, + |m: &mut GetPublicKey| { &mut m.ecdsa_curve_name }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "show_display", + |m: &GetPublicKey| { &m.show_display }, + |m: &mut GetPublicKey| { &mut m.show_display }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "coin_name", + |m: &GetPublicKey| { &m.coin_name }, + |m: &mut GetPublicKey| { &mut m.coin_name }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( + "script_type", + |m: &GetPublicKey| { &m.script_type }, + |m: &mut GetPublicKey| { &mut m.script_type }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "GetPublicKey", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static GetPublicKey { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const GetPublicKey, + }; + unsafe { + instance.get(GetPublicKey::new) + } + } +} + +impl ::protobuf::Clear for GetPublicKey { + fn clear(&mut self) { + self.clear_address_n(); + self.clear_ecdsa_curve_name(); + self.clear_show_display(); + self.clear_coin_name(); + self.clear_script_type(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for GetPublicKey { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for GetPublicKey { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct PublicKey { + // message fields + node: ::protobuf::SingularPtrField, + xpub: ::protobuf::SingularField<::std::string::String>, + // special fields + unknown_fields: ::protobuf::UnknownFields, + cached_size: ::protobuf::CachedSize, +} + +impl PublicKey { + pub fn new() -> PublicKey { + ::std::default::Default::default() + } + + // required .hw.trezor.messages.common.HDNodeType node = 1; + + pub fn clear_node(&mut self) { + self.node.clear(); + } + + pub fn has_node(&self) -> bool { + self.node.is_some() + } + + // Param is passed by value, moved + pub fn set_node(&mut self, v: super::messages_common::HDNodeType) { + self.node = ::protobuf::SingularPtrField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_node(&mut self) -> &mut super::messages_common::HDNodeType { + if self.node.is_none() { + self.node.set_default(); + } + self.node.as_mut().unwrap() + } + + // Take field + pub fn take_node(&mut self) -> super::messages_common::HDNodeType { + self.node.take().unwrap_or_else(|| super::messages_common::HDNodeType::new()) + } + + pub fn get_node(&self) -> &super::messages_common::HDNodeType { + self.node.as_ref().unwrap_or_else(|| super::messages_common::HDNodeType::default_instance()) + } + + // optional string xpub = 2; + + pub fn clear_xpub(&mut self) { + self.xpub.clear(); + } + + pub fn has_xpub(&self) -> bool { + self.xpub.is_some() + } + + // Param is passed by value, moved + pub fn set_xpub(&mut self, v: ::std::string::String) { + self.xpub = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_xpub(&mut self) -> &mut ::std::string::String { + if self.xpub.is_none() { + self.xpub.set_default(); + } + self.xpub.as_mut().unwrap() + } + + // Take field + pub fn take_xpub(&mut self) -> ::std::string::String { + self.xpub.take().unwrap_or_else(|| ::std::string::String::new()) + } + + pub fn get_xpub(&self) -> &str { + match self.xpub.as_ref() { + Some(v) => &v, + None => "", + } + } +} + +impl ::protobuf::Message for PublicKey { + fn is_initialized(&self) -> bool { + if self.node.is_none() { + return false; + } + for v in &self.node { + if !v.is_initialized() { + return false; + } + }; + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.node)?; + }, + 2 => { + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.xpub)?; + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if let Some(ref v) = self.node.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + } + if let Some(ref v) = self.xpub.as_ref() { + my_size += ::protobuf::rt::string_size(2, &v); + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + if let Some(ref v) = self.node.as_ref() { + os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + } + if let Some(ref v) = self.xpub.as_ref() { + os.write_string(2, &v)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &::std::any::Any { + self as &::std::any::Any + } + fn as_any_mut(&mut self) -> &mut ::std::any::Any { + self as &mut ::std::any::Any + } + fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> PublicKey { + PublicKey::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "node", + |m: &PublicKey| { &m.node }, + |m: &mut PublicKey| { &mut m.node }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "xpub", + |m: &PublicKey| { &m.xpub }, + |m: &mut PublicKey| { &mut m.xpub }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "PublicKey", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static PublicKey { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const PublicKey, + }; + unsafe { + instance.get(PublicKey::new) + } + } +} + +impl ::protobuf::Clear for PublicKey { + fn clear(&mut self) { + self.clear_node(); + self.clear_xpub(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for PublicKey { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for PublicKey { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct GetAddress { + // message fields + address_n: ::std::vec::Vec, + coin_name: ::protobuf::SingularField<::std::string::String>, + show_display: ::std::option::Option, + multisig: ::protobuf::SingularPtrField, + script_type: ::std::option::Option, + // special fields + unknown_fields: ::protobuf::UnknownFields, + cached_size: ::protobuf::CachedSize, +} + +impl GetAddress { + pub fn new() -> GetAddress { + ::std::default::Default::default() + } + + // repeated uint32 address_n = 1; + + pub fn clear_address_n(&mut self) { + self.address_n.clear(); + } + + // Param is passed by value, moved + pub fn set_address_n(&mut self, v: ::std::vec::Vec) { + self.address_n = v; + } + + // Mutable pointer to the field. + pub fn mut_address_n(&mut self) -> &mut ::std::vec::Vec { + &mut self.address_n + } + + // Take field + pub fn take_address_n(&mut self) -> ::std::vec::Vec { + ::std::mem::replace(&mut self.address_n, ::std::vec::Vec::new()) + } + + pub fn get_address_n(&self) -> &[u32] { + &self.address_n + } + + // optional string coin_name = 2; + + pub fn clear_coin_name(&mut self) { + self.coin_name.clear(); + } + + pub fn has_coin_name(&self) -> bool { + self.coin_name.is_some() + } + + // Param is passed by value, moved + pub fn set_coin_name(&mut self, v: ::std::string::String) { + self.coin_name = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_coin_name(&mut self) -> &mut ::std::string::String { + if self.coin_name.is_none() { + self.coin_name.set_default(); + } + self.coin_name.as_mut().unwrap() + } + + // Take field + pub fn take_coin_name(&mut self) -> ::std::string::String { + self.coin_name.take().unwrap_or_else(|| ::std::string::String::new()) + } + + pub fn get_coin_name(&self) -> &str { + match self.coin_name.as_ref() { + Some(v) => &v, + None => "Bitcoin", + } + } + + // optional bool show_display = 3; + + pub fn clear_show_display(&mut self) { + self.show_display = ::std::option::Option::None; + } + + pub fn has_show_display(&self) -> bool { + self.show_display.is_some() + } + + // Param is passed by value, moved + pub fn set_show_display(&mut self, v: bool) { + self.show_display = ::std::option::Option::Some(v); + } + + pub fn get_show_display(&self) -> bool { + self.show_display.unwrap_or(false) + } + + // optional .hw.trezor.messages.bitcoin.MultisigRedeemScriptType multisig = 4; + + pub fn clear_multisig(&mut self) { + self.multisig.clear(); + } + + pub fn has_multisig(&self) -> bool { + self.multisig.is_some() + } + + // Param is passed by value, moved + pub fn set_multisig(&mut self, v: MultisigRedeemScriptType) { + self.multisig = ::protobuf::SingularPtrField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_multisig(&mut self) -> &mut MultisigRedeemScriptType { + if self.multisig.is_none() { + self.multisig.set_default(); + } + self.multisig.as_mut().unwrap() + } + + // Take field + pub fn take_multisig(&mut self) -> MultisigRedeemScriptType { + self.multisig.take().unwrap_or_else(|| MultisigRedeemScriptType::new()) + } + + pub fn get_multisig(&self) -> &MultisigRedeemScriptType { + self.multisig.as_ref().unwrap_or_else(|| MultisigRedeemScriptType::default_instance()) + } + + // optional .hw.trezor.messages.bitcoin.InputScriptType script_type = 5; + + pub fn clear_script_type(&mut self) { + self.script_type = ::std::option::Option::None; + } + + pub fn has_script_type(&self) -> bool { + self.script_type.is_some() + } + + // Param is passed by value, moved + pub fn set_script_type(&mut self, v: InputScriptType) { + self.script_type = ::std::option::Option::Some(v); + } + + pub fn get_script_type(&self) -> InputScriptType { + self.script_type.unwrap_or(InputScriptType::SPENDADDRESS) + } +} + +impl ::protobuf::Message for GetAddress { + fn is_initialized(&self) -> bool { + for v in &self.multisig { + if !v.is_initialized() { + return false; + } + }; + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_repeated_uint32_into(wire_type, is, &mut self.address_n)?; + }, + 2 => { + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.coin_name)?; + }, + 3 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_bool()?; + self.show_display = ::std::option::Option::Some(tmp); + }, + 4 => { + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.multisig)?; + }, + 5 => { + ::protobuf::rt::read_proto2_enum_with_unknown_fields_into(wire_type, is, &mut self.script_type, 5, &mut self.unknown_fields)? + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + for value in &self.address_n { + my_size += ::protobuf::rt::value_size(1, *value, ::protobuf::wire_format::WireTypeVarint); + }; + if let Some(ref v) = self.coin_name.as_ref() { + my_size += ::protobuf::rt::string_size(2, &v); + } + if let Some(v) = self.show_display { + my_size += 2; + } + if let Some(ref v) = self.multisig.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + } + if let Some(v) = self.script_type { + my_size += ::protobuf::rt::enum_size(5, v); + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + for v in &self.address_n { + os.write_uint32(1, *v)?; + }; + if let Some(ref v) = self.coin_name.as_ref() { + os.write_string(2, &v)?; + } + if let Some(v) = self.show_display { + os.write_bool(3, v)?; + } + if let Some(ref v) = self.multisig.as_ref() { + os.write_tag(4, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + } + if let Some(v) = self.script_type { + os.write_enum(5, v.value())?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &::std::any::Any { + self as &::std::any::Any + } + fn as_any_mut(&mut self) -> &mut ::std::any::Any { + self as &mut ::std::any::Any + } + fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> GetAddress { + GetAddress::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_vec_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( + "address_n", + |m: &GetAddress| { &m.address_n }, + |m: &mut GetAddress| { &mut m.address_n }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "coin_name", + |m: &GetAddress| { &m.coin_name }, + |m: &mut GetAddress| { &mut m.coin_name }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "show_display", + |m: &GetAddress| { &m.show_display }, + |m: &mut GetAddress| { &mut m.show_display }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "multisig", + |m: &GetAddress| { &m.multisig }, + |m: &mut GetAddress| { &mut m.multisig }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( + "script_type", + |m: &GetAddress| { &m.script_type }, + |m: &mut GetAddress| { &mut m.script_type }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "GetAddress", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static GetAddress { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const GetAddress, + }; + unsafe { + instance.get(GetAddress::new) + } + } +} + +impl ::protobuf::Clear for GetAddress { + fn clear(&mut self) { + self.clear_address_n(); + self.clear_coin_name(); + self.clear_show_display(); + self.clear_multisig(); + self.clear_script_type(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for GetAddress { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for GetAddress { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct Address { + // message fields + address: ::protobuf::SingularField<::std::string::String>, + // special fields + unknown_fields: ::protobuf::UnknownFields, + cached_size: ::protobuf::CachedSize, +} + +impl Address { + pub fn new() -> Address { + ::std::default::Default::default() + } + + // required string address = 1; + + pub fn clear_address(&mut self) { + self.address.clear(); + } + + pub fn has_address(&self) -> bool { + self.address.is_some() + } + + // Param is passed by value, moved + pub fn set_address(&mut self, v: ::std::string::String) { + self.address = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_address(&mut self) -> &mut ::std::string::String { + if self.address.is_none() { + self.address.set_default(); + } + self.address.as_mut().unwrap() + } + + // Take field + pub fn take_address(&mut self) -> ::std::string::String { + self.address.take().unwrap_or_else(|| ::std::string::String::new()) + } + + pub fn get_address(&self) -> &str { + match self.address.as_ref() { + Some(v) => &v, + None => "", + } + } +} + +impl ::protobuf::Message for Address { + fn is_initialized(&self) -> bool { + if self.address.is_none() { + return false; + } + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.address)?; + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if let Some(ref v) = self.address.as_ref() { + my_size += ::protobuf::rt::string_size(1, &v); + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + if let Some(ref v) = self.address.as_ref() { + os.write_string(1, &v)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &::std::any::Any { + self as &::std::any::Any + } + fn as_any_mut(&mut self) -> &mut ::std::any::Any { + self as &mut ::std::any::Any + } + fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> Address { + Address::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "address", + |m: &Address| { &m.address }, + |m: &mut Address| { &mut m.address }, + )); + ::protobuf::reflect::MessageDescriptor::new::
( + "Address", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static Address { + static mut instance: ::protobuf::lazy::Lazy
= ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const Address, + }; + unsafe { + instance.get(Address::new) + } + } +} + +impl ::protobuf::Clear for Address { + fn clear(&mut self) { + self.clear_address(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for Address { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for Address { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct SignMessage { + // message fields + address_n: ::std::vec::Vec, + message: ::protobuf::SingularField<::std::vec::Vec>, + coin_name: ::protobuf::SingularField<::std::string::String>, + script_type: ::std::option::Option, + // special fields + unknown_fields: ::protobuf::UnknownFields, + cached_size: ::protobuf::CachedSize, +} + +impl SignMessage { + pub fn new() -> SignMessage { + ::std::default::Default::default() + } + + // repeated uint32 address_n = 1; + + pub fn clear_address_n(&mut self) { + self.address_n.clear(); + } + + // Param is passed by value, moved + pub fn set_address_n(&mut self, v: ::std::vec::Vec) { + self.address_n = v; + } + + // Mutable pointer to the field. + pub fn mut_address_n(&mut self) -> &mut ::std::vec::Vec { + &mut self.address_n + } + + // Take field + pub fn take_address_n(&mut self) -> ::std::vec::Vec { + ::std::mem::replace(&mut self.address_n, ::std::vec::Vec::new()) + } + + pub fn get_address_n(&self) -> &[u32] { + &self.address_n + } + + // required bytes message = 2; + + pub fn clear_message(&mut self) { + self.message.clear(); + } + + pub fn has_message(&self) -> bool { + self.message.is_some() + } + + // Param is passed by value, moved + pub fn set_message(&mut self, v: ::std::vec::Vec) { + self.message = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_message(&mut self) -> &mut ::std::vec::Vec { + if self.message.is_none() { + self.message.set_default(); + } + self.message.as_mut().unwrap() + } + + // Take field + pub fn take_message(&mut self) -> ::std::vec::Vec { + self.message.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + pub fn get_message(&self) -> &[u8] { + match self.message.as_ref() { + Some(v) => &v, + None => &[], + } + } + + // optional string coin_name = 3; + + pub fn clear_coin_name(&mut self) { + self.coin_name.clear(); + } + + pub fn has_coin_name(&self) -> bool { + self.coin_name.is_some() + } + + // Param is passed by value, moved + pub fn set_coin_name(&mut self, v: ::std::string::String) { + self.coin_name = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_coin_name(&mut self) -> &mut ::std::string::String { + if self.coin_name.is_none() { + self.coin_name.set_default(); + } + self.coin_name.as_mut().unwrap() + } + + // Take field + pub fn take_coin_name(&mut self) -> ::std::string::String { + self.coin_name.take().unwrap_or_else(|| ::std::string::String::new()) + } + + pub fn get_coin_name(&self) -> &str { + match self.coin_name.as_ref() { + Some(v) => &v, + None => "Bitcoin", + } + } + + // optional .hw.trezor.messages.bitcoin.InputScriptType script_type = 4; + + pub fn clear_script_type(&mut self) { + self.script_type = ::std::option::Option::None; + } + + pub fn has_script_type(&self) -> bool { + self.script_type.is_some() + } + + // Param is passed by value, moved + pub fn set_script_type(&mut self, v: InputScriptType) { + self.script_type = ::std::option::Option::Some(v); + } + + pub fn get_script_type(&self) -> InputScriptType { + self.script_type.unwrap_or(InputScriptType::SPENDADDRESS) + } +} + +impl ::protobuf::Message for SignMessage { + fn is_initialized(&self) -> bool { + if self.message.is_none() { + return false; + } + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_repeated_uint32_into(wire_type, is, &mut self.address_n)?; + }, + 2 => { + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.message)?; + }, + 3 => { + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.coin_name)?; + }, + 4 => { + ::protobuf::rt::read_proto2_enum_with_unknown_fields_into(wire_type, is, &mut self.script_type, 4, &mut self.unknown_fields)? + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + for value in &self.address_n { + my_size += ::protobuf::rt::value_size(1, *value, ::protobuf::wire_format::WireTypeVarint); + }; + if let Some(ref v) = self.message.as_ref() { + my_size += ::protobuf::rt::bytes_size(2, &v); + } + if let Some(ref v) = self.coin_name.as_ref() { + my_size += ::protobuf::rt::string_size(3, &v); + } + if let Some(v) = self.script_type { + my_size += ::protobuf::rt::enum_size(4, v); + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + for v in &self.address_n { + os.write_uint32(1, *v)?; + }; + if let Some(ref v) = self.message.as_ref() { + os.write_bytes(2, &v)?; + } + if let Some(ref v) = self.coin_name.as_ref() { + os.write_string(3, &v)?; + } + if let Some(v) = self.script_type { + os.write_enum(4, v.value())?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &::std::any::Any { + self as &::std::any::Any + } + fn as_any_mut(&mut self) -> &mut ::std::any::Any { + self as &mut ::std::any::Any + } + fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> SignMessage { + SignMessage::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_vec_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( + "address_n", + |m: &SignMessage| { &m.address_n }, + |m: &mut SignMessage| { &mut m.address_n }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "message", + |m: &SignMessage| { &m.message }, + |m: &mut SignMessage| { &mut m.message }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "coin_name", + |m: &SignMessage| { &m.coin_name }, + |m: &mut SignMessage| { &mut m.coin_name }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( + "script_type", + |m: &SignMessage| { &m.script_type }, + |m: &mut SignMessage| { &mut m.script_type }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "SignMessage", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static SignMessage { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const SignMessage, + }; + unsafe { + instance.get(SignMessage::new) + } + } +} + +impl ::protobuf::Clear for SignMessage { + fn clear(&mut self) { + self.clear_address_n(); + self.clear_message(); + self.clear_coin_name(); + self.clear_script_type(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for SignMessage { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for SignMessage { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct MessageSignature { + // message fields + address: ::protobuf::SingularField<::std::string::String>, + signature: ::protobuf::SingularField<::std::vec::Vec>, + // special fields + unknown_fields: ::protobuf::UnknownFields, + cached_size: ::protobuf::CachedSize, +} + +impl MessageSignature { + pub fn new() -> MessageSignature { + ::std::default::Default::default() + } + + // optional string address = 1; + + pub fn clear_address(&mut self) { + self.address.clear(); + } + + pub fn has_address(&self) -> bool { + self.address.is_some() + } + + // Param is passed by value, moved + pub fn set_address(&mut self, v: ::std::string::String) { + self.address = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_address(&mut self) -> &mut ::std::string::String { + if self.address.is_none() { + self.address.set_default(); + } + self.address.as_mut().unwrap() + } + + // Take field + pub fn take_address(&mut self) -> ::std::string::String { + self.address.take().unwrap_or_else(|| ::std::string::String::new()) + } + + pub fn get_address(&self) -> &str { + match self.address.as_ref() { + Some(v) => &v, + None => "", + } + } + + // optional bytes signature = 2; + + pub fn clear_signature(&mut self) { + self.signature.clear(); + } + + pub fn has_signature(&self) -> bool { + self.signature.is_some() + } + + // Param is passed by value, moved + pub fn set_signature(&mut self, v: ::std::vec::Vec) { + self.signature = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_signature(&mut self) -> &mut ::std::vec::Vec { + if self.signature.is_none() { + self.signature.set_default(); + } + self.signature.as_mut().unwrap() + } + + // Take field + pub fn take_signature(&mut self) -> ::std::vec::Vec { + self.signature.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + pub fn get_signature(&self) -> &[u8] { + match self.signature.as_ref() { + Some(v) => &v, + None => &[], + } + } +} + +impl ::protobuf::Message for MessageSignature { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.address)?; + }, + 2 => { + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.signature)?; + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if let Some(ref v) = self.address.as_ref() { + my_size += ::protobuf::rt::string_size(1, &v); + } + if let Some(ref v) = self.signature.as_ref() { + my_size += ::protobuf::rt::bytes_size(2, &v); + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + if let Some(ref v) = self.address.as_ref() { + os.write_string(1, &v)?; + } + if let Some(ref v) = self.signature.as_ref() { + os.write_bytes(2, &v)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &::std::any::Any { + self as &::std::any::Any + } + fn as_any_mut(&mut self) -> &mut ::std::any::Any { + self as &mut ::std::any::Any + } + fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> MessageSignature { + MessageSignature::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "address", + |m: &MessageSignature| { &m.address }, + |m: &mut MessageSignature| { &mut m.address }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "signature", + |m: &MessageSignature| { &m.signature }, + |m: &mut MessageSignature| { &mut m.signature }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "MessageSignature", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static MessageSignature { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const MessageSignature, + }; + unsafe { + instance.get(MessageSignature::new) + } + } +} + +impl ::protobuf::Clear for MessageSignature { + fn clear(&mut self) { + self.clear_address(); + self.clear_signature(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for MessageSignature { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for MessageSignature { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct VerifyMessage { + // message fields + address: ::protobuf::SingularField<::std::string::String>, + signature: ::protobuf::SingularField<::std::vec::Vec>, + message: ::protobuf::SingularField<::std::vec::Vec>, + coin_name: ::protobuf::SingularField<::std::string::String>, + // special fields + unknown_fields: ::protobuf::UnknownFields, + cached_size: ::protobuf::CachedSize, +} + +impl VerifyMessage { + pub fn new() -> VerifyMessage { + ::std::default::Default::default() + } + + // optional string address = 1; + + pub fn clear_address(&mut self) { + self.address.clear(); + } + + pub fn has_address(&self) -> bool { + self.address.is_some() + } + + // Param is passed by value, moved + pub fn set_address(&mut self, v: ::std::string::String) { + self.address = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_address(&mut self) -> &mut ::std::string::String { + if self.address.is_none() { + self.address.set_default(); + } + self.address.as_mut().unwrap() + } + + // Take field + pub fn take_address(&mut self) -> ::std::string::String { + self.address.take().unwrap_or_else(|| ::std::string::String::new()) + } + + pub fn get_address(&self) -> &str { + match self.address.as_ref() { + Some(v) => &v, + None => "", + } + } + + // optional bytes signature = 2; + + pub fn clear_signature(&mut self) { + self.signature.clear(); + } + + pub fn has_signature(&self) -> bool { + self.signature.is_some() + } + + // Param is passed by value, moved + pub fn set_signature(&mut self, v: ::std::vec::Vec) { + self.signature = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_signature(&mut self) -> &mut ::std::vec::Vec { + if self.signature.is_none() { + self.signature.set_default(); + } + self.signature.as_mut().unwrap() + } + + // Take field + pub fn take_signature(&mut self) -> ::std::vec::Vec { + self.signature.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + pub fn get_signature(&self) -> &[u8] { + match self.signature.as_ref() { + Some(v) => &v, + None => &[], + } + } + + // optional bytes message = 3; + + pub fn clear_message(&mut self) { + self.message.clear(); + } + + pub fn has_message(&self) -> bool { + self.message.is_some() + } + + // Param is passed by value, moved + pub fn set_message(&mut self, v: ::std::vec::Vec) { + self.message = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_message(&mut self) -> &mut ::std::vec::Vec { + if self.message.is_none() { + self.message.set_default(); + } + self.message.as_mut().unwrap() + } + + // Take field + pub fn take_message(&mut self) -> ::std::vec::Vec { + self.message.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + pub fn get_message(&self) -> &[u8] { + match self.message.as_ref() { + Some(v) => &v, + None => &[], + } + } + + // optional string coin_name = 4; + + pub fn clear_coin_name(&mut self) { + self.coin_name.clear(); + } + + pub fn has_coin_name(&self) -> bool { + self.coin_name.is_some() + } + + // Param is passed by value, moved + pub fn set_coin_name(&mut self, v: ::std::string::String) { + self.coin_name = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_coin_name(&mut self) -> &mut ::std::string::String { + if self.coin_name.is_none() { + self.coin_name.set_default(); + } + self.coin_name.as_mut().unwrap() + } + + // Take field + pub fn take_coin_name(&mut self) -> ::std::string::String { + self.coin_name.take().unwrap_or_else(|| ::std::string::String::new()) + } + + pub fn get_coin_name(&self) -> &str { + match self.coin_name.as_ref() { + Some(v) => &v, + None => "Bitcoin", + } + } +} + +impl ::protobuf::Message for VerifyMessage { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.address)?; + }, + 2 => { + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.signature)?; + }, + 3 => { + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.message)?; + }, + 4 => { + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.coin_name)?; + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if let Some(ref v) = self.address.as_ref() { + my_size += ::protobuf::rt::string_size(1, &v); + } + if let Some(ref v) = self.signature.as_ref() { + my_size += ::protobuf::rt::bytes_size(2, &v); + } + if let Some(ref v) = self.message.as_ref() { + my_size += ::protobuf::rt::bytes_size(3, &v); + } + if let Some(ref v) = self.coin_name.as_ref() { + my_size += ::protobuf::rt::string_size(4, &v); + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + if let Some(ref v) = self.address.as_ref() { + os.write_string(1, &v)?; + } + if let Some(ref v) = self.signature.as_ref() { + os.write_bytes(2, &v)?; + } + if let Some(ref v) = self.message.as_ref() { + os.write_bytes(3, &v)?; + } + if let Some(ref v) = self.coin_name.as_ref() { + os.write_string(4, &v)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &::std::any::Any { + self as &::std::any::Any + } + fn as_any_mut(&mut self) -> &mut ::std::any::Any { + self as &mut ::std::any::Any + } + fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> VerifyMessage { + VerifyMessage::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "address", + |m: &VerifyMessage| { &m.address }, + |m: &mut VerifyMessage| { &mut m.address }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "signature", + |m: &VerifyMessage| { &m.signature }, + |m: &mut VerifyMessage| { &mut m.signature }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "message", + |m: &VerifyMessage| { &m.message }, + |m: &mut VerifyMessage| { &mut m.message }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "coin_name", + |m: &VerifyMessage| { &m.coin_name }, + |m: &mut VerifyMessage| { &mut m.coin_name }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "VerifyMessage", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static VerifyMessage { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const VerifyMessage, + }; + unsafe { + instance.get(VerifyMessage::new) + } + } +} + +impl ::protobuf::Clear for VerifyMessage { + fn clear(&mut self) { + self.clear_address(); + self.clear_signature(); + self.clear_message(); + self.clear_coin_name(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for VerifyMessage { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for VerifyMessage { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct SignTx { + // message fields + outputs_count: ::std::option::Option, + inputs_count: ::std::option::Option, + coin_name: ::protobuf::SingularField<::std::string::String>, + version: ::std::option::Option, + lock_time: ::std::option::Option, + expiry: ::std::option::Option, + overwintered: ::std::option::Option, + // special fields + unknown_fields: ::protobuf::UnknownFields, + cached_size: ::protobuf::CachedSize, +} + +impl SignTx { + pub fn new() -> SignTx { + ::std::default::Default::default() + } + + // required uint32 outputs_count = 1; + + pub fn clear_outputs_count(&mut self) { + self.outputs_count = ::std::option::Option::None; + } + + pub fn has_outputs_count(&self) -> bool { + self.outputs_count.is_some() + } + + // Param is passed by value, moved + pub fn set_outputs_count(&mut self, v: u32) { + self.outputs_count = ::std::option::Option::Some(v); + } + + pub fn get_outputs_count(&self) -> u32 { + self.outputs_count.unwrap_or(0) + } + + // required uint32 inputs_count = 2; + + pub fn clear_inputs_count(&mut self) { + self.inputs_count = ::std::option::Option::None; + } + + pub fn has_inputs_count(&self) -> bool { + self.inputs_count.is_some() + } + + // Param is passed by value, moved + pub fn set_inputs_count(&mut self, v: u32) { + self.inputs_count = ::std::option::Option::Some(v); + } + + pub fn get_inputs_count(&self) -> u32 { + self.inputs_count.unwrap_or(0) + } + + // optional string coin_name = 3; + + pub fn clear_coin_name(&mut self) { + self.coin_name.clear(); + } + + pub fn has_coin_name(&self) -> bool { + self.coin_name.is_some() + } + + // Param is passed by value, moved + pub fn set_coin_name(&mut self, v: ::std::string::String) { + self.coin_name = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_coin_name(&mut self) -> &mut ::std::string::String { + if self.coin_name.is_none() { + self.coin_name.set_default(); + } + self.coin_name.as_mut().unwrap() + } + + // Take field + pub fn take_coin_name(&mut self) -> ::std::string::String { + self.coin_name.take().unwrap_or_else(|| ::std::string::String::new()) + } + + pub fn get_coin_name(&self) -> &str { + match self.coin_name.as_ref() { + Some(v) => &v, + None => "Bitcoin", + } + } + + // optional uint32 version = 4; + + pub fn clear_version(&mut self) { + self.version = ::std::option::Option::None; + } + + pub fn has_version(&self) -> bool { + self.version.is_some() + } + + // Param is passed by value, moved + pub fn set_version(&mut self, v: u32) { + self.version = ::std::option::Option::Some(v); + } + + pub fn get_version(&self) -> u32 { + self.version.unwrap_or(1u32) + } + + // optional uint32 lock_time = 5; + + pub fn clear_lock_time(&mut self) { + self.lock_time = ::std::option::Option::None; + } + + pub fn has_lock_time(&self) -> bool { + self.lock_time.is_some() + } + + // Param is passed by value, moved + pub fn set_lock_time(&mut self, v: u32) { + self.lock_time = ::std::option::Option::Some(v); + } + + pub fn get_lock_time(&self) -> u32 { + self.lock_time.unwrap_or(0u32) + } + + // optional uint32 expiry = 6; + + pub fn clear_expiry(&mut self) { + self.expiry = ::std::option::Option::None; + } + + pub fn has_expiry(&self) -> bool { + self.expiry.is_some() + } + + // Param is passed by value, moved + pub fn set_expiry(&mut self, v: u32) { + self.expiry = ::std::option::Option::Some(v); + } + + pub fn get_expiry(&self) -> u32 { + self.expiry.unwrap_or(0) + } + + // optional bool overwintered = 7; + + pub fn clear_overwintered(&mut self) { + self.overwintered = ::std::option::Option::None; + } + + pub fn has_overwintered(&self) -> bool { + self.overwintered.is_some() + } + + // Param is passed by value, moved + pub fn set_overwintered(&mut self, v: bool) { + self.overwintered = ::std::option::Option::Some(v); + } + + pub fn get_overwintered(&self) -> bool { + self.overwintered.unwrap_or(false) + } +} + +impl ::protobuf::Message for SignTx { + fn is_initialized(&self) -> bool { + if self.outputs_count.is_none() { + return false; + } + if self.inputs_count.is_none() { + return false; + } + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_uint32()?; + self.outputs_count = ::std::option::Option::Some(tmp); + }, + 2 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_uint32()?; + self.inputs_count = ::std::option::Option::Some(tmp); + }, + 3 => { + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.coin_name)?; + }, + 4 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_uint32()?; + self.version = ::std::option::Option::Some(tmp); + }, + 5 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_uint32()?; + self.lock_time = ::std::option::Option::Some(tmp); + }, + 6 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_uint32()?; + self.expiry = ::std::option::Option::Some(tmp); + }, + 7 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_bool()?; + self.overwintered = ::std::option::Option::Some(tmp); + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if let Some(v) = self.outputs_count { + my_size += ::protobuf::rt::value_size(1, v, ::protobuf::wire_format::WireTypeVarint); + } + if let Some(v) = self.inputs_count { + my_size += ::protobuf::rt::value_size(2, v, ::protobuf::wire_format::WireTypeVarint); + } + if let Some(ref v) = self.coin_name.as_ref() { + my_size += ::protobuf::rt::string_size(3, &v); + } + if let Some(v) = self.version { + my_size += ::protobuf::rt::value_size(4, v, ::protobuf::wire_format::WireTypeVarint); + } + if let Some(v) = self.lock_time { + my_size += ::protobuf::rt::value_size(5, v, ::protobuf::wire_format::WireTypeVarint); + } + if let Some(v) = self.expiry { + my_size += ::protobuf::rt::value_size(6, v, ::protobuf::wire_format::WireTypeVarint); + } + if let Some(v) = self.overwintered { + my_size += 2; + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + if let Some(v) = self.outputs_count { + os.write_uint32(1, v)?; + } + if let Some(v) = self.inputs_count { + os.write_uint32(2, v)?; + } + if let Some(ref v) = self.coin_name.as_ref() { + os.write_string(3, &v)?; + } + if let Some(v) = self.version { + os.write_uint32(4, v)?; + } + if let Some(v) = self.lock_time { + os.write_uint32(5, v)?; + } + if let Some(v) = self.expiry { + os.write_uint32(6, v)?; + } + if let Some(v) = self.overwintered { + os.write_bool(7, v)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &::std::any::Any { + self as &::std::any::Any + } + fn as_any_mut(&mut self) -> &mut ::std::any::Any { + self as &mut ::std::any::Any + } + fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> SignTx { + SignTx::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( + "outputs_count", + |m: &SignTx| { &m.outputs_count }, + |m: &mut SignTx| { &mut m.outputs_count }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( + "inputs_count", + |m: &SignTx| { &m.inputs_count }, + |m: &mut SignTx| { &mut m.inputs_count }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "coin_name", + |m: &SignTx| { &m.coin_name }, + |m: &mut SignTx| { &mut m.coin_name }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( + "version", + |m: &SignTx| { &m.version }, + |m: &mut SignTx| { &mut m.version }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( + "lock_time", + |m: &SignTx| { &m.lock_time }, + |m: &mut SignTx| { &mut m.lock_time }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( + "expiry", + |m: &SignTx| { &m.expiry }, + |m: &mut SignTx| { &mut m.expiry }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "overwintered", + |m: &SignTx| { &m.overwintered }, + |m: &mut SignTx| { &mut m.overwintered }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "SignTx", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static SignTx { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const SignTx, + }; + unsafe { + instance.get(SignTx::new) + } + } +} + +impl ::protobuf::Clear for SignTx { + fn clear(&mut self) { + self.clear_outputs_count(); + self.clear_inputs_count(); + self.clear_coin_name(); + self.clear_version(); + self.clear_lock_time(); + self.clear_expiry(); + self.clear_overwintered(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for SignTx { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for SignTx { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct TxRequest { + // message fields + request_type: ::std::option::Option, + details: ::protobuf::SingularPtrField, + serialized: ::protobuf::SingularPtrField, + // special fields + unknown_fields: ::protobuf::UnknownFields, + cached_size: ::protobuf::CachedSize, +} + +impl TxRequest { + pub fn new() -> TxRequest { + ::std::default::Default::default() + } + + // optional .hw.trezor.messages.bitcoin.TxRequest.RequestType request_type = 1; + + pub fn clear_request_type(&mut self) { + self.request_type = ::std::option::Option::None; + } + + pub fn has_request_type(&self) -> bool { + self.request_type.is_some() + } + + // Param is passed by value, moved + pub fn set_request_type(&mut self, v: TxRequest_RequestType) { + self.request_type = ::std::option::Option::Some(v); + } + + pub fn get_request_type(&self) -> TxRequest_RequestType { + self.request_type.unwrap_or(TxRequest_RequestType::TXINPUT) + } + + // optional .hw.trezor.messages.bitcoin.TxRequest.TxRequestDetailsType details = 2; + + pub fn clear_details(&mut self) { + self.details.clear(); + } + + pub fn has_details(&self) -> bool { + self.details.is_some() + } + + // Param is passed by value, moved + pub fn set_details(&mut self, v: TxRequest_TxRequestDetailsType) { + self.details = ::protobuf::SingularPtrField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_details(&mut self) -> &mut TxRequest_TxRequestDetailsType { + if self.details.is_none() { + self.details.set_default(); + } + self.details.as_mut().unwrap() + } + + // Take field + pub fn take_details(&mut self) -> TxRequest_TxRequestDetailsType { + self.details.take().unwrap_or_else(|| TxRequest_TxRequestDetailsType::new()) + } + + pub fn get_details(&self) -> &TxRequest_TxRequestDetailsType { + self.details.as_ref().unwrap_or_else(|| TxRequest_TxRequestDetailsType::default_instance()) + } + + // optional .hw.trezor.messages.bitcoin.TxRequest.TxRequestSerializedType serialized = 3; + + pub fn clear_serialized(&mut self) { + self.serialized.clear(); + } + + pub fn has_serialized(&self) -> bool { + self.serialized.is_some() + } + + // Param is passed by value, moved + pub fn set_serialized(&mut self, v: TxRequest_TxRequestSerializedType) { + self.serialized = ::protobuf::SingularPtrField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_serialized(&mut self) -> &mut TxRequest_TxRequestSerializedType { + if self.serialized.is_none() { + self.serialized.set_default(); + } + self.serialized.as_mut().unwrap() + } + + // Take field + pub fn take_serialized(&mut self) -> TxRequest_TxRequestSerializedType { + self.serialized.take().unwrap_or_else(|| TxRequest_TxRequestSerializedType::new()) + } + + pub fn get_serialized(&self) -> &TxRequest_TxRequestSerializedType { + self.serialized.as_ref().unwrap_or_else(|| TxRequest_TxRequestSerializedType::default_instance()) + } +} + +impl ::protobuf::Message for TxRequest { + fn is_initialized(&self) -> bool { + for v in &self.details { + if !v.is_initialized() { + return false; + } + }; + for v in &self.serialized { + if !v.is_initialized() { + return false; + } + }; + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_proto2_enum_with_unknown_fields_into(wire_type, is, &mut self.request_type, 1, &mut self.unknown_fields)? + }, + 2 => { + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.details)?; + }, + 3 => { + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.serialized)?; + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if let Some(v) = self.request_type { + my_size += ::protobuf::rt::enum_size(1, v); + } + if let Some(ref v) = self.details.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + } + if let Some(ref v) = self.serialized.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + if let Some(v) = self.request_type { + os.write_enum(1, v.value())?; + } + if let Some(ref v) = self.details.as_ref() { + os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + } + if let Some(ref v) = self.serialized.as_ref() { + os.write_tag(3, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &::std::any::Any { + self as &::std::any::Any + } + fn as_any_mut(&mut self) -> &mut ::std::any::Any { + self as &mut ::std::any::Any + } + fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> TxRequest { + TxRequest::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( + "request_type", + |m: &TxRequest| { &m.request_type }, + |m: &mut TxRequest| { &mut m.request_type }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "details", + |m: &TxRequest| { &m.details }, + |m: &mut TxRequest| { &mut m.details }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "serialized", + |m: &TxRequest| { &m.serialized }, + |m: &mut TxRequest| { &mut m.serialized }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "TxRequest", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static TxRequest { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const TxRequest, + }; + unsafe { + instance.get(TxRequest::new) + } + } +} + +impl ::protobuf::Clear for TxRequest { + fn clear(&mut self) { + self.clear_request_type(); + self.clear_details(); + self.clear_serialized(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for TxRequest { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for TxRequest { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct TxRequest_TxRequestDetailsType { + // message fields + request_index: ::std::option::Option, + tx_hash: ::protobuf::SingularField<::std::vec::Vec>, + extra_data_len: ::std::option::Option, + extra_data_offset: ::std::option::Option, + // special fields + unknown_fields: ::protobuf::UnknownFields, + cached_size: ::protobuf::CachedSize, +} + +impl TxRequest_TxRequestDetailsType { + pub fn new() -> TxRequest_TxRequestDetailsType { + ::std::default::Default::default() + } + + // optional uint32 request_index = 1; + + pub fn clear_request_index(&mut self) { + self.request_index = ::std::option::Option::None; + } + + pub fn has_request_index(&self) -> bool { + self.request_index.is_some() + } + + // Param is passed by value, moved + pub fn set_request_index(&mut self, v: u32) { + self.request_index = ::std::option::Option::Some(v); + } + + pub fn get_request_index(&self) -> u32 { + self.request_index.unwrap_or(0) + } + + // optional bytes tx_hash = 2; + + pub fn clear_tx_hash(&mut self) { + self.tx_hash.clear(); + } + + pub fn has_tx_hash(&self) -> bool { + self.tx_hash.is_some() + } + + // Param is passed by value, moved + pub fn set_tx_hash(&mut self, v: ::std::vec::Vec) { + self.tx_hash = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_tx_hash(&mut self) -> &mut ::std::vec::Vec { + if self.tx_hash.is_none() { + self.tx_hash.set_default(); + } + self.tx_hash.as_mut().unwrap() + } + + // Take field + pub fn take_tx_hash(&mut self) -> ::std::vec::Vec { + self.tx_hash.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + pub fn get_tx_hash(&self) -> &[u8] { + match self.tx_hash.as_ref() { + Some(v) => &v, + None => &[], + } + } + + // optional uint32 extra_data_len = 3; + + pub fn clear_extra_data_len(&mut self) { + self.extra_data_len = ::std::option::Option::None; + } + + pub fn has_extra_data_len(&self) -> bool { + self.extra_data_len.is_some() + } + + // Param is passed by value, moved + pub fn set_extra_data_len(&mut self, v: u32) { + self.extra_data_len = ::std::option::Option::Some(v); + } + + pub fn get_extra_data_len(&self) -> u32 { + self.extra_data_len.unwrap_or(0) + } + + // optional uint32 extra_data_offset = 4; + + pub fn clear_extra_data_offset(&mut self) { + self.extra_data_offset = ::std::option::Option::None; + } + + pub fn has_extra_data_offset(&self) -> bool { + self.extra_data_offset.is_some() + } + + // Param is passed by value, moved + pub fn set_extra_data_offset(&mut self, v: u32) { + self.extra_data_offset = ::std::option::Option::Some(v); + } + + pub fn get_extra_data_offset(&self) -> u32 { + self.extra_data_offset.unwrap_or(0) + } +} + +impl ::protobuf::Message for TxRequest_TxRequestDetailsType { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_uint32()?; + self.request_index = ::std::option::Option::Some(tmp); + }, + 2 => { + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.tx_hash)?; + }, + 3 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_uint32()?; + self.extra_data_len = ::std::option::Option::Some(tmp); + }, + 4 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_uint32()?; + self.extra_data_offset = ::std::option::Option::Some(tmp); + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if let Some(v) = self.request_index { + my_size += ::protobuf::rt::value_size(1, v, ::protobuf::wire_format::WireTypeVarint); + } + if let Some(ref v) = self.tx_hash.as_ref() { + my_size += ::protobuf::rt::bytes_size(2, &v); + } + if let Some(v) = self.extra_data_len { + my_size += ::protobuf::rt::value_size(3, v, ::protobuf::wire_format::WireTypeVarint); + } + if let Some(v) = self.extra_data_offset { + my_size += ::protobuf::rt::value_size(4, v, ::protobuf::wire_format::WireTypeVarint); + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + if let Some(v) = self.request_index { + os.write_uint32(1, v)?; + } + if let Some(ref v) = self.tx_hash.as_ref() { + os.write_bytes(2, &v)?; + } + if let Some(v) = self.extra_data_len { + os.write_uint32(3, v)?; + } + if let Some(v) = self.extra_data_offset { + os.write_uint32(4, v)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &::std::any::Any { + self as &::std::any::Any + } + fn as_any_mut(&mut self) -> &mut ::std::any::Any { + self as &mut ::std::any::Any + } + fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> TxRequest_TxRequestDetailsType { + TxRequest_TxRequestDetailsType::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( + "request_index", + |m: &TxRequest_TxRequestDetailsType| { &m.request_index }, + |m: &mut TxRequest_TxRequestDetailsType| { &mut m.request_index }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "tx_hash", + |m: &TxRequest_TxRequestDetailsType| { &m.tx_hash }, + |m: &mut TxRequest_TxRequestDetailsType| { &mut m.tx_hash }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( + "extra_data_len", + |m: &TxRequest_TxRequestDetailsType| { &m.extra_data_len }, + |m: &mut TxRequest_TxRequestDetailsType| { &mut m.extra_data_len }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( + "extra_data_offset", + |m: &TxRequest_TxRequestDetailsType| { &m.extra_data_offset }, + |m: &mut TxRequest_TxRequestDetailsType| { &mut m.extra_data_offset }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "TxRequest_TxRequestDetailsType", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static TxRequest_TxRequestDetailsType { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const TxRequest_TxRequestDetailsType, + }; + unsafe { + instance.get(TxRequest_TxRequestDetailsType::new) + } + } +} + +impl ::protobuf::Clear for TxRequest_TxRequestDetailsType { + fn clear(&mut self) { + self.clear_request_index(); + self.clear_tx_hash(); + self.clear_extra_data_len(); + self.clear_extra_data_offset(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for TxRequest_TxRequestDetailsType { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for TxRequest_TxRequestDetailsType { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct TxRequest_TxRequestSerializedType { + // message fields + signature_index: ::std::option::Option, + signature: ::protobuf::SingularField<::std::vec::Vec>, + serialized_tx: ::protobuf::SingularField<::std::vec::Vec>, + // special fields + unknown_fields: ::protobuf::UnknownFields, + cached_size: ::protobuf::CachedSize, +} + +impl TxRequest_TxRequestSerializedType { + pub fn new() -> TxRequest_TxRequestSerializedType { + ::std::default::Default::default() + } + + // optional uint32 signature_index = 1; + + pub fn clear_signature_index(&mut self) { + self.signature_index = ::std::option::Option::None; + } + + pub fn has_signature_index(&self) -> bool { + self.signature_index.is_some() + } + + // Param is passed by value, moved + pub fn set_signature_index(&mut self, v: u32) { + self.signature_index = ::std::option::Option::Some(v); + } + + pub fn get_signature_index(&self) -> u32 { + self.signature_index.unwrap_or(0) + } + + // optional bytes signature = 2; + + pub fn clear_signature(&mut self) { + self.signature.clear(); + } + + pub fn has_signature(&self) -> bool { + self.signature.is_some() + } + + // Param is passed by value, moved + pub fn set_signature(&mut self, v: ::std::vec::Vec) { + self.signature = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_signature(&mut self) -> &mut ::std::vec::Vec { + if self.signature.is_none() { + self.signature.set_default(); + } + self.signature.as_mut().unwrap() + } + + // Take field + pub fn take_signature(&mut self) -> ::std::vec::Vec { + self.signature.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + pub fn get_signature(&self) -> &[u8] { + match self.signature.as_ref() { + Some(v) => &v, + None => &[], + } + } + + // optional bytes serialized_tx = 3; + + pub fn clear_serialized_tx(&mut self) { + self.serialized_tx.clear(); + } + + pub fn has_serialized_tx(&self) -> bool { + self.serialized_tx.is_some() + } + + // Param is passed by value, moved + pub fn set_serialized_tx(&mut self, v: ::std::vec::Vec) { + self.serialized_tx = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_serialized_tx(&mut self) -> &mut ::std::vec::Vec { + if self.serialized_tx.is_none() { + self.serialized_tx.set_default(); + } + self.serialized_tx.as_mut().unwrap() + } + + // Take field + pub fn take_serialized_tx(&mut self) -> ::std::vec::Vec { + self.serialized_tx.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + pub fn get_serialized_tx(&self) -> &[u8] { + match self.serialized_tx.as_ref() { + Some(v) => &v, + None => &[], + } + } +} + +impl ::protobuf::Message for TxRequest_TxRequestSerializedType { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_uint32()?; + self.signature_index = ::std::option::Option::Some(tmp); + }, + 2 => { + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.signature)?; + }, + 3 => { + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.serialized_tx)?; + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if let Some(v) = self.signature_index { + my_size += ::protobuf::rt::value_size(1, v, ::protobuf::wire_format::WireTypeVarint); + } + if let Some(ref v) = self.signature.as_ref() { + my_size += ::protobuf::rt::bytes_size(2, &v); + } + if let Some(ref v) = self.serialized_tx.as_ref() { + my_size += ::protobuf::rt::bytes_size(3, &v); + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + if let Some(v) = self.signature_index { + os.write_uint32(1, v)?; + } + if let Some(ref v) = self.signature.as_ref() { + os.write_bytes(2, &v)?; + } + if let Some(ref v) = self.serialized_tx.as_ref() { + os.write_bytes(3, &v)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &::std::any::Any { + self as &::std::any::Any + } + fn as_any_mut(&mut self) -> &mut ::std::any::Any { + self as &mut ::std::any::Any + } + fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> TxRequest_TxRequestSerializedType { + TxRequest_TxRequestSerializedType::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( + "signature_index", + |m: &TxRequest_TxRequestSerializedType| { &m.signature_index }, + |m: &mut TxRequest_TxRequestSerializedType| { &mut m.signature_index }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "signature", + |m: &TxRequest_TxRequestSerializedType| { &m.signature }, + |m: &mut TxRequest_TxRequestSerializedType| { &mut m.signature }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "serialized_tx", + |m: &TxRequest_TxRequestSerializedType| { &m.serialized_tx }, + |m: &mut TxRequest_TxRequestSerializedType| { &mut m.serialized_tx }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "TxRequest_TxRequestSerializedType", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static TxRequest_TxRequestSerializedType { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const TxRequest_TxRequestSerializedType, + }; + unsafe { + instance.get(TxRequest_TxRequestSerializedType::new) + } + } +} + +impl ::protobuf::Clear for TxRequest_TxRequestSerializedType { + fn clear(&mut self) { + self.clear_signature_index(); + self.clear_signature(); + self.clear_serialized_tx(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for TxRequest_TxRequestSerializedType { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for TxRequest_TxRequestSerializedType { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(Clone,PartialEq,Eq,Debug,Hash)] +pub enum TxRequest_RequestType { + TXINPUT = 0, + TXOUTPUT = 1, + TXMETA = 2, + TXFINISHED = 3, + TXEXTRADATA = 4, +} + +impl ::protobuf::ProtobufEnum for TxRequest_RequestType { + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 0 => ::std::option::Option::Some(TxRequest_RequestType::TXINPUT), + 1 => ::std::option::Option::Some(TxRequest_RequestType::TXOUTPUT), + 2 => ::std::option::Option::Some(TxRequest_RequestType::TXMETA), + 3 => ::std::option::Option::Some(TxRequest_RequestType::TXFINISHED), + 4 => ::std::option::Option::Some(TxRequest_RequestType::TXEXTRADATA), + _ => ::std::option::Option::None + } + } + + fn values() -> &'static [Self] { + static values: &'static [TxRequest_RequestType] = &[ + TxRequest_RequestType::TXINPUT, + TxRequest_RequestType::TXOUTPUT, + TxRequest_RequestType::TXMETA, + TxRequest_RequestType::TXFINISHED, + TxRequest_RequestType::TXEXTRADATA, + ]; + values + } + + fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::EnumDescriptor, + }; + unsafe { + descriptor.get(|| { + ::protobuf::reflect::EnumDescriptor::new("TxRequest_RequestType", file_descriptor_proto()) + }) + } + } +} + +impl ::std::marker::Copy for TxRequest_RequestType { +} + +impl ::protobuf::reflect::ProtobufValue for TxRequest_RequestType { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct TxAck { + // message fields + tx: ::protobuf::SingularPtrField, + // special fields + unknown_fields: ::protobuf::UnknownFields, + cached_size: ::protobuf::CachedSize, +} + +impl TxAck { + pub fn new() -> TxAck { + ::std::default::Default::default() + } + + // optional .hw.trezor.messages.bitcoin.TxAck.TransactionType tx = 1; + + pub fn clear_tx(&mut self) { + self.tx.clear(); + } + + pub fn has_tx(&self) -> bool { + self.tx.is_some() + } + + // Param is passed by value, moved + pub fn set_tx(&mut self, v: TxAck_TransactionType) { + self.tx = ::protobuf::SingularPtrField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_tx(&mut self) -> &mut TxAck_TransactionType { + if self.tx.is_none() { + self.tx.set_default(); + } + self.tx.as_mut().unwrap() + } + + // Take field + pub fn take_tx(&mut self) -> TxAck_TransactionType { + self.tx.take().unwrap_or_else(|| TxAck_TransactionType::new()) + } + + pub fn get_tx(&self) -> &TxAck_TransactionType { + self.tx.as_ref().unwrap_or_else(|| TxAck_TransactionType::default_instance()) + } +} + +impl ::protobuf::Message for TxAck { + fn is_initialized(&self) -> bool { + for v in &self.tx { + if !v.is_initialized() { + return false; + } + }; + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.tx)?; + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if let Some(ref v) = self.tx.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + if let Some(ref v) = self.tx.as_ref() { + os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &::std::any::Any { + self as &::std::any::Any + } + fn as_any_mut(&mut self) -> &mut ::std::any::Any { + self as &mut ::std::any::Any + } + fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> TxAck { + TxAck::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "tx", + |m: &TxAck| { &m.tx }, + |m: &mut TxAck| { &mut m.tx }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "TxAck", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static TxAck { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const TxAck, + }; + unsafe { + instance.get(TxAck::new) + } + } +} + +impl ::protobuf::Clear for TxAck { + fn clear(&mut self) { + self.clear_tx(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for TxAck { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for TxAck { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct TxAck_TransactionType { + // message fields + version: ::std::option::Option, + inputs: ::protobuf::RepeatedField, + bin_outputs: ::protobuf::RepeatedField, + lock_time: ::std::option::Option, + outputs: ::protobuf::RepeatedField, + inputs_cnt: ::std::option::Option, + outputs_cnt: ::std::option::Option, + extra_data: ::protobuf::SingularField<::std::vec::Vec>, + extra_data_len: ::std::option::Option, + expiry: ::std::option::Option, + overwintered: ::std::option::Option, + // special fields + unknown_fields: ::protobuf::UnknownFields, + cached_size: ::protobuf::CachedSize, +} + +impl TxAck_TransactionType { + pub fn new() -> TxAck_TransactionType { + ::std::default::Default::default() + } + + // optional uint32 version = 1; + + pub fn clear_version(&mut self) { + self.version = ::std::option::Option::None; + } + + pub fn has_version(&self) -> bool { + self.version.is_some() + } + + // Param is passed by value, moved + pub fn set_version(&mut self, v: u32) { + self.version = ::std::option::Option::Some(v); + } + + pub fn get_version(&self) -> u32 { + self.version.unwrap_or(0) + } + + // repeated .hw.trezor.messages.bitcoin.TxAck.TransactionType.TxInputType inputs = 2; + + pub fn clear_inputs(&mut self) { + self.inputs.clear(); + } + + // Param is passed by value, moved + pub fn set_inputs(&mut self, v: ::protobuf::RepeatedField) { + self.inputs = v; + } + + // Mutable pointer to the field. + pub fn mut_inputs(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.inputs + } + + // Take field + pub fn take_inputs(&mut self) -> ::protobuf::RepeatedField { + ::std::mem::replace(&mut self.inputs, ::protobuf::RepeatedField::new()) + } + + pub fn get_inputs(&self) -> &[TxAck_TransactionType_TxInputType] { + &self.inputs + } + + // repeated .hw.trezor.messages.bitcoin.TxAck.TransactionType.TxOutputBinType bin_outputs = 3; + + pub fn clear_bin_outputs(&mut self) { + self.bin_outputs.clear(); + } + + // Param is passed by value, moved + pub fn set_bin_outputs(&mut self, v: ::protobuf::RepeatedField) { + self.bin_outputs = v; + } + + // Mutable pointer to the field. + pub fn mut_bin_outputs(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.bin_outputs + } + + // Take field + pub fn take_bin_outputs(&mut self) -> ::protobuf::RepeatedField { + ::std::mem::replace(&mut self.bin_outputs, ::protobuf::RepeatedField::new()) + } + + pub fn get_bin_outputs(&self) -> &[TxAck_TransactionType_TxOutputBinType] { + &self.bin_outputs + } + + // optional uint32 lock_time = 4; + + pub fn clear_lock_time(&mut self) { + self.lock_time = ::std::option::Option::None; + } + + pub fn has_lock_time(&self) -> bool { + self.lock_time.is_some() + } + + // Param is passed by value, moved + pub fn set_lock_time(&mut self, v: u32) { + self.lock_time = ::std::option::Option::Some(v); + } + + pub fn get_lock_time(&self) -> u32 { + self.lock_time.unwrap_or(0) + } + + // repeated .hw.trezor.messages.bitcoin.TxAck.TransactionType.TxOutputType outputs = 5; + + pub fn clear_outputs(&mut self) { + self.outputs.clear(); + } + + // Param is passed by value, moved + pub fn set_outputs(&mut self, v: ::protobuf::RepeatedField) { + self.outputs = v; + } + + // Mutable pointer to the field. + pub fn mut_outputs(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.outputs + } + + // Take field + pub fn take_outputs(&mut self) -> ::protobuf::RepeatedField { + ::std::mem::replace(&mut self.outputs, ::protobuf::RepeatedField::new()) + } + + pub fn get_outputs(&self) -> &[TxAck_TransactionType_TxOutputType] { + &self.outputs + } + + // optional uint32 inputs_cnt = 6; + + pub fn clear_inputs_cnt(&mut self) { + self.inputs_cnt = ::std::option::Option::None; + } + + pub fn has_inputs_cnt(&self) -> bool { + self.inputs_cnt.is_some() + } + + // Param is passed by value, moved + pub fn set_inputs_cnt(&mut self, v: u32) { + self.inputs_cnt = ::std::option::Option::Some(v); + } + + pub fn get_inputs_cnt(&self) -> u32 { + self.inputs_cnt.unwrap_or(0) + } + + // optional uint32 outputs_cnt = 7; + + pub fn clear_outputs_cnt(&mut self) { + self.outputs_cnt = ::std::option::Option::None; + } + + pub fn has_outputs_cnt(&self) -> bool { + self.outputs_cnt.is_some() + } + + // Param is passed by value, moved + pub fn set_outputs_cnt(&mut self, v: u32) { + self.outputs_cnt = ::std::option::Option::Some(v); + } + + pub fn get_outputs_cnt(&self) -> u32 { + self.outputs_cnt.unwrap_or(0) + } + + // optional bytes extra_data = 8; + + pub fn clear_extra_data(&mut self) { + self.extra_data.clear(); + } + + pub fn has_extra_data(&self) -> bool { + self.extra_data.is_some() + } + + // Param is passed by value, moved + pub fn set_extra_data(&mut self, v: ::std::vec::Vec) { + self.extra_data = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_extra_data(&mut self) -> &mut ::std::vec::Vec { + if self.extra_data.is_none() { + self.extra_data.set_default(); + } + self.extra_data.as_mut().unwrap() + } + + // Take field + pub fn take_extra_data(&mut self) -> ::std::vec::Vec { + self.extra_data.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + pub fn get_extra_data(&self) -> &[u8] { + match self.extra_data.as_ref() { + Some(v) => &v, + None => &[], + } + } + + // optional uint32 extra_data_len = 9; + + pub fn clear_extra_data_len(&mut self) { + self.extra_data_len = ::std::option::Option::None; + } + + pub fn has_extra_data_len(&self) -> bool { + self.extra_data_len.is_some() + } + + // Param is passed by value, moved + pub fn set_extra_data_len(&mut self, v: u32) { + self.extra_data_len = ::std::option::Option::Some(v); + } + + pub fn get_extra_data_len(&self) -> u32 { + self.extra_data_len.unwrap_or(0) + } + + // optional uint32 expiry = 10; + + pub fn clear_expiry(&mut self) { + self.expiry = ::std::option::Option::None; + } + + pub fn has_expiry(&self) -> bool { + self.expiry.is_some() + } + + // Param is passed by value, moved + pub fn set_expiry(&mut self, v: u32) { + self.expiry = ::std::option::Option::Some(v); + } + + pub fn get_expiry(&self) -> u32 { + self.expiry.unwrap_or(0) + } + + // optional bool overwintered = 11; + + pub fn clear_overwintered(&mut self) { + self.overwintered = ::std::option::Option::None; + } + + pub fn has_overwintered(&self) -> bool { + self.overwintered.is_some() + } + + // Param is passed by value, moved + pub fn set_overwintered(&mut self, v: bool) { + self.overwintered = ::std::option::Option::Some(v); + } + + pub fn get_overwintered(&self) -> bool { + self.overwintered.unwrap_or(false) + } +} + +impl ::protobuf::Message for TxAck_TransactionType { + fn is_initialized(&self) -> bool { + for v in &self.inputs { + if !v.is_initialized() { + return false; + } + }; + for v in &self.bin_outputs { + if !v.is_initialized() { + return false; + } + }; + for v in &self.outputs { + if !v.is_initialized() { + return false; + } + }; + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_uint32()?; + self.version = ::std::option::Option::Some(tmp); + }, + 2 => { + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.inputs)?; + }, + 3 => { + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.bin_outputs)?; + }, + 4 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_uint32()?; + self.lock_time = ::std::option::Option::Some(tmp); + }, + 5 => { + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.outputs)?; + }, + 6 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_uint32()?; + self.inputs_cnt = ::std::option::Option::Some(tmp); + }, + 7 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_uint32()?; + self.outputs_cnt = ::std::option::Option::Some(tmp); + }, + 8 => { + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.extra_data)?; + }, + 9 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_uint32()?; + self.extra_data_len = ::std::option::Option::Some(tmp); + }, + 10 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_uint32()?; + self.expiry = ::std::option::Option::Some(tmp); + }, + 11 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_bool()?; + self.overwintered = ::std::option::Option::Some(tmp); + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if let Some(v) = self.version { + my_size += ::protobuf::rt::value_size(1, v, ::protobuf::wire_format::WireTypeVarint); + } + for value in &self.inputs { + let len = value.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + }; + for value in &self.bin_outputs { + let len = value.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + }; + if let Some(v) = self.lock_time { + my_size += ::protobuf::rt::value_size(4, v, ::protobuf::wire_format::WireTypeVarint); + } + for value in &self.outputs { + let len = value.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + }; + if let Some(v) = self.inputs_cnt { + my_size += ::protobuf::rt::value_size(6, v, ::protobuf::wire_format::WireTypeVarint); + } + if let Some(v) = self.outputs_cnt { + my_size += ::protobuf::rt::value_size(7, v, ::protobuf::wire_format::WireTypeVarint); + } + if let Some(ref v) = self.extra_data.as_ref() { + my_size += ::protobuf::rt::bytes_size(8, &v); + } + if let Some(v) = self.extra_data_len { + my_size += ::protobuf::rt::value_size(9, v, ::protobuf::wire_format::WireTypeVarint); + } + if let Some(v) = self.expiry { + my_size += ::protobuf::rt::value_size(10, v, ::protobuf::wire_format::WireTypeVarint); + } + if let Some(v) = self.overwintered { + my_size += 2; + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + if let Some(v) = self.version { + os.write_uint32(1, v)?; + } + for v in &self.inputs { + os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + }; + for v in &self.bin_outputs { + os.write_tag(3, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + }; + if let Some(v) = self.lock_time { + os.write_uint32(4, v)?; + } + for v in &self.outputs { + os.write_tag(5, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + }; + if let Some(v) = self.inputs_cnt { + os.write_uint32(6, v)?; + } + if let Some(v) = self.outputs_cnt { + os.write_uint32(7, v)?; + } + if let Some(ref v) = self.extra_data.as_ref() { + os.write_bytes(8, &v)?; + } + if let Some(v) = self.extra_data_len { + os.write_uint32(9, v)?; + } + if let Some(v) = self.expiry { + os.write_uint32(10, v)?; + } + if let Some(v) = self.overwintered { + os.write_bool(11, v)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &::std::any::Any { + self as &::std::any::Any + } + fn as_any_mut(&mut self) -> &mut ::std::any::Any { + self as &mut ::std::any::Any + } + fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> TxAck_TransactionType { + TxAck_TransactionType::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( + "version", + |m: &TxAck_TransactionType| { &m.version }, + |m: &mut TxAck_TransactionType| { &mut m.version }, + )); + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "inputs", + |m: &TxAck_TransactionType| { &m.inputs }, + |m: &mut TxAck_TransactionType| { &mut m.inputs }, + )); + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "bin_outputs", + |m: &TxAck_TransactionType| { &m.bin_outputs }, + |m: &mut TxAck_TransactionType| { &mut m.bin_outputs }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( + "lock_time", + |m: &TxAck_TransactionType| { &m.lock_time }, + |m: &mut TxAck_TransactionType| { &mut m.lock_time }, + )); + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "outputs", + |m: &TxAck_TransactionType| { &m.outputs }, + |m: &mut TxAck_TransactionType| { &mut m.outputs }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( + "inputs_cnt", + |m: &TxAck_TransactionType| { &m.inputs_cnt }, + |m: &mut TxAck_TransactionType| { &mut m.inputs_cnt }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( + "outputs_cnt", + |m: &TxAck_TransactionType| { &m.outputs_cnt }, + |m: &mut TxAck_TransactionType| { &mut m.outputs_cnt }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "extra_data", + |m: &TxAck_TransactionType| { &m.extra_data }, + |m: &mut TxAck_TransactionType| { &mut m.extra_data }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( + "extra_data_len", + |m: &TxAck_TransactionType| { &m.extra_data_len }, + |m: &mut TxAck_TransactionType| { &mut m.extra_data_len }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( + "expiry", + |m: &TxAck_TransactionType| { &m.expiry }, + |m: &mut TxAck_TransactionType| { &mut m.expiry }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "overwintered", + |m: &TxAck_TransactionType| { &m.overwintered }, + |m: &mut TxAck_TransactionType| { &mut m.overwintered }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "TxAck_TransactionType", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static TxAck_TransactionType { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const TxAck_TransactionType, + }; + unsafe { + instance.get(TxAck_TransactionType::new) + } + } +} + +impl ::protobuf::Clear for TxAck_TransactionType { + fn clear(&mut self) { + self.clear_version(); + self.clear_inputs(); + self.clear_bin_outputs(); + self.clear_lock_time(); + self.clear_outputs(); + self.clear_inputs_cnt(); + self.clear_outputs_cnt(); + self.clear_extra_data(); + self.clear_extra_data_len(); + self.clear_expiry(); + self.clear_overwintered(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for TxAck_TransactionType { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for TxAck_TransactionType { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct TxAck_TransactionType_TxInputType { + // message fields + address_n: ::std::vec::Vec, + prev_hash: ::protobuf::SingularField<::std::vec::Vec>, + prev_index: ::std::option::Option, + script_sig: ::protobuf::SingularField<::std::vec::Vec>, + sequence: ::std::option::Option, + script_type: ::std::option::Option, + multisig: ::protobuf::SingularPtrField, + amount: ::std::option::Option, + decred_tree: ::std::option::Option, + decred_script_version: ::std::option::Option, + prev_block_hash_bip115: ::protobuf::SingularField<::std::vec::Vec>, + prev_block_height_bip115: ::std::option::Option, + // special fields + unknown_fields: ::protobuf::UnknownFields, + cached_size: ::protobuf::CachedSize, +} + +impl TxAck_TransactionType_TxInputType { + pub fn new() -> TxAck_TransactionType_TxInputType { + ::std::default::Default::default() + } + + // repeated uint32 address_n = 1; + + pub fn clear_address_n(&mut self) { + self.address_n.clear(); + } + + // Param is passed by value, moved + pub fn set_address_n(&mut self, v: ::std::vec::Vec) { + self.address_n = v; + } + + // Mutable pointer to the field. + pub fn mut_address_n(&mut self) -> &mut ::std::vec::Vec { + &mut self.address_n + } + + // Take field + pub fn take_address_n(&mut self) -> ::std::vec::Vec { + ::std::mem::replace(&mut self.address_n, ::std::vec::Vec::new()) + } + + pub fn get_address_n(&self) -> &[u32] { + &self.address_n + } + + // required bytes prev_hash = 2; + + pub fn clear_prev_hash(&mut self) { + self.prev_hash.clear(); + } + + pub fn has_prev_hash(&self) -> bool { + self.prev_hash.is_some() + } + + // Param is passed by value, moved + pub fn set_prev_hash(&mut self, v: ::std::vec::Vec) { + self.prev_hash = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_prev_hash(&mut self) -> &mut ::std::vec::Vec { + if self.prev_hash.is_none() { + self.prev_hash.set_default(); + } + self.prev_hash.as_mut().unwrap() + } + + // Take field + pub fn take_prev_hash(&mut self) -> ::std::vec::Vec { + self.prev_hash.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + pub fn get_prev_hash(&self) -> &[u8] { + match self.prev_hash.as_ref() { + Some(v) => &v, + None => &[], + } + } + + // required uint32 prev_index = 3; + + pub fn clear_prev_index(&mut self) { + self.prev_index = ::std::option::Option::None; + } + + pub fn has_prev_index(&self) -> bool { + self.prev_index.is_some() + } + + // Param is passed by value, moved + pub fn set_prev_index(&mut self, v: u32) { + self.prev_index = ::std::option::Option::Some(v); + } + + pub fn get_prev_index(&self) -> u32 { + self.prev_index.unwrap_or(0) + } + + // optional bytes script_sig = 4; + + pub fn clear_script_sig(&mut self) { + self.script_sig.clear(); + } + + pub fn has_script_sig(&self) -> bool { + self.script_sig.is_some() + } + + // Param is passed by value, moved + pub fn set_script_sig(&mut self, v: ::std::vec::Vec) { + self.script_sig = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_script_sig(&mut self) -> &mut ::std::vec::Vec { + if self.script_sig.is_none() { + self.script_sig.set_default(); + } + self.script_sig.as_mut().unwrap() + } + + // Take field + pub fn take_script_sig(&mut self) -> ::std::vec::Vec { + self.script_sig.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + pub fn get_script_sig(&self) -> &[u8] { + match self.script_sig.as_ref() { + Some(v) => &v, + None => &[], + } + } + + // optional uint32 sequence = 5; + + pub fn clear_sequence(&mut self) { + self.sequence = ::std::option::Option::None; + } + + pub fn has_sequence(&self) -> bool { + self.sequence.is_some() + } + + // Param is passed by value, moved + pub fn set_sequence(&mut self, v: u32) { + self.sequence = ::std::option::Option::Some(v); + } + + pub fn get_sequence(&self) -> u32 { + self.sequence.unwrap_or(4294967295u32) + } + + // optional .hw.trezor.messages.bitcoin.InputScriptType script_type = 6; + + pub fn clear_script_type(&mut self) { + self.script_type = ::std::option::Option::None; + } + + pub fn has_script_type(&self) -> bool { + self.script_type.is_some() + } + + // Param is passed by value, moved + pub fn set_script_type(&mut self, v: InputScriptType) { + self.script_type = ::std::option::Option::Some(v); + } + + pub fn get_script_type(&self) -> InputScriptType { + self.script_type.unwrap_or(InputScriptType::SPENDADDRESS) + } + + // optional .hw.trezor.messages.bitcoin.MultisigRedeemScriptType multisig = 7; + + pub fn clear_multisig(&mut self) { + self.multisig.clear(); + } + + pub fn has_multisig(&self) -> bool { + self.multisig.is_some() + } + + // Param is passed by value, moved + pub fn set_multisig(&mut self, v: MultisigRedeemScriptType) { + self.multisig = ::protobuf::SingularPtrField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_multisig(&mut self) -> &mut MultisigRedeemScriptType { + if self.multisig.is_none() { + self.multisig.set_default(); + } + self.multisig.as_mut().unwrap() + } + + // Take field + pub fn take_multisig(&mut self) -> MultisigRedeemScriptType { + self.multisig.take().unwrap_or_else(|| MultisigRedeemScriptType::new()) + } + + pub fn get_multisig(&self) -> &MultisigRedeemScriptType { + self.multisig.as_ref().unwrap_or_else(|| MultisigRedeemScriptType::default_instance()) + } + + // optional uint64 amount = 8; + + pub fn clear_amount(&mut self) { + self.amount = ::std::option::Option::None; + } + + pub fn has_amount(&self) -> bool { + self.amount.is_some() + } + + // Param is passed by value, moved + pub fn set_amount(&mut self, v: u64) { + self.amount = ::std::option::Option::Some(v); + } + + pub fn get_amount(&self) -> u64 { + self.amount.unwrap_or(0) + } + + // optional uint32 decred_tree = 9; + + pub fn clear_decred_tree(&mut self) { + self.decred_tree = ::std::option::Option::None; + } + + pub fn has_decred_tree(&self) -> bool { + self.decred_tree.is_some() + } + + // Param is passed by value, moved + pub fn set_decred_tree(&mut self, v: u32) { + self.decred_tree = ::std::option::Option::Some(v); + } + + pub fn get_decred_tree(&self) -> u32 { + self.decred_tree.unwrap_or(0) + } + + // optional uint32 decred_script_version = 10; + + pub fn clear_decred_script_version(&mut self) { + self.decred_script_version = ::std::option::Option::None; + } + + pub fn has_decred_script_version(&self) -> bool { + self.decred_script_version.is_some() + } + + // Param is passed by value, moved + pub fn set_decred_script_version(&mut self, v: u32) { + self.decred_script_version = ::std::option::Option::Some(v); + } + + pub fn get_decred_script_version(&self) -> u32 { + self.decred_script_version.unwrap_or(0) + } + + // optional bytes prev_block_hash_bip115 = 11; + + pub fn clear_prev_block_hash_bip115(&mut self) { + self.prev_block_hash_bip115.clear(); + } + + pub fn has_prev_block_hash_bip115(&self) -> bool { + self.prev_block_hash_bip115.is_some() + } + + // Param is passed by value, moved + pub fn set_prev_block_hash_bip115(&mut self, v: ::std::vec::Vec) { + self.prev_block_hash_bip115 = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_prev_block_hash_bip115(&mut self) -> &mut ::std::vec::Vec { + if self.prev_block_hash_bip115.is_none() { + self.prev_block_hash_bip115.set_default(); + } + self.prev_block_hash_bip115.as_mut().unwrap() + } + + // Take field + pub fn take_prev_block_hash_bip115(&mut self) -> ::std::vec::Vec { + self.prev_block_hash_bip115.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + pub fn get_prev_block_hash_bip115(&self) -> &[u8] { + match self.prev_block_hash_bip115.as_ref() { + Some(v) => &v, + None => &[], + } + } + + // optional uint32 prev_block_height_bip115 = 12; + + pub fn clear_prev_block_height_bip115(&mut self) { + self.prev_block_height_bip115 = ::std::option::Option::None; + } + + pub fn has_prev_block_height_bip115(&self) -> bool { + self.prev_block_height_bip115.is_some() + } + + // Param is passed by value, moved + pub fn set_prev_block_height_bip115(&mut self, v: u32) { + self.prev_block_height_bip115 = ::std::option::Option::Some(v); + } + + pub fn get_prev_block_height_bip115(&self) -> u32 { + self.prev_block_height_bip115.unwrap_or(0) + } +} + +impl ::protobuf::Message for TxAck_TransactionType_TxInputType { + fn is_initialized(&self) -> bool { + if self.prev_hash.is_none() { + return false; + } + if self.prev_index.is_none() { + return false; + } + for v in &self.multisig { + if !v.is_initialized() { + return false; + } + }; + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_repeated_uint32_into(wire_type, is, &mut self.address_n)?; + }, + 2 => { + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.prev_hash)?; + }, + 3 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_uint32()?; + self.prev_index = ::std::option::Option::Some(tmp); + }, + 4 => { + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.script_sig)?; + }, + 5 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_uint32()?; + self.sequence = ::std::option::Option::Some(tmp); + }, + 6 => { + ::protobuf::rt::read_proto2_enum_with_unknown_fields_into(wire_type, is, &mut self.script_type, 6, &mut self.unknown_fields)? + }, + 7 => { + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.multisig)?; + }, + 8 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_uint64()?; + self.amount = ::std::option::Option::Some(tmp); + }, + 9 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_uint32()?; + self.decred_tree = ::std::option::Option::Some(tmp); + }, + 10 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_uint32()?; + self.decred_script_version = ::std::option::Option::Some(tmp); + }, + 11 => { + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.prev_block_hash_bip115)?; + }, + 12 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_uint32()?; + self.prev_block_height_bip115 = ::std::option::Option::Some(tmp); + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + for value in &self.address_n { + my_size += ::protobuf::rt::value_size(1, *value, ::protobuf::wire_format::WireTypeVarint); + }; + if let Some(ref v) = self.prev_hash.as_ref() { + my_size += ::protobuf::rt::bytes_size(2, &v); + } + if let Some(v) = self.prev_index { + my_size += ::protobuf::rt::value_size(3, v, ::protobuf::wire_format::WireTypeVarint); + } + if let Some(ref v) = self.script_sig.as_ref() { + my_size += ::protobuf::rt::bytes_size(4, &v); + } + if let Some(v) = self.sequence { + my_size += ::protobuf::rt::value_size(5, v, ::protobuf::wire_format::WireTypeVarint); + } + if let Some(v) = self.script_type { + my_size += ::protobuf::rt::enum_size(6, v); + } + if let Some(ref v) = self.multisig.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + } + if let Some(v) = self.amount { + my_size += ::protobuf::rt::value_size(8, v, ::protobuf::wire_format::WireTypeVarint); + } + if let Some(v) = self.decred_tree { + my_size += ::protobuf::rt::value_size(9, v, ::protobuf::wire_format::WireTypeVarint); + } + if let Some(v) = self.decred_script_version { + my_size += ::protobuf::rt::value_size(10, v, ::protobuf::wire_format::WireTypeVarint); + } + if let Some(ref v) = self.prev_block_hash_bip115.as_ref() { + my_size += ::protobuf::rt::bytes_size(11, &v); + } + if let Some(v) = self.prev_block_height_bip115 { + my_size += ::protobuf::rt::value_size(12, v, ::protobuf::wire_format::WireTypeVarint); + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + for v in &self.address_n { + os.write_uint32(1, *v)?; + }; + if let Some(ref v) = self.prev_hash.as_ref() { + os.write_bytes(2, &v)?; + } + if let Some(v) = self.prev_index { + os.write_uint32(3, v)?; + } + if let Some(ref v) = self.script_sig.as_ref() { + os.write_bytes(4, &v)?; + } + if let Some(v) = self.sequence { + os.write_uint32(5, v)?; + } + if let Some(v) = self.script_type { + os.write_enum(6, v.value())?; + } + if let Some(ref v) = self.multisig.as_ref() { + os.write_tag(7, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + } + if let Some(v) = self.amount { + os.write_uint64(8, v)?; + } + if let Some(v) = self.decred_tree { + os.write_uint32(9, v)?; + } + if let Some(v) = self.decred_script_version { + os.write_uint32(10, v)?; + } + if let Some(ref v) = self.prev_block_hash_bip115.as_ref() { + os.write_bytes(11, &v)?; + } + if let Some(v) = self.prev_block_height_bip115 { + os.write_uint32(12, v)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &::std::any::Any { + self as &::std::any::Any + } + fn as_any_mut(&mut self) -> &mut ::std::any::Any { + self as &mut ::std::any::Any + } + fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> TxAck_TransactionType_TxInputType { + TxAck_TransactionType_TxInputType::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_vec_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( + "address_n", + |m: &TxAck_TransactionType_TxInputType| { &m.address_n }, + |m: &mut TxAck_TransactionType_TxInputType| { &mut m.address_n }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "prev_hash", + |m: &TxAck_TransactionType_TxInputType| { &m.prev_hash }, + |m: &mut TxAck_TransactionType_TxInputType| { &mut m.prev_hash }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( + "prev_index", + |m: &TxAck_TransactionType_TxInputType| { &m.prev_index }, + |m: &mut TxAck_TransactionType_TxInputType| { &mut m.prev_index }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "script_sig", + |m: &TxAck_TransactionType_TxInputType| { &m.script_sig }, + |m: &mut TxAck_TransactionType_TxInputType| { &mut m.script_sig }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( + "sequence", + |m: &TxAck_TransactionType_TxInputType| { &m.sequence }, + |m: &mut TxAck_TransactionType_TxInputType| { &mut m.sequence }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( + "script_type", + |m: &TxAck_TransactionType_TxInputType| { &m.script_type }, + |m: &mut TxAck_TransactionType_TxInputType| { &mut m.script_type }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "multisig", + |m: &TxAck_TransactionType_TxInputType| { &m.multisig }, + |m: &mut TxAck_TransactionType_TxInputType| { &mut m.multisig }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint64>( + "amount", + |m: &TxAck_TransactionType_TxInputType| { &m.amount }, + |m: &mut TxAck_TransactionType_TxInputType| { &mut m.amount }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( + "decred_tree", + |m: &TxAck_TransactionType_TxInputType| { &m.decred_tree }, + |m: &mut TxAck_TransactionType_TxInputType| { &mut m.decred_tree }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( + "decred_script_version", + |m: &TxAck_TransactionType_TxInputType| { &m.decred_script_version }, + |m: &mut TxAck_TransactionType_TxInputType| { &mut m.decred_script_version }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "prev_block_hash_bip115", + |m: &TxAck_TransactionType_TxInputType| { &m.prev_block_hash_bip115 }, + |m: &mut TxAck_TransactionType_TxInputType| { &mut m.prev_block_hash_bip115 }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( + "prev_block_height_bip115", + |m: &TxAck_TransactionType_TxInputType| { &m.prev_block_height_bip115 }, + |m: &mut TxAck_TransactionType_TxInputType| { &mut m.prev_block_height_bip115 }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "TxAck_TransactionType_TxInputType", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static TxAck_TransactionType_TxInputType { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const TxAck_TransactionType_TxInputType, + }; + unsafe { + instance.get(TxAck_TransactionType_TxInputType::new) + } + } +} + +impl ::protobuf::Clear for TxAck_TransactionType_TxInputType { + fn clear(&mut self) { + self.clear_address_n(); + self.clear_prev_hash(); + self.clear_prev_index(); + self.clear_script_sig(); + self.clear_sequence(); + self.clear_script_type(); + self.clear_multisig(); + self.clear_amount(); + self.clear_decred_tree(); + self.clear_decred_script_version(); + self.clear_prev_block_hash_bip115(); + self.clear_prev_block_height_bip115(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for TxAck_TransactionType_TxInputType { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for TxAck_TransactionType_TxInputType { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct TxAck_TransactionType_TxOutputBinType { + // message fields + amount: ::std::option::Option, + script_pubkey: ::protobuf::SingularField<::std::vec::Vec>, + decred_script_version: ::std::option::Option, + // special fields + unknown_fields: ::protobuf::UnknownFields, + cached_size: ::protobuf::CachedSize, +} + +impl TxAck_TransactionType_TxOutputBinType { + pub fn new() -> TxAck_TransactionType_TxOutputBinType { + ::std::default::Default::default() + } + + // required uint64 amount = 1; + + pub fn clear_amount(&mut self) { + self.amount = ::std::option::Option::None; + } + + pub fn has_amount(&self) -> bool { + self.amount.is_some() + } + + // Param is passed by value, moved + pub fn set_amount(&mut self, v: u64) { + self.amount = ::std::option::Option::Some(v); + } + + pub fn get_amount(&self) -> u64 { + self.amount.unwrap_or(0) + } + + // required bytes script_pubkey = 2; + + pub fn clear_script_pubkey(&mut self) { + self.script_pubkey.clear(); + } + + pub fn has_script_pubkey(&self) -> bool { + self.script_pubkey.is_some() + } + + // Param is passed by value, moved + pub fn set_script_pubkey(&mut self, v: ::std::vec::Vec) { + self.script_pubkey = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_script_pubkey(&mut self) -> &mut ::std::vec::Vec { + if self.script_pubkey.is_none() { + self.script_pubkey.set_default(); + } + self.script_pubkey.as_mut().unwrap() + } + + // Take field + pub fn take_script_pubkey(&mut self) -> ::std::vec::Vec { + self.script_pubkey.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + pub fn get_script_pubkey(&self) -> &[u8] { + match self.script_pubkey.as_ref() { + Some(v) => &v, + None => &[], + } + } + + // optional uint32 decred_script_version = 3; + + pub fn clear_decred_script_version(&mut self) { + self.decred_script_version = ::std::option::Option::None; + } + + pub fn has_decred_script_version(&self) -> bool { + self.decred_script_version.is_some() + } + + // Param is passed by value, moved + pub fn set_decred_script_version(&mut self, v: u32) { + self.decred_script_version = ::std::option::Option::Some(v); + } + + pub fn get_decred_script_version(&self) -> u32 { + self.decred_script_version.unwrap_or(0) + } +} + +impl ::protobuf::Message for TxAck_TransactionType_TxOutputBinType { + fn is_initialized(&self) -> bool { + if self.amount.is_none() { + return false; + } + if self.script_pubkey.is_none() { + return false; + } + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_uint64()?; + self.amount = ::std::option::Option::Some(tmp); + }, + 2 => { + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.script_pubkey)?; + }, + 3 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_uint32()?; + self.decred_script_version = ::std::option::Option::Some(tmp); + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if let Some(v) = self.amount { + my_size += ::protobuf::rt::value_size(1, v, ::protobuf::wire_format::WireTypeVarint); + } + if let Some(ref v) = self.script_pubkey.as_ref() { + my_size += ::protobuf::rt::bytes_size(2, &v); + } + if let Some(v) = self.decred_script_version { + my_size += ::protobuf::rt::value_size(3, v, ::protobuf::wire_format::WireTypeVarint); + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + if let Some(v) = self.amount { + os.write_uint64(1, v)?; + } + if let Some(ref v) = self.script_pubkey.as_ref() { + os.write_bytes(2, &v)?; + } + if let Some(v) = self.decred_script_version { + os.write_uint32(3, v)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &::std::any::Any { + self as &::std::any::Any + } + fn as_any_mut(&mut self) -> &mut ::std::any::Any { + self as &mut ::std::any::Any + } + fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> TxAck_TransactionType_TxOutputBinType { + TxAck_TransactionType_TxOutputBinType::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint64>( + "amount", + |m: &TxAck_TransactionType_TxOutputBinType| { &m.amount }, + |m: &mut TxAck_TransactionType_TxOutputBinType| { &mut m.amount }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "script_pubkey", + |m: &TxAck_TransactionType_TxOutputBinType| { &m.script_pubkey }, + |m: &mut TxAck_TransactionType_TxOutputBinType| { &mut m.script_pubkey }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( + "decred_script_version", + |m: &TxAck_TransactionType_TxOutputBinType| { &m.decred_script_version }, + |m: &mut TxAck_TransactionType_TxOutputBinType| { &mut m.decred_script_version }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "TxAck_TransactionType_TxOutputBinType", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static TxAck_TransactionType_TxOutputBinType { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const TxAck_TransactionType_TxOutputBinType, + }; + unsafe { + instance.get(TxAck_TransactionType_TxOutputBinType::new) + } + } +} + +impl ::protobuf::Clear for TxAck_TransactionType_TxOutputBinType { + fn clear(&mut self) { + self.clear_amount(); + self.clear_script_pubkey(); + self.clear_decred_script_version(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for TxAck_TransactionType_TxOutputBinType { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for TxAck_TransactionType_TxOutputBinType { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct TxAck_TransactionType_TxOutputType { + // message fields + address: ::protobuf::SingularField<::std::string::String>, + address_n: ::std::vec::Vec, + amount: ::std::option::Option, + script_type: ::std::option::Option, + multisig: ::protobuf::SingularPtrField, + op_return_data: ::protobuf::SingularField<::std::vec::Vec>, + decred_script_version: ::std::option::Option, + block_hash_bip115: ::protobuf::SingularField<::std::vec::Vec>, + block_height_bip115: ::std::option::Option, + // special fields + unknown_fields: ::protobuf::UnknownFields, + cached_size: ::protobuf::CachedSize, +} + +impl TxAck_TransactionType_TxOutputType { + pub fn new() -> TxAck_TransactionType_TxOutputType { + ::std::default::Default::default() + } + + // optional string address = 1; + + pub fn clear_address(&mut self) { + self.address.clear(); + } + + pub fn has_address(&self) -> bool { + self.address.is_some() + } + + // Param is passed by value, moved + pub fn set_address(&mut self, v: ::std::string::String) { + self.address = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_address(&mut self) -> &mut ::std::string::String { + if self.address.is_none() { + self.address.set_default(); + } + self.address.as_mut().unwrap() + } + + // Take field + pub fn take_address(&mut self) -> ::std::string::String { + self.address.take().unwrap_or_else(|| ::std::string::String::new()) + } + + pub fn get_address(&self) -> &str { + match self.address.as_ref() { + Some(v) => &v, + None => "", + } + } + + // repeated uint32 address_n = 2; + + pub fn clear_address_n(&mut self) { + self.address_n.clear(); + } + + // Param is passed by value, moved + pub fn set_address_n(&mut self, v: ::std::vec::Vec) { + self.address_n = v; + } + + // Mutable pointer to the field. + pub fn mut_address_n(&mut self) -> &mut ::std::vec::Vec { + &mut self.address_n + } + + // Take field + pub fn take_address_n(&mut self) -> ::std::vec::Vec { + ::std::mem::replace(&mut self.address_n, ::std::vec::Vec::new()) + } + + pub fn get_address_n(&self) -> &[u32] { + &self.address_n + } + + // required uint64 amount = 3; + + pub fn clear_amount(&mut self) { + self.amount = ::std::option::Option::None; + } + + pub fn has_amount(&self) -> bool { + self.amount.is_some() + } + + // Param is passed by value, moved + pub fn set_amount(&mut self, v: u64) { + self.amount = ::std::option::Option::Some(v); + } + + pub fn get_amount(&self) -> u64 { + self.amount.unwrap_or(0) + } + + // required .hw.trezor.messages.bitcoin.TxAck.TransactionType.TxOutputType.OutputScriptType script_type = 4; + + pub fn clear_script_type(&mut self) { + self.script_type = ::std::option::Option::None; + } + + pub fn has_script_type(&self) -> bool { + self.script_type.is_some() + } + + // Param is passed by value, moved + pub fn set_script_type(&mut self, v: TxAck_TransactionType_TxOutputType_OutputScriptType) { + self.script_type = ::std::option::Option::Some(v); + } + + pub fn get_script_type(&self) -> TxAck_TransactionType_TxOutputType_OutputScriptType { + self.script_type.unwrap_or(TxAck_TransactionType_TxOutputType_OutputScriptType::PAYTOADDRESS) + } + + // optional .hw.trezor.messages.bitcoin.MultisigRedeemScriptType multisig = 5; + + pub fn clear_multisig(&mut self) { + self.multisig.clear(); + } + + pub fn has_multisig(&self) -> bool { + self.multisig.is_some() + } + + // Param is passed by value, moved + pub fn set_multisig(&mut self, v: MultisigRedeemScriptType) { + self.multisig = ::protobuf::SingularPtrField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_multisig(&mut self) -> &mut MultisigRedeemScriptType { + if self.multisig.is_none() { + self.multisig.set_default(); + } + self.multisig.as_mut().unwrap() + } + + // Take field + pub fn take_multisig(&mut self) -> MultisigRedeemScriptType { + self.multisig.take().unwrap_or_else(|| MultisigRedeemScriptType::new()) + } + + pub fn get_multisig(&self) -> &MultisigRedeemScriptType { + self.multisig.as_ref().unwrap_or_else(|| MultisigRedeemScriptType::default_instance()) + } + + // optional bytes op_return_data = 6; + + pub fn clear_op_return_data(&mut self) { + self.op_return_data.clear(); + } + + pub fn has_op_return_data(&self) -> bool { + self.op_return_data.is_some() + } + + // Param is passed by value, moved + pub fn set_op_return_data(&mut self, v: ::std::vec::Vec) { + self.op_return_data = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_op_return_data(&mut self) -> &mut ::std::vec::Vec { + if self.op_return_data.is_none() { + self.op_return_data.set_default(); + } + self.op_return_data.as_mut().unwrap() + } + + // Take field + pub fn take_op_return_data(&mut self) -> ::std::vec::Vec { + self.op_return_data.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + pub fn get_op_return_data(&self) -> &[u8] { + match self.op_return_data.as_ref() { + Some(v) => &v, + None => &[], + } + } + + // optional uint32 decred_script_version = 7; + + pub fn clear_decred_script_version(&mut self) { + self.decred_script_version = ::std::option::Option::None; + } + + pub fn has_decred_script_version(&self) -> bool { + self.decred_script_version.is_some() + } + + // Param is passed by value, moved + pub fn set_decred_script_version(&mut self, v: u32) { + self.decred_script_version = ::std::option::Option::Some(v); + } + + pub fn get_decred_script_version(&self) -> u32 { + self.decred_script_version.unwrap_or(0) + } + + // optional bytes block_hash_bip115 = 8; + + pub fn clear_block_hash_bip115(&mut self) { + self.block_hash_bip115.clear(); + } + + pub fn has_block_hash_bip115(&self) -> bool { + self.block_hash_bip115.is_some() + } + + // Param is passed by value, moved + pub fn set_block_hash_bip115(&mut self, v: ::std::vec::Vec) { + self.block_hash_bip115 = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_block_hash_bip115(&mut self) -> &mut ::std::vec::Vec { + if self.block_hash_bip115.is_none() { + self.block_hash_bip115.set_default(); + } + self.block_hash_bip115.as_mut().unwrap() + } + + // Take field + pub fn take_block_hash_bip115(&mut self) -> ::std::vec::Vec { + self.block_hash_bip115.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + pub fn get_block_hash_bip115(&self) -> &[u8] { + match self.block_hash_bip115.as_ref() { + Some(v) => &v, + None => &[], + } + } + + // optional uint32 block_height_bip115 = 9; + + pub fn clear_block_height_bip115(&mut self) { + self.block_height_bip115 = ::std::option::Option::None; + } + + pub fn has_block_height_bip115(&self) -> bool { + self.block_height_bip115.is_some() + } + + // Param is passed by value, moved + pub fn set_block_height_bip115(&mut self, v: u32) { + self.block_height_bip115 = ::std::option::Option::Some(v); + } + + pub fn get_block_height_bip115(&self) -> u32 { + self.block_height_bip115.unwrap_or(0) + } +} + +impl ::protobuf::Message for TxAck_TransactionType_TxOutputType { + fn is_initialized(&self) -> bool { + if self.amount.is_none() { + return false; + } + if self.script_type.is_none() { + return false; + } + for v in &self.multisig { + if !v.is_initialized() { + return false; + } + }; + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.address)?; + }, + 2 => { + ::protobuf::rt::read_repeated_uint32_into(wire_type, is, &mut self.address_n)?; + }, + 3 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_uint64()?; + self.amount = ::std::option::Option::Some(tmp); + }, + 4 => { + ::protobuf::rt::read_proto2_enum_with_unknown_fields_into(wire_type, is, &mut self.script_type, 4, &mut self.unknown_fields)? + }, + 5 => { + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.multisig)?; + }, + 6 => { + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.op_return_data)?; + }, + 7 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_uint32()?; + self.decred_script_version = ::std::option::Option::Some(tmp); + }, + 8 => { + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.block_hash_bip115)?; + }, + 9 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_uint32()?; + self.block_height_bip115 = ::std::option::Option::Some(tmp); + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if let Some(ref v) = self.address.as_ref() { + my_size += ::protobuf::rt::string_size(1, &v); + } + for value in &self.address_n { + my_size += ::protobuf::rt::value_size(2, *value, ::protobuf::wire_format::WireTypeVarint); + }; + if let Some(v) = self.amount { + my_size += ::protobuf::rt::value_size(3, v, ::protobuf::wire_format::WireTypeVarint); + } + if let Some(v) = self.script_type { + my_size += ::protobuf::rt::enum_size(4, v); + } + if let Some(ref v) = self.multisig.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + } + if let Some(ref v) = self.op_return_data.as_ref() { + my_size += ::protobuf::rt::bytes_size(6, &v); + } + if let Some(v) = self.decred_script_version { + my_size += ::protobuf::rt::value_size(7, v, ::protobuf::wire_format::WireTypeVarint); + } + if let Some(ref v) = self.block_hash_bip115.as_ref() { + my_size += ::protobuf::rt::bytes_size(8, &v); + } + if let Some(v) = self.block_height_bip115 { + my_size += ::protobuf::rt::value_size(9, v, ::protobuf::wire_format::WireTypeVarint); + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + if let Some(ref v) = self.address.as_ref() { + os.write_string(1, &v)?; + } + for v in &self.address_n { + os.write_uint32(2, *v)?; + }; + if let Some(v) = self.amount { + os.write_uint64(3, v)?; + } + if let Some(v) = self.script_type { + os.write_enum(4, v.value())?; + } + if let Some(ref v) = self.multisig.as_ref() { + os.write_tag(5, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + } + if let Some(ref v) = self.op_return_data.as_ref() { + os.write_bytes(6, &v)?; + } + if let Some(v) = self.decred_script_version { + os.write_uint32(7, v)?; + } + if let Some(ref v) = self.block_hash_bip115.as_ref() { + os.write_bytes(8, &v)?; + } + if let Some(v) = self.block_height_bip115 { + os.write_uint32(9, v)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &::std::any::Any { + self as &::std::any::Any + } + fn as_any_mut(&mut self) -> &mut ::std::any::Any { + self as &mut ::std::any::Any + } + fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> TxAck_TransactionType_TxOutputType { + TxAck_TransactionType_TxOutputType::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "address", + |m: &TxAck_TransactionType_TxOutputType| { &m.address }, + |m: &mut TxAck_TransactionType_TxOutputType| { &mut m.address }, + )); + fields.push(::protobuf::reflect::accessor::make_vec_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( + "address_n", + |m: &TxAck_TransactionType_TxOutputType| { &m.address_n }, + |m: &mut TxAck_TransactionType_TxOutputType| { &mut m.address_n }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint64>( + "amount", + |m: &TxAck_TransactionType_TxOutputType| { &m.amount }, + |m: &mut TxAck_TransactionType_TxOutputType| { &mut m.amount }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( + "script_type", + |m: &TxAck_TransactionType_TxOutputType| { &m.script_type }, + |m: &mut TxAck_TransactionType_TxOutputType| { &mut m.script_type }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "multisig", + |m: &TxAck_TransactionType_TxOutputType| { &m.multisig }, + |m: &mut TxAck_TransactionType_TxOutputType| { &mut m.multisig }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "op_return_data", + |m: &TxAck_TransactionType_TxOutputType| { &m.op_return_data }, + |m: &mut TxAck_TransactionType_TxOutputType| { &mut m.op_return_data }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( + "decred_script_version", + |m: &TxAck_TransactionType_TxOutputType| { &m.decred_script_version }, + |m: &mut TxAck_TransactionType_TxOutputType| { &mut m.decred_script_version }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "block_hash_bip115", + |m: &TxAck_TransactionType_TxOutputType| { &m.block_hash_bip115 }, + |m: &mut TxAck_TransactionType_TxOutputType| { &mut m.block_hash_bip115 }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( + "block_height_bip115", + |m: &TxAck_TransactionType_TxOutputType| { &m.block_height_bip115 }, + |m: &mut TxAck_TransactionType_TxOutputType| { &mut m.block_height_bip115 }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "TxAck_TransactionType_TxOutputType", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static TxAck_TransactionType_TxOutputType { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const TxAck_TransactionType_TxOutputType, + }; + unsafe { + instance.get(TxAck_TransactionType_TxOutputType::new) + } + } +} + +impl ::protobuf::Clear for TxAck_TransactionType_TxOutputType { + fn clear(&mut self) { + self.clear_address(); + self.clear_address_n(); + self.clear_amount(); + self.clear_script_type(); + self.clear_multisig(); + self.clear_op_return_data(); + self.clear_decred_script_version(); + self.clear_block_hash_bip115(); + self.clear_block_height_bip115(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for TxAck_TransactionType_TxOutputType { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for TxAck_TransactionType_TxOutputType { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(Clone,PartialEq,Eq,Debug,Hash)] +pub enum TxAck_TransactionType_TxOutputType_OutputScriptType { + PAYTOADDRESS = 0, + PAYTOSCRIPTHASH = 1, + PAYTOMULTISIG = 2, + PAYTOOPRETURN = 3, + PAYTOWITNESS = 4, + PAYTOP2SHWITNESS = 5, +} + +impl ::protobuf::ProtobufEnum for TxAck_TransactionType_TxOutputType_OutputScriptType { + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 0 => ::std::option::Option::Some(TxAck_TransactionType_TxOutputType_OutputScriptType::PAYTOADDRESS), + 1 => ::std::option::Option::Some(TxAck_TransactionType_TxOutputType_OutputScriptType::PAYTOSCRIPTHASH), + 2 => ::std::option::Option::Some(TxAck_TransactionType_TxOutputType_OutputScriptType::PAYTOMULTISIG), + 3 => ::std::option::Option::Some(TxAck_TransactionType_TxOutputType_OutputScriptType::PAYTOOPRETURN), + 4 => ::std::option::Option::Some(TxAck_TransactionType_TxOutputType_OutputScriptType::PAYTOWITNESS), + 5 => ::std::option::Option::Some(TxAck_TransactionType_TxOutputType_OutputScriptType::PAYTOP2SHWITNESS), + _ => ::std::option::Option::None + } + } + + fn values() -> &'static [Self] { + static values: &'static [TxAck_TransactionType_TxOutputType_OutputScriptType] = &[ + TxAck_TransactionType_TxOutputType_OutputScriptType::PAYTOADDRESS, + TxAck_TransactionType_TxOutputType_OutputScriptType::PAYTOSCRIPTHASH, + TxAck_TransactionType_TxOutputType_OutputScriptType::PAYTOMULTISIG, + TxAck_TransactionType_TxOutputType_OutputScriptType::PAYTOOPRETURN, + TxAck_TransactionType_TxOutputType_OutputScriptType::PAYTOWITNESS, + TxAck_TransactionType_TxOutputType_OutputScriptType::PAYTOP2SHWITNESS, + ]; + values + } + + fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::EnumDescriptor, + }; + unsafe { + descriptor.get(|| { + ::protobuf::reflect::EnumDescriptor::new("TxAck_TransactionType_TxOutputType_OutputScriptType", file_descriptor_proto()) + }) + } + } +} + +impl ::std::marker::Copy for TxAck_TransactionType_TxOutputType_OutputScriptType { +} + +impl ::protobuf::reflect::ProtobufValue for TxAck_TransactionType_TxOutputType_OutputScriptType { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) + } +} + +#[derive(Clone,PartialEq,Eq,Debug,Hash)] +pub enum InputScriptType { + SPENDADDRESS = 0, + SPENDMULTISIG = 1, + EXTERNAL = 2, + SPENDWITNESS = 3, + SPENDP2SHWITNESS = 4, +} + +impl ::protobuf::ProtobufEnum for InputScriptType { + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 0 => ::std::option::Option::Some(InputScriptType::SPENDADDRESS), + 1 => ::std::option::Option::Some(InputScriptType::SPENDMULTISIG), + 2 => ::std::option::Option::Some(InputScriptType::EXTERNAL), + 3 => ::std::option::Option::Some(InputScriptType::SPENDWITNESS), + 4 => ::std::option::Option::Some(InputScriptType::SPENDP2SHWITNESS), + _ => ::std::option::Option::None + } + } + + fn values() -> &'static [Self] { + static values: &'static [InputScriptType] = &[ + InputScriptType::SPENDADDRESS, + InputScriptType::SPENDMULTISIG, + InputScriptType::EXTERNAL, + InputScriptType::SPENDWITNESS, + InputScriptType::SPENDP2SHWITNESS, + ]; + values + } + + fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::EnumDescriptor, + }; + unsafe { + descriptor.get(|| { + ::protobuf::reflect::EnumDescriptor::new("InputScriptType", file_descriptor_proto()) + }) + } + } +} + +impl ::std::marker::Copy for InputScriptType { +} + +impl ::protobuf::reflect::ProtobufValue for InputScriptType { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) + } +} + +static file_descriptor_proto_data: &'static [u8] = b"\ + \n\x16messages-bitcoin.proto\x12\x1ahw.trezor.messages.bitcoin\x1a\x15me\ + ssages-common.proto\"\x91\x02\n\x18MultisigRedeemScriptType\x12]\n\x07pu\ + bkeys\x18\x01\x20\x03(\x0b2C.hw.trezor.messages.bitcoin.MultisigRedeemSc\ + riptType.HDNodePathTypeR\x07pubkeys\x12\x1e\n\nsignatures\x18\x02\x20\ + \x03(\x0cR\nsignatures\x12\x0c\n\x01m\x18\x03\x20\x01(\rR\x01m\x1ah\n\ + \x0eHDNodePathType\x129\n\x04node\x18\x01\x20\x02(\x0b2%.hw.trezor.messa\ + ges.common.HDNodeTypeR\x04node\x12\x1b\n\taddress_n\x18\x02\x20\x03(\rR\ + \x08addressN\"\xfa\x01\n\x0cGetPublicKey\x12\x1b\n\taddress_n\x18\x01\ + \x20\x03(\rR\x08addressN\x12(\n\x10ecdsa_curve_name\x18\x02\x20\x01(\tR\ + \x0eecdsaCurveName\x12!\n\x0cshow_display\x18\x03\x20\x01(\x08R\x0bshowD\ + isplay\x12$\n\tcoin_name\x18\x04\x20\x01(\t:\x07BitcoinR\x08coinName\x12\ + Z\n\x0bscript_type\x18\x05\x20\x01(\x0e2+.hw.trezor.messages.bitcoin.Inp\ + utScriptType:\x0cSPENDADDRESSR\nscriptType\"Z\n\tPublicKey\x129\n\x04nod\ + e\x18\x01\x20\x02(\x0b2%.hw.trezor.messages.common.HDNodeTypeR\x04node\ + \x12\x12\n\x04xpub\x18\x02\x20\x01(\tR\x04xpub\"\xa0\x02\n\nGetAddress\ + \x12\x1b\n\taddress_n\x18\x01\x20\x03(\rR\x08addressN\x12$\n\tcoin_name\ + \x18\x02\x20\x01(\t:\x07BitcoinR\x08coinName\x12!\n\x0cshow_display\x18\ + \x03\x20\x01(\x08R\x0bshowDisplay\x12P\n\x08multisig\x18\x04\x20\x01(\ + \x0b24.hw.trezor.messages.bitcoin.MultisigRedeemScriptTypeR\x08multisig\ + \x12Z\n\x0bscript_type\x18\x05\x20\x01(\x0e2+.hw.trezor.messages.bitcoin\ + .InputScriptType:\x0cSPENDADDRESSR\nscriptType\"#\n\x07Address\x12\x18\n\ + \x07address\x18\x01\x20\x02(\tR\x07address\"\xc6\x01\n\x0bSignMessage\ + \x12\x1b\n\taddress_n\x18\x01\x20\x03(\rR\x08addressN\x12\x18\n\x07messa\ + ge\x18\x02\x20\x02(\x0cR\x07message\x12$\n\tcoin_name\x18\x03\x20\x01(\t\ + :\x07BitcoinR\x08coinName\x12Z\n\x0bscript_type\x18\x04\x20\x01(\x0e2+.h\ + w.trezor.messages.bitcoin.InputScriptType:\x0cSPENDADDRESSR\nscriptType\ + \"J\n\x10MessageSignature\x12\x18\n\x07address\x18\x01\x20\x01(\tR\x07ad\ + dress\x12\x1c\n\tsignature\x18\x02\x20\x01(\x0cR\tsignature\"\x87\x01\n\ + \rVerifyMessage\x12\x18\n\x07address\x18\x01\x20\x01(\tR\x07address\x12\ + \x1c\n\tsignature\x18\x02\x20\x01(\x0cR\tsignature\x12\x18\n\x07message\ + \x18\x03\x20\x01(\x0cR\x07message\x12$\n\tcoin_name\x18\x04\x20\x01(\t:\ + \x07BitcoinR\x08coinName\"\xef\x01\n\x06SignTx\x12#\n\routputs_count\x18\ + \x01\x20\x02(\rR\x0coutputsCount\x12!\n\x0cinputs_count\x18\x02\x20\x02(\ + \rR\x0binputsCount\x12$\n\tcoin_name\x18\x03\x20\x01(\t:\x07BitcoinR\x08\ + coinName\x12\x1b\n\x07version\x18\x04\x20\x01(\r:\x011R\x07version\x12\ + \x1e\n\tlock_time\x18\x05\x20\x01(\r:\x010R\x08lockTime\x12\x16\n\x06exp\ + iry\x18\x06\x20\x01(\rR\x06expiry\x12\"\n\x0coverwintered\x18\x07\x20\ + \x01(\x08R\x0coverwintered\"\x9e\x05\n\tTxRequest\x12T\n\x0crequest_type\ + \x18\x01\x20\x01(\x0e21.hw.trezor.messages.bitcoin.TxRequest.RequestType\ + R\x0brequestType\x12T\n\x07details\x18\x02\x20\x01(\x0b2:.hw.trezor.mess\ + ages.bitcoin.TxRequest.TxRequestDetailsTypeR\x07details\x12]\n\nserializ\ + ed\x18\x03\x20\x01(\x0b2=.hw.trezor.messages.bitcoin.TxRequest.TxRequest\ + SerializedTypeR\nserialized\x1a\xa6\x01\n\x14TxRequestDetailsType\x12#\n\ + \rrequest_index\x18\x01\x20\x01(\rR\x0crequestIndex\x12\x17\n\x07tx_hash\ + \x18\x02\x20\x01(\x0cR\x06txHash\x12$\n\x0eextra_data_len\x18\x03\x20\ + \x01(\rR\x0cextraDataLen\x12*\n\x11extra_data_offset\x18\x04\x20\x01(\rR\ + \x0fextraDataOffset\x1a\x85\x01\n\x17TxRequestSerializedType\x12'\n\x0fs\ + ignature_index\x18\x01\x20\x01(\rR\x0esignatureIndex\x12\x1c\n\tsignatur\ + e\x18\x02\x20\x01(\x0cR\tsignature\x12#\n\rserialized_tx\x18\x03\x20\x01\ + (\x0cR\x0cserializedTx\"U\n\x0bRequestType\x12\x0b\n\x07TXINPUT\x10\0\ + \x12\x0c\n\x08TXOUTPUT\x10\x01\x12\n\n\x06TXMETA\x10\x02\x12\x0e\n\nTXFI\ + NISHED\x10\x03\x12\x0f\n\x0bTXEXTRADATA\x10\x04\"\x8d\x0f\n\x05TxAck\x12\ + A\n\x02tx\x18\x01\x20\x01(\x0b21.hw.trezor.messages.bitcoin.TxAck.Transa\ + ctionTypeR\x02tx\x1a\xc0\x0e\n\x0fTransactionType\x12\x18\n\x07version\ + \x18\x01\x20\x01(\rR\x07version\x12U\n\x06inputs\x18\x02\x20\x03(\x0b2=.\ + hw.trezor.messages.bitcoin.TxAck.TransactionType.TxInputTypeR\x06inputs\ + \x12b\n\x0bbin_outputs\x18\x03\x20\x03(\x0b2A.hw.trezor.messages.bitcoin\ + .TxAck.TransactionType.TxOutputBinTypeR\nbinOutputs\x12\x1b\n\tlock_time\ + \x18\x04\x20\x01(\rR\x08lockTime\x12X\n\x07outputs\x18\x05\x20\x03(\x0b2\ + >.hw.trezor.messages.bitcoin.TxAck.TransactionType.TxOutputTypeR\x07outp\ + uts\x12\x1d\n\ninputs_cnt\x18\x06\x20\x01(\rR\tinputsCnt\x12\x1f\n\x0bou\ + tputs_cnt\x18\x07\x20\x01(\rR\noutputsCnt\x12\x1d\n\nextra_data\x18\x08\ + \x20\x01(\x0cR\textraData\x12$\n\x0eextra_data_len\x18\t\x20\x01(\rR\x0c\ + extraDataLen\x12\x16\n\x06expiry\x18\n\x20\x01(\rR\x06expiry\x12\"\n\x0c\ + overwintered\x18\x0b\x20\x01(\x08R\x0coverwintered\x1a\xb6\x04\n\x0bTxIn\ + putType\x12\x1b\n\taddress_n\x18\x01\x20\x03(\rR\x08addressN\x12\x1b\n\t\ + prev_hash\x18\x02\x20\x02(\x0cR\x08prevHash\x12\x1d\n\nprev_index\x18\ + \x03\x20\x02(\rR\tprevIndex\x12\x1d\n\nscript_sig\x18\x04\x20\x01(\x0cR\ + \tscriptSig\x12&\n\x08sequence\x18\x05\x20\x01(\r:\n4294967295R\x08seque\ + nce\x12Z\n\x0bscript_type\x18\x06\x20\x01(\x0e2+.hw.trezor.messages.bitc\ + oin.InputScriptType:\x0cSPENDADDRESSR\nscriptType\x12P\n\x08multisig\x18\ + \x07\x20\x01(\x0b24.hw.trezor.messages.bitcoin.MultisigRedeemScriptTypeR\ + \x08multisig\x12\x16\n\x06amount\x18\x08\x20\x01(\x04R\x06amount\x12\x1f\ + \n\x0bdecred_tree\x18\t\x20\x01(\rR\ndecredTree\x122\n\x15decred_script_\ + version\x18\n\x20\x01(\rR\x13decredScriptVersion\x123\n\x16prev_block_ha\ + sh_bip115\x18\x0b\x20\x01(\x0cR\x13prevBlockHashBip115\x127\n\x18prev_bl\ + ock_height_bip115\x18\x0c\x20\x01(\rR\x15prevBlockHeightBip115\x1a\x82\ + \x01\n\x0fTxOutputBinType\x12\x16\n\x06amount\x18\x01\x20\x02(\x04R\x06a\ + mount\x12#\n\rscript_pubkey\x18\x02\x20\x02(\x0cR\x0cscriptPubkey\x122\n\ + \x15decred_script_version\x18\x03\x20\x01(\rR\x13decredScriptVersion\x1a\ + \xe1\x04\n\x0cTxOutputType\x12\x18\n\x07address\x18\x01\x20\x01(\tR\x07a\ + ddress\x12\x1b\n\taddress_n\x18\x02\x20\x03(\rR\x08addressN\x12\x16\n\ + \x06amount\x18\x03\x20\x02(\x04R\x06amount\x12p\n\x0bscript_type\x18\x04\ + \x20\x02(\x0e2O.hw.trezor.messages.bitcoin.TxAck.TransactionType.TxOutpu\ + tType.OutputScriptTypeR\nscriptType\x12P\n\x08multisig\x18\x05\x20\x01(\ + \x0b24.hw.trezor.messages.bitcoin.MultisigRedeemScriptTypeR\x08multisig\ + \x12$\n\x0eop_return_data\x18\x06\x20\x01(\x0cR\x0copReturnData\x122\n\ + \x15decred_script_version\x18\x07\x20\x01(\rR\x13decredScriptVersion\x12\ + *\n\x11block_hash_bip115\x18\x08\x20\x01(\x0cR\x0fblockHashBip115\x12.\n\ + \x13block_height_bip115\x18\t\x20\x01(\rR\x11blockHeightBip115\"\x87\x01\ + \n\x10OutputScriptType\x12\x10\n\x0cPAYTOADDRESS\x10\0\x12\x13\n\x0fPAYT\ + OSCRIPTHASH\x10\x01\x12\x11\n\rPAYTOMULTISIG\x10\x02\x12\x11\n\rPAYTOOPR\ + ETURN\x10\x03\x12\x10\n\x0cPAYTOWITNESS\x10\x04\x12\x14\n\x10PAYTOP2SHWI\ + TNESS\x10\x05*l\n\x0fInputScriptType\x12\x10\n\x0cSPENDADDRESS\x10\0\x12\ + \x11\n\rSPENDMULTISIG\x10\x01\x12\x0c\n\x08EXTERNAL\x10\x02\x12\x10\n\ + \x0cSPENDWITNESS\x10\x03\x12\x14\n\x10SPENDP2SHWITNESS\x10\x04B;\n#com.s\ + atoshilabs.trezor.lib.protobufB\x14TrezorMessageBitcoinJ\xd4f\n\x07\x12\ + \x05\0\0\xf2\x01\x01\n\x08\n\x01\x0c\x12\x03\0\0\x12\n\x08\n\x01\x02\x12\ + \x03\x01\x08\"\n\x08\n\x01\x08\x12\x03\x04\0<\n.\n\x02\x08\x01\x12\x03\ + \x04\0<\x1a#\x20Sugar\x20for\x20easier\x20handling\x20in\x20Java\n\n\x08\ + \n\x01\x08\x12\x03\x05\05\n\t\n\x02\x08\x08\x12\x03\x05\05\n\t\n\x02\x03\ + \0\x12\x03\x07\x07\x1e\nH\n\x02\x05\0\x12\x04\x0c\0\x12\x01\x1a<*\n\x20T\ + ype\x20of\x20script\x20which\x20will\x20be\x20used\x20for\x20transaction\ + \x20output\n\n\n\n\x03\x05\0\x01\x12\x03\x0c\x05\x14\n%\n\x04\x05\0\x02\ + \0\x12\x03\r\x04\x15\"\x18\x20standard\x20P2PKH\x20address\n\n\x0c\n\x05\ + \x05\0\x02\0\x01\x12\x03\r\x04\x10\n\x0c\n\x05\x05\0\x02\0\x02\x12\x03\r\ + \x13\x14\n$\n\x04\x05\0\x02\x01\x12\x03\x0e\x04\x16\"\x17\x20P2SH\x20mul\ + tisig\x20address\n\n\x0c\n\x05\x05\0\x02\x01\x01\x12\x03\x0e\x04\x11\n\ + \x0c\n\x05\x05\0\x02\x01\x02\x12\x03\x0e\x14\x15\n6\n\x04\x05\0\x02\x02\ + \x12\x03\x0f\x04\x11\")\x20reserved\x20for\x20external\x20inputs\x20(coi\ + njoin)\n\n\x0c\n\x05\x05\0\x02\x02\x01\x12\x03\x0f\x04\x0c\n\x0c\n\x05\ + \x05\0\x02\x02\x02\x12\x03\x0f\x0f\x10\n\x1c\n\x04\x05\0\x02\x03\x12\x03\ + \x10\x04\x15\"\x0f\x20native\x20SegWit\n\n\x0c\n\x05\x05\0\x02\x03\x01\ + \x12\x03\x10\x04\x10\n\x0c\n\x05\x05\0\x02\x03\x02\x12\x03\x10\x13\x14\n\ + 5\n\x04\x05\0\x02\x04\x12\x03\x11\x04\x19\"(\x20SegWit\x20over\x20P2SH\ + \x20(backward\x20compatible)\n\n\x0c\n\x05\x05\0\x02\x04\x01\x12\x03\x11\ + \x04\x14\n\x0c\n\x05\x05\0\x02\x04\x02\x12\x03\x11\x17\x18\n;\n\x02\x04\ + \0\x12\x04\x18\0#\x01\x1a/*\n\x20Type\x20of\x20redeem\x20script\x20used\ + \x20in\x20input\n\x20@embed\n\n\n\n\x03\x04\0\x01\x12\x03\x18\x08\x20\nG\ + \n\x04\x04\0\x02\0\x12\x03\x19\x04(\":\x20pubkeys\x20from\x20multisig\ + \x20address\x20(sorted\x20lexicographically)\n\n\x0c\n\x05\x04\0\x02\0\ + \x04\x12\x03\x19\x04\x0c\n\x0c\n\x05\x04\0\x02\0\x06\x12\x03\x19\r\x1b\n\ + \x0c\n\x05\x04\0\x02\0\x01\x12\x03\x19\x1c#\n\x0c\n\x05\x04\0\x02\0\x03\ + \x12\x03\x19&'\n=\n\x04\x04\0\x02\x01\x12\x03\x1a\x04\"\"0\x20existing\ + \x20signatures\x20for\x20partially\x20signed\x20input\n\n\x0c\n\x05\x04\ + \0\x02\x01\x04\x12\x03\x1a\x04\x0c\n\x0c\n\x05\x04\0\x02\x01\x05\x12\x03\ + \x1a\r\x12\n\x0c\n\x05\x04\0\x02\x01\x01\x12\x03\x1a\x13\x1d\n\x0c\n\x05\ + \x04\0\x02\x01\x03\x12\x03\x1a\x20!\nN\n\x04\x04\0\x02\x02\x12\x03\x1b\ + \x04\x1a\"A\x20\"m\"\x20from\x20n,\x20how\x20many\x20valid\x20signatures\ + \x20is\x20necessary\x20for\x20spending\n\n\x0c\n\x05\x04\0\x02\x02\x04\ + \x12\x03\x1b\x04\x0c\n\x0c\n\x05\x04\0\x02\x02\x05\x12\x03\x1b\r\x13\n\ + \x0c\n\x05\x04\0\x02\x02\x01\x12\x03\x1b\x14\x15\n\x0c\n\x05\x04\0\x02\ + \x02\x03\x12\x03\x1b\x18\x19\n6\n\x04\x04\0\x03\0\x12\x04\x1f\x04\"\x05\ + \x1a(*\n\x20Structure\x20representing\x20HDNode\x20+\x20Path\n\n\x0c\n\ + \x05\x04\0\x03\0\x01\x12\x03\x1f\x0c\x1a\n1\n\x06\x04\0\x03\0\x02\0\x12\ + \x03\x20\x08?\"\"\x20BIP-32\x20node\x20in\x20deserialized\x20form\n\n\ + \x0e\n\x07\x04\0\x03\0\x02\0\x04\x12\x03\x20\x08\x10\n\x0e\n\x07\x04\0\ + \x03\0\x02\0\x06\x12\x03\x20\x115\n\x0e\n\x07\x04\0\x03\0\x02\0\x01\x12\ + \x03\x206:\n\x0e\n\x07\x04\0\x03\0\x02\0\x03\x12\x03\x20=>\n8\n\x06\x04\ + \0\x03\0\x02\x01\x12\x03!\x08&\")\x20BIP-32\x20path\x20to\x20derive\x20t\ + he\x20key\x20from\x20node\n\n\x0e\n\x07\x04\0\x03\0\x02\x01\x04\x12\x03!\ + \x08\x10\n\x0e\n\x07\x04\0\x03\0\x02\x01\x05\x12\x03!\x11\x17\n\x0e\n\ + \x07\x04\0\x03\0\x02\x01\x01\x12\x03!\x18!\n\x0e\n\x07\x04\0\x03\0\x02\ + \x01\x03\x12\x03!$%\nz\n\x02\x04\x01\x12\x04+\01\x01\x1an*\n\x20Request:\ + \x20Ask\x20device\x20for\x20public\x20key\x20corresponding\x20to\x20addr\ + ess_n\x20path\n\x20@start\n\x20@next\x20PublicKey\n\x20@next\x20Failure\ + \n\n\n\n\x03\x04\x01\x01\x12\x03+\x08\x14\n=\n\x04\x04\x01\x02\0\x12\x03\ + ,\x04\"\"0\x20BIP-32\x20path\x20to\x20derive\x20the\x20key\x20from\x20ma\ + ster\x20node\n\n\x0c\n\x05\x04\x01\x02\0\x04\x12\x03,\x04\x0c\n\x0c\n\ + \x05\x04\x01\x02\0\x05\x12\x03,\r\x13\n\x0c\n\x05\x04\x01\x02\0\x01\x12\ + \x03,\x14\x1d\n\x0c\n\x05\x04\x01\x02\0\x03\x12\x03,\x20!\n&\n\x04\x04\ + \x01\x02\x01\x12\x03-\x04)\"\x19\x20ECDSA\x20curve\x20name\x20to\x20use\ + \n\n\x0c\n\x05\x04\x01\x02\x01\x04\x12\x03-\x04\x0c\n\x0c\n\x05\x04\x01\ + \x02\x01\x05\x12\x03-\r\x13\n\x0c\n\x05\x04\x01\x02\x01\x01\x12\x03-\x14\ + $\n\x0c\n\x05\x04\x01\x02\x01\x03\x12\x03-'(\nC\n\x04\x04\x01\x02\x02\ + \x12\x03.\x04#\"6\x20optionally\x20show\x20on\x20display\x20before\x20se\ + nding\x20the\x20result\n\n\x0c\n\x05\x04\x01\x02\x02\x04\x12\x03.\x04\ + \x0c\n\x0c\n\x05\x04\x01\x02\x02\x05\x12\x03.\r\x11\n\x0c\n\x05\x04\x01\ + \x02\x02\x01\x12\x03.\x12\x1e\n\x0c\n\x05\x04\x01\x02\x02\x03\x12\x03.!\ + \"\n(\n\x04\x04\x01\x02\x03\x12\x03/\x046\"\x1b\x20coin\x20to\x20use\x20\ + for\x20verifying\n\n\x0c\n\x05\x04\x01\x02\x03\x04\x12\x03/\x04\x0c\n\ + \x0c\n\x05\x04\x01\x02\x03\x05\x12\x03/\r\x13\n\x0c\n\x05\x04\x01\x02\ + \x03\x01\x12\x03/\x14\x1d\n\x0c\n\x05\x04\x01\x02\x03\x03\x12\x03/\x20!\ + \n\x0c\n\x05\x04\x01\x02\x03\x08\x12\x03/\"5\n\x0c\n\x05\x04\x01\x02\x03\ + \x07\x12\x03/+4\n]\n\x04\x04\x01\x02\x04\x12\x030\x04D\"P\x20used\x20to\ + \x20distinguish\x20between\x20various\x20address\x20formats\x20(non-segw\ + it,\x20segwit,\x20etc.)\n\n\x0c\n\x05\x04\x01\x02\x04\x04\x12\x030\x04\ + \x0c\n\x0c\n\x05\x04\x01\x02\x04\x06\x12\x030\r\x1c\n\x0c\n\x05\x04\x01\ + \x02\x04\x01\x12\x030\x1d(\n\x0c\n\x05\x04\x01\x02\x04\x03\x12\x030+,\n\ + \x0c\n\x05\x04\x01\x02\x04\x08\x12\x030-C\n\x0c\n\x05\x04\x01\x02\x04\ + \x07\x12\x0306B\nT\n\x02\x04\x02\x12\x047\0:\x01\x1aH*\n\x20Response:\ + \x20Contains\x20public\x20key\x20derived\x20from\x20device\x20private\ + \x20seed\n\x20@end\n\n\n\n\x03\x04\x02\x01\x12\x037\x08\x11\n\x20\n\x04\ + \x04\x02\x02\0\x12\x038\x04;\"\x13\x20BIP32\x20public\x20node\n\n\x0c\n\ + \x05\x04\x02\x02\0\x04\x12\x038\x04\x0c\n\x0c\n\x05\x04\x02\x02\0\x06\ + \x12\x038\r1\n\x0c\n\x05\x04\x02\x02\0\x01\x12\x03826\n\x0c\n\x05\x04\ + \x02\x02\0\x03\x12\x0389:\n-\n\x04\x04\x02\x02\x01\x12\x039\x04\x1d\"\ + \x20\x20serialized\x20form\x20of\x20public\x20node\n\n\x0c\n\x05\x04\x02\ + \x02\x01\x04\x12\x039\x04\x0c\n\x0c\n\x05\x04\x02\x02\x01\x05\x12\x039\r\ + \x13\n\x0c\n\x05\x04\x02\x02\x01\x01\x12\x039\x14\x18\n\x0c\n\x05\x04\ + \x02\x02\x01\x03\x12\x039\x1b\x1c\nu\n\x02\x04\x03\x12\x04B\0H\x01\x1ai*\ + \n\x20Request:\x20Ask\x20device\x20for\x20address\x20corresponding\x20to\ + \x20address_n\x20path\n\x20@start\n\x20@next\x20Address\n\x20@next\x20Fa\ + ilure\n\n\n\n\x03\x04\x03\x01\x12\x03B\x08\x12\n=\n\x04\x04\x03\x02\0\ + \x12\x03C\x04\"\"0\x20BIP-32\x20path\x20to\x20derive\x20the\x20key\x20fr\ + om\x20master\x20node\n\n\x0c\n\x05\x04\x03\x02\0\x04\x12\x03C\x04\x0c\n\ + \x0c\n\x05\x04\x03\x02\0\x05\x12\x03C\r\x13\n\x0c\n\x05\x04\x03\x02\0\ + \x01\x12\x03C\x14\x1d\n\x0c\n\x05\x04\x03\x02\0\x03\x12\x03C\x20!\n\x1a\ + \n\x04\x04\x03\x02\x01\x12\x03D\x046\"\r\x20coin\x20to\x20use\n\n\x0c\n\ + \x05\x04\x03\x02\x01\x04\x12\x03D\x04\x0c\n\x0c\n\x05\x04\x03\x02\x01\ + \x05\x12\x03D\r\x13\n\x0c\n\x05\x04\x03\x02\x01\x01\x12\x03D\x14\x1d\n\ + \x0c\n\x05\x04\x03\x02\x01\x03\x12\x03D\x20!\n\x0c\n\x05\x04\x03\x02\x01\ + \x08\x12\x03D\"5\n\x0c\n\x05\x04\x03\x02\x01\x07\x12\x03D+4\nC\n\x04\x04\ + \x03\x02\x02\x12\x03E\x04#\"6\x20optionally\x20show\x20on\x20display\x20\ + before\x20sending\x20the\x20result\n\n\x0c\n\x05\x04\x03\x02\x02\x04\x12\ + \x03E\x04\x0c\n\x0c\n\x05\x04\x03\x02\x02\x05\x12\x03E\r\x11\n\x0c\n\x05\ + \x04\x03\x02\x02\x01\x12\x03E\x12\x1e\n\x0c\n\x05\x04\x03\x02\x02\x03\ + \x12\x03E!\"\n:\n\x04\x04\x03\x02\x03\x12\x03F\x043\"-\x20filled\x20if\ + \x20we\x20are\x20showing\x20a\x20multisig\x20address\n\n\x0c\n\x05\x04\ + \x03\x02\x03\x04\x12\x03F\x04\x0c\n\x0c\n\x05\x04\x03\x02\x03\x06\x12\ + \x03F\r%\n\x0c\n\x05\x04\x03\x02\x03\x01\x12\x03F&.\n\x0c\n\x05\x04\x03\ + \x02\x03\x03\x12\x03F12\n]\n\x04\x04\x03\x02\x04\x12\x03G\x04D\"P\x20use\ + d\x20to\x20distinguish\x20between\x20various\x20address\x20formats\x20(n\ + on-segwit,\x20segwit,\x20etc.)\n\n\x0c\n\x05\x04\x03\x02\x04\x04\x12\x03\ + G\x04\x0c\n\x0c\n\x05\x04\x03\x02\x04\x06\x12\x03G\r\x1c\n\x0c\n\x05\x04\ + \x03\x02\x04\x01\x12\x03G\x1d(\n\x0c\n\x05\x04\x03\x02\x04\x03\x12\x03G+\ + ,\n\x0c\n\x05\x04\x03\x02\x04\x08\x12\x03G-C\n\x0c\n\x05\x04\x03\x02\x04\ + \x07\x12\x03G6B\nQ\n\x02\x04\x04\x12\x04N\0P\x01\x1aE*\n\x20Response:\ + \x20Contains\x20address\x20derived\x20from\x20device\x20private\x20seed\ + \n\x20@end\n\n\n\n\x03\x04\x04\x01\x12\x03N\x08\x0f\n.\n\x04\x04\x04\x02\ + \0\x12\x03O\x04\x20\"!\x20Coin\x20address\x20in\x20Base58\x20encoding\n\ + \n\x0c\n\x05\x04\x04\x02\0\x04\x12\x03O\x04\x0c\n\x0c\n\x05\x04\x04\x02\ + \0\x05\x12\x03O\r\x13\n\x0c\n\x05\x04\x04\x02\0\x01\x12\x03O\x14\x1b\n\ + \x0c\n\x05\x04\x04\x02\0\x03\x12\x03O\x1e\x1f\nb\n\x02\x04\x05\x12\x04X\ + \0]\x01\x1aV*\n\x20Request:\x20Ask\x20device\x20to\x20sign\x20message\n\ + \x20@start\n\x20@next\x20MessageSignature\n\x20@next\x20Failure\n\n\n\n\ + \x03\x04\x05\x01\x12\x03X\x08\x13\n=\n\x04\x04\x05\x02\0\x12\x03Y\x04\"\ + \"0\x20BIP-32\x20path\x20to\x20derive\x20the\x20key\x20from\x20master\ + \x20node\n\n\x0c\n\x05\x04\x05\x02\0\x04\x12\x03Y\x04\x0c\n\x0c\n\x05\ + \x04\x05\x02\0\x05\x12\x03Y\r\x13\n\x0c\n\x05\x04\x05\x02\0\x01\x12\x03Y\ + \x14\x1d\n\x0c\n\x05\x04\x05\x02\0\x03\x12\x03Y\x20!\n#\n\x04\x04\x05\ + \x02\x01\x12\x03Z\x04\x1f\"\x16\x20message\x20to\x20be\x20signed\n\n\x0c\ + \n\x05\x04\x05\x02\x01\x04\x12\x03Z\x04\x0c\n\x0c\n\x05\x04\x05\x02\x01\ + \x05\x12\x03Z\r\x12\n\x0c\n\x05\x04\x05\x02\x01\x01\x12\x03Z\x13\x1a\n\ + \x0c\n\x05\x04\x05\x02\x01\x03\x12\x03Z\x1d\x1e\n&\n\x04\x04\x05\x02\x02\ + \x12\x03[\x046\"\x19\x20coin\x20to\x20use\x20for\x20signing\n\n\x0c\n\ + \x05\x04\x05\x02\x02\x04\x12\x03[\x04\x0c\n\x0c\n\x05\x04\x05\x02\x02\ + \x05\x12\x03[\r\x13\n\x0c\n\x05\x04\x05\x02\x02\x01\x12\x03[\x14\x1d\n\ + \x0c\n\x05\x04\x05\x02\x02\x03\x12\x03[\x20!\n\x0c\n\x05\x04\x05\x02\x02\ + \x08\x12\x03[\"5\n\x0c\n\x05\x04\x05\x02\x02\x07\x12\x03[+4\n]\n\x04\x04\ + \x05\x02\x03\x12\x03\\\x04D\"P\x20used\x20to\x20distinguish\x20between\ + \x20various\x20address\x20formats\x20(non-segwit,\x20segwit,\x20etc.)\n\ + \n\x0c\n\x05\x04\x05\x02\x03\x04\x12\x03\\\x04\x0c\n\x0c\n\x05\x04\x05\ + \x02\x03\x06\x12\x03\\\r\x1c\n\x0c\n\x05\x04\x05\x02\x03\x01\x12\x03\\\ + \x1d(\n\x0c\n\x05\x04\x05\x02\x03\x03\x12\x03\\+,\n\x0c\n\x05\x04\x05\ + \x02\x03\x08\x12\x03\\-C\n\x0c\n\x05\x04\x05\x02\x03\x07\x12\x03\\6B\n.\ + \n\x02\x04\x06\x12\x04c\0f\x01\x1a\"*\n\x20Response:\x20Signed\x20messag\ + e\n\x20@end\n\n\n\n\x03\x04\x06\x01\x12\x03c\x08\x18\n/\n\x04\x04\x06\ + \x02\0\x12\x03d\x04\x20\"\"\x20address\x20used\x20to\x20sign\x20the\x20m\ + essage\n\n\x0c\n\x05\x04\x06\x02\0\x04\x12\x03d\x04\x0c\n\x0c\n\x05\x04\ + \x06\x02\0\x05\x12\x03d\r\x13\n\x0c\n\x05\x04\x06\x02\0\x01\x12\x03d\x14\ + \x1b\n\x0c\n\x05\x04\x06\x02\0\x03\x12\x03d\x1e\x1f\n'\n\x04\x04\x06\x02\ + \x01\x12\x03e\x04!\"\x1a\x20signature\x20of\x20the\x20message\n\n\x0c\n\ + \x05\x04\x06\x02\x01\x04\x12\x03e\x04\x0c\n\x0c\n\x05\x04\x06\x02\x01\ + \x05\x12\x03e\r\x12\n\x0c\n\x05\x04\x06\x02\x01\x01\x12\x03e\x13\x1c\n\ + \x0c\n\x05\x04\x06\x02\x01\x03\x12\x03e\x1f\x20\n[\n\x02\x04\x07\x12\x04\ + n\0s\x01\x1aO*\n\x20Request:\x20Ask\x20device\x20to\x20verify\x20message\ + \n\x20@start\n\x20@next\x20Success\n\x20@next\x20Failure\n\n\n\n\x03\x04\ + \x07\x01\x12\x03n\x08\x15\n\x20\n\x04\x04\x07\x02\0\x12\x03o\x04\x20\"\ + \x13\x20address\x20to\x20verify\n\n\x0c\n\x05\x04\x07\x02\0\x04\x12\x03o\ + \x04\x0c\n\x0c\n\x05\x04\x07\x02\0\x05\x12\x03o\r\x13\n\x0c\n\x05\x04\ + \x07\x02\0\x01\x12\x03o\x14\x1b\n\x0c\n\x05\x04\x07\x02\0\x03\x12\x03o\ + \x1e\x1f\n\"\n\x04\x04\x07\x02\x01\x12\x03p\x04!\"\x15\x20signature\x20t\ + o\x20verify\n\n\x0c\n\x05\x04\x07\x02\x01\x04\x12\x03p\x04\x0c\n\x0c\n\ + \x05\x04\x07\x02\x01\x05\x12\x03p\r\x12\n\x0c\n\x05\x04\x07\x02\x01\x01\ + \x12\x03p\x13\x1c\n\x0c\n\x05\x04\x07\x02\x01\x03\x12\x03p\x1f\x20\n\x20\ + \n\x04\x04\x07\x02\x02\x12\x03q\x04\x1f\"\x13\x20message\x20to\x20verify\ + \n\n\x0c\n\x05\x04\x07\x02\x02\x04\x12\x03q\x04\x0c\n\x0c\n\x05\x04\x07\ + \x02\x02\x05\x12\x03q\r\x12\n\x0c\n\x05\x04\x07\x02\x02\x01\x12\x03q\x13\ + \x1a\n\x0c\n\x05\x04\x07\x02\x02\x03\x12\x03q\x1d\x1e\n(\n\x04\x04\x07\ + \x02\x03\x12\x03r\x046\"\x1b\x20coin\x20to\x20use\x20for\x20verifying\n\ + \n\x0c\n\x05\x04\x07\x02\x03\x04\x12\x03r\x04\x0c\n\x0c\n\x05\x04\x07\ + \x02\x03\x05\x12\x03r\r\x13\n\x0c\n\x05\x04\x07\x02\x03\x01\x12\x03r\x14\ + \x1d\n\x0c\n\x05\x04\x07\x02\x03\x03\x12\x03r\x20!\n\x0c\n\x05\x04\x07\ + \x02\x03\x08\x12\x03r\"5\n\x0c\n\x05\x04\x07\x02\x03\x07\x12\x03r+4\n`\n\ + \x02\x04\x08\x12\x05{\0\x83\x01\x01\x1aS*\n\x20Request:\x20Ask\x20device\ + \x20to\x20sign\x20transaction\n\x20@start\n\x20@next\x20TxRequest\n\x20@\ + next\x20Failure\n\n\n\n\x03\x04\x08\x01\x12\x03{\x08\x0e\n,\n\x04\x04\ + \x08\x02\0\x12\x03|\x04&\"\x1f\x20number\x20of\x20transaction\x20outputs\ + \n\n\x0c\n\x05\x04\x08\x02\0\x04\x12\x03|\x04\x0c\n\x0c\n\x05\x04\x08\ + \x02\0\x05\x12\x03|\r\x13\n\x0c\n\x05\x04\x08\x02\0\x01\x12\x03|\x14!\n\ + \x0c\n\x05\x04\x08\x02\0\x03\x12\x03|$%\n+\n\x04\x04\x08\x02\x01\x12\x03\ + }\x04%\"\x1e\x20number\x20of\x20transaction\x20inputs\n\n\x0c\n\x05\x04\ + \x08\x02\x01\x04\x12\x03}\x04\x0c\n\x0c\n\x05\x04\x08\x02\x01\x05\x12\ + \x03}\r\x13\n\x0c\n\x05\x04\x08\x02\x01\x01\x12\x03}\x14\x20\n\x0c\n\x05\ + \x04\x08\x02\x01\x03\x12\x03}#$\n\x1a\n\x04\x04\x08\x02\x02\x12\x03~\x04\ + 6\"\r\x20coin\x20to\x20use\n\n\x0c\n\x05\x04\x08\x02\x02\x04\x12\x03~\ + \x04\x0c\n\x0c\n\x05\x04\x08\x02\x02\x05\x12\x03~\r\x13\n\x0c\n\x05\x04\ + \x08\x02\x02\x01\x12\x03~\x14\x1d\n\x0c\n\x05\x04\x08\x02\x02\x03\x12\ + \x03~\x20!\n\x0c\n\x05\x04\x08\x02\x02\x08\x12\x03~\"5\n\x0c\n\x05\x04\ + \x08\x02\x02\x07\x12\x03~+4\n\"\n\x04\x04\x08\x02\x03\x12\x03\x7f\x04,\"\ + \x15\x20transaction\x20version\n\n\x0c\n\x05\x04\x08\x02\x03\x04\x12\x03\ + \x7f\x04\x0c\n\x0c\n\x05\x04\x08\x02\x03\x05\x12\x03\x7f\r\x13\n\x0c\n\ + \x05\x04\x08\x02\x03\x01\x12\x03\x7f\x14\x1b\n\x0c\n\x05\x04\x08\x02\x03\ + \x03\x12\x03\x7f\x1e\x1f\n\x0c\n\x05\x04\x08\x02\x03\x08\x12\x03\x7f\x20\ + +\n\x0c\n\x05\x04\x08\x02\x03\x07\x12\x03\x7f)*\n%\n\x04\x04\x08\x02\x04\ + \x12\x04\x80\x01\x04.\"\x17\x20transaction\x20lock_time\n\n\r\n\x05\x04\ + \x08\x02\x04\x04\x12\x04\x80\x01\x04\x0c\n\r\n\x05\x04\x08\x02\x04\x05\ + \x12\x04\x80\x01\r\x13\n\r\n\x05\x04\x08\x02\x04\x01\x12\x04\x80\x01\x14\ + \x1d\n\r\n\x05\x04\x08\x02\x04\x03\x12\x04\x80\x01\x20!\n\r\n\x05\x04\ + \x08\x02\x04\x08\x12\x04\x80\x01\"-\n\r\n\x05\x04\x08\x02\x04\x07\x12\ + \x04\x80\x01+,\n)\n\x04\x04\x08\x02\x05\x12\x04\x81\x01\x04\x1f\"\x1b\ + \x20only\x20for\x20Decred\x20and\x20Zcash\n\n\r\n\x05\x04\x08\x02\x05\ + \x04\x12\x04\x81\x01\x04\x0c\n\r\n\x05\x04\x08\x02\x05\x05\x12\x04\x81\ + \x01\r\x13\n\r\n\x05\x04\x08\x02\x05\x01\x12\x04\x81\x01\x14\x1a\n\r\n\ + \x05\x04\x08\x02\x05\x03\x12\x04\x81\x01\x1d\x1e\n\x1e\n\x04\x04\x08\x02\ + \x06\x12\x04\x82\x01\x04#\"\x10\x20only\x20for\x20Zcash\n\n\r\n\x05\x04\ + \x08\x02\x06\x04\x12\x04\x82\x01\x04\x0c\n\r\n\x05\x04\x08\x02\x06\x05\ + \x12\x04\x82\x01\r\x11\n\r\n\x05\x04\x08\x02\x06\x01\x12\x04\x82\x01\x12\ + \x1e\n\r\n\x05\x04\x08\x02\x06\x03\x12\x04\x82\x01!\"\n\xbf\x02\n\x02\ + \x04\t\x12\x06\x8c\x01\0\xab\x01\x01\x1a\xb0\x02*\n\x20Response:\x20Devi\ + ce\x20asks\x20for\x20information\x20for\x20signing\x20transaction\x20or\ + \x20returns\x20the\x20last\x20result\n\x20If\x20request_index\x20is\x20s\ + et,\x20device\x20awaits\x20TxAck\x20message\x20(with\x20fields\x20filled\ + \x20in\x20according\x20to\x20request_type)\n\x20If\x20signature_index\ + \x20is\x20set,\x20'signature'\x20contains\x20signed\x20input\x20of\x20si\ + gnature_index's\x20input\n\x20@end\n\x20@next\x20TxAck\n\n\x0b\n\x03\x04\ + \t\x01\x12\x04\x8c\x01\x08\x11\n7\n\x04\x04\t\x02\0\x12\x04\x8d\x01\x04*\ + \")\x20what\x20should\x20be\x20filled\x20in\x20TxAck\x20message?\n\n\r\n\ + \x05\x04\t\x02\0\x04\x12\x04\x8d\x01\x04\x0c\n\r\n\x05\x04\t\x02\0\x06\ + \x12\x04\x8d\x01\r\x18\n\r\n\x05\x04\t\x02\0\x01\x12\x04\x8d\x01\x19%\n\ + \r\n\x05\x04\t\x02\0\x03\x12\x04\x8d\x01()\n&\n\x04\x04\t\x02\x01\x12\ + \x04\x8e\x01\x04.\"\x18\x20request\x20for\x20tx\x20details\n\n\r\n\x05\ + \x04\t\x02\x01\x04\x12\x04\x8e\x01\x04\x0c\n\r\n\x05\x04\t\x02\x01\x06\ + \x12\x04\x8e\x01\r!\n\r\n\x05\x04\t\x02\x01\x01\x12\x04\x8e\x01\")\n\r\n\ + \x05\x04\t\x02\x01\x03\x12\x04\x8e\x01,-\n4\n\x04\x04\t\x02\x02\x12\x04\ + \x8f\x01\x044\"&\x20serialized\x20data\x20and\x20request\x20for\x20next\ + \n\n\r\n\x05\x04\t\x02\x02\x04\x12\x04\x8f\x01\x04\x0c\n\r\n\x05\x04\t\ + \x02\x02\x06\x12\x04\x8f\x01\r$\n\r\n\x05\x04\t\x02\x02\x01\x12\x04\x8f\ + \x01%/\n\r\n\x05\x04\t\x02\x02\x03\x12\x04\x8f\x0123\nO\n\x04\x04\t\x04\ + \0\x12\x06\x93\x01\x04\x99\x01\x05\x1a?*\n\x20Type\x20of\x20information\ + \x20required\x20by\x20transaction\x20signing\x20process\n\n\r\n\x05\x04\ + \t\x04\0\x01\x12\x04\x93\x01\t\x14\n\x0e\n\x06\x04\t\x04\0\x02\0\x12\x04\ + \x94\x01\x08\x14\n\x0f\n\x07\x04\t\x04\0\x02\0\x01\x12\x04\x94\x01\x08\ + \x0f\n\x0f\n\x07\x04\t\x04\0\x02\0\x02\x12\x04\x94\x01\x12\x13\n\x0e\n\ + \x06\x04\t\x04\0\x02\x01\x12\x04\x95\x01\x08\x15\n\x0f\n\x07\x04\t\x04\0\ + \x02\x01\x01\x12\x04\x95\x01\x08\x10\n\x0f\n\x07\x04\t\x04\0\x02\x01\x02\ + \x12\x04\x95\x01\x13\x14\n\x0e\n\x06\x04\t\x04\0\x02\x02\x12\x04\x96\x01\ + \x08\x13\n\x0f\n\x07\x04\t\x04\0\x02\x02\x01\x12\x04\x96\x01\x08\x0e\n\ + \x0f\n\x07\x04\t\x04\0\x02\x02\x02\x12\x04\x96\x01\x11\x12\n\x0e\n\x06\ + \x04\t\x04\0\x02\x03\x12\x04\x97\x01\x08\x17\n\x0f\n\x07\x04\t\x04\0\x02\ + \x03\x01\x12\x04\x97\x01\x08\x12\n\x0f\n\x07\x04\t\x04\0\x02\x03\x02\x12\ + \x04\x97\x01\x15\x16\n\x0e\n\x06\x04\t\x04\0\x02\x04\x12\x04\x98\x01\x08\ + \x18\n\x0f\n\x07\x04\t\x04\0\x02\x04\x01\x12\x04\x98\x01\x08\x13\n\x0f\n\ + \x07\x04\t\x04\0\x02\x04\x02\x12\x04\x98\x01\x16\x17\n:\n\x04\x04\t\x03\ + \0\x12\x06\x9d\x01\x04\xa2\x01\x05\x1a**\n\x20Structure\x20representing\ + \x20request\x20details\n\n\r\n\x05\x04\t\x03\0\x01\x12\x04\x9d\x01\x0c\ + \x20\n@\n\x06\x04\t\x03\0\x02\0\x12\x04\x9e\x01\x08*\"0\x20device\x20exp\ + ects\x20TxAck\x20message\x20from\x20the\x20computer\n\n\x0f\n\x07\x04\t\ + \x03\0\x02\0\x04\x12\x04\x9e\x01\x08\x10\n\x0f\n\x07\x04\t\x03\0\x02\0\ + \x05\x12\x04\x9e\x01\x11\x17\n\x0f\n\x07\x04\t\x03\0\x02\0\x01\x12\x04\ + \x9e\x01\x18%\n\x0f\n\x07\x04\t\x03\0\x02\0\x03\x12\x04\x9e\x01()\n2\n\ + \x06\x04\t\x03\0\x02\x01\x12\x04\x9f\x01\x08#\"\"\x20tx_hash\x20of\x20re\ + quested\x20transaction\n\n\x0f\n\x07\x04\t\x03\0\x02\x01\x04\x12\x04\x9f\ + \x01\x08\x10\n\x0f\n\x07\x04\t\x03\0\x02\x01\x05\x12\x04\x9f\x01\x11\x16\ + \n\x0f\n\x07\x04\t\x03\0\x02\x01\x01\x12\x04\x9f\x01\x17\x1e\n\x0f\n\x07\ + \x04\t\x03\0\x02\x01\x03\x12\x04\x9f\x01!\"\n0\n\x06\x04\t\x03\0\x02\x02\ + \x12\x04\xa0\x01\x08+\"\x20\x20length\x20of\x20requested\x20extra\x20dat\ + a\n\n\x0f\n\x07\x04\t\x03\0\x02\x02\x04\x12\x04\xa0\x01\x08\x10\n\x0f\n\ + \x07\x04\t\x03\0\x02\x02\x05\x12\x04\xa0\x01\x11\x17\n\x0f\n\x07\x04\t\ + \x03\0\x02\x02\x01\x12\x04\xa0\x01\x18&\n\x0f\n\x07\x04\t\x03\0\x02\x02\ + \x03\x12\x04\xa0\x01)*\n0\n\x06\x04\t\x03\0\x02\x03\x12\x04\xa1\x01\x08.\ + \"\x20\x20offset\x20of\x20requested\x20extra\x20data\n\n\x0f\n\x07\x04\t\ + \x03\0\x02\x03\x04\x12\x04\xa1\x01\x08\x10\n\x0f\n\x07\x04\t\x03\0\x02\ + \x03\x05\x12\x04\xa1\x01\x11\x17\n\x0f\n\x07\x04\t\x03\0\x02\x03\x01\x12\ + \x04\xa1\x01\x18)\n\x0f\n\x07\x04\t\x03\0\x02\x03\x03\x12\x04\xa1\x01,-\ + \n:\n\x04\x04\t\x03\x01\x12\x06\xa6\x01\x04\xaa\x01\x05\x1a**\n\x20Struc\ + ture\x20representing\x20serialized\x20data\n\n\r\n\x05\x04\t\x03\x01\x01\ + \x12\x04\xa6\x01\x0c#\nG\n\x06\x04\t\x03\x01\x02\0\x12\x04\xa7\x01\x08,\ + \"7\x20'signature'\x20field\x20contains\x20signed\x20input\x20of\x20this\ + \x20index\n\n\x0f\n\x07\x04\t\x03\x01\x02\0\x04\x12\x04\xa7\x01\x08\x10\ + \n\x0f\n\x07\x04\t\x03\x01\x02\0\x05\x12\x04\xa7\x01\x11\x17\n\x0f\n\x07\ + \x04\t\x03\x01\x02\0\x01\x12\x04\xa7\x01\x18'\n\x0f\n\x07\x04\t\x03\x01\ + \x02\0\x03\x12\x04\xa7\x01*+\n8\n\x06\x04\t\x03\x01\x02\x01\x12\x04\xa8\ + \x01\x08%\"(\x20signature\x20of\x20the\x20signature_index\x20input\n\n\ + \x0f\n\x07\x04\t\x03\x01\x02\x01\x04\x12\x04\xa8\x01\x08\x10\n\x0f\n\x07\ + \x04\t\x03\x01\x02\x01\x05\x12\x04\xa8\x01\x11\x16\n\x0f\n\x07\x04\t\x03\ + \x01\x02\x01\x01\x12\x04\xa8\x01\x17\x20\n\x0f\n\x07\x04\t\x03\x01\x02\ + \x01\x03\x12\x04\xa8\x01#$\n;\n\x06\x04\t\x03\x01\x02\x02\x12\x04\xa9\ + \x01\x08)\"+\x20part\x20of\x20serialized\x20and\x20signed\x20transaction\ + \n\n\x0f\n\x07\x04\t\x03\x01\x02\x02\x04\x12\x04\xa9\x01\x08\x10\n\x0f\n\ + \x07\x04\t\x03\x01\x02\x02\x05\x12\x04\xa9\x01\x11\x16\n\x0f\n\x07\x04\t\ + \x03\x01\x02\x02\x01\x12\x04\xa9\x01\x17$\n\x0f\n\x07\x04\t\x03\x01\x02\ + \x02\x03\x12\x04\xa9\x01'(\nE\n\x02\x04\n\x12\x06\xb1\x01\0\xf2\x01\x01\ + \x1a7*\n\x20Request:\x20Reported\x20transaction\x20data\n\x20@next\x20Tx\ + Request\n\n\x0b\n\x03\x04\n\x01\x12\x04\xb1\x01\x08\r\n\x0c\n\x04\x04\n\ + \x02\0\x12\x04\xb2\x01\x04$\n\r\n\x05\x04\n\x02\0\x04\x12\x04\xb2\x01\ + \x04\x0c\n\r\n\x05\x04\n\x02\0\x06\x12\x04\xb2\x01\r\x1c\n\r\n\x05\x04\n\ + \x02\0\x01\x12\x04\xb2\x01\x1d\x1f\n\r\n\x05\x04\n\x02\0\x03\x12\x04\xb2\ + \x01\"#\n6\n\x04\x04\n\x03\0\x12\x06\xb6\x01\x04\xf1\x01\x05\x1a&*\n\x20\ + Structure\x20representing\x20transaction\n\n\r\n\x05\x04\n\x03\0\x01\x12\ + \x04\xb6\x01\x0c\x1b\n\x0e\n\x06\x04\n\x03\0\x02\0\x12\x04\xb7\x01\x08$\ + \n\x0f\n\x07\x04\n\x03\0\x02\0\x04\x12\x04\xb7\x01\x08\x10\n\x0f\n\x07\ + \x04\n\x03\0\x02\0\x05\x12\x04\xb7\x01\x11\x17\n\x0f\n\x07\x04\n\x03\0\ + \x02\0\x01\x12\x04\xb7\x01\x18\x1f\n\x0f\n\x07\x04\n\x03\0\x02\0\x03\x12\ + \x04\xb7\x01\"#\n\x0e\n\x06\x04\n\x03\0\x02\x01\x12\x04\xb8\x01\x08(\n\ + \x0f\n\x07\x04\n\x03\0\x02\x01\x04\x12\x04\xb8\x01\x08\x10\n\x0f\n\x07\ + \x04\n\x03\0\x02\x01\x06\x12\x04\xb8\x01\x11\x1c\n\x0f\n\x07\x04\n\x03\0\ + \x02\x01\x01\x12\x04\xb8\x01\x1d#\n\x0f\n\x07\x04\n\x03\0\x02\x01\x03\ + \x12\x04\xb8\x01&'\n\x0e\n\x06\x04\n\x03\0\x02\x02\x12\x04\xb9\x01\x081\ + \n\x0f\n\x07\x04\n\x03\0\x02\x02\x04\x12\x04\xb9\x01\x08\x10\n\x0f\n\x07\ + \x04\n\x03\0\x02\x02\x06\x12\x04\xb9\x01\x11\x20\n\x0f\n\x07\x04\n\x03\0\ + \x02\x02\x01\x12\x04\xb9\x01!,\n\x0f\n\x07\x04\n\x03\0\x02\x02\x03\x12\ + \x04\xb9\x01/0\n\x0e\n\x06\x04\n\x03\0\x02\x03\x12\x04\xba\x01\x08&\n\ + \x0f\n\x07\x04\n\x03\0\x02\x03\x04\x12\x04\xba\x01\x08\x10\n\x0f\n\x07\ + \x04\n\x03\0\x02\x03\x05\x12\x04\xba\x01\x11\x17\n\x0f\n\x07\x04\n\x03\0\ + \x02\x03\x01\x12\x04\xba\x01\x18!\n\x0f\n\x07\x04\n\x03\0\x02\x03\x03\ + \x12\x04\xba\x01$%\n\x0e\n\x06\x04\n\x03\0\x02\x04\x12\x04\xbb\x01\x08*\ + \n\x0f\n\x07\x04\n\x03\0\x02\x04\x04\x12\x04\xbb\x01\x08\x10\n\x0f\n\x07\ + \x04\n\x03\0\x02\x04\x06\x12\x04\xbb\x01\x11\x1d\n\x0f\n\x07\x04\n\x03\0\ + \x02\x04\x01\x12\x04\xbb\x01\x1e%\n\x0f\n\x07\x04\n\x03\0\x02\x04\x03\ + \x12\x04\xbb\x01()\n\x0e\n\x06\x04\n\x03\0\x02\x05\x12\x04\xbc\x01\x08'\ + \n\x0f\n\x07\x04\n\x03\0\x02\x05\x04\x12\x04\xbc\x01\x08\x10\n\x0f\n\x07\ + \x04\n\x03\0\x02\x05\x05\x12\x04\xbc\x01\x11\x17\n\x0f\n\x07\x04\n\x03\0\ + \x02\x05\x01\x12\x04\xbc\x01\x18\"\n\x0f\n\x07\x04\n\x03\0\x02\x05\x03\ + \x12\x04\xbc\x01%&\n\x0e\n\x06\x04\n\x03\0\x02\x06\x12\x04\xbd\x01\x08(\ + \n\x0f\n\x07\x04\n\x03\0\x02\x06\x04\x12\x04\xbd\x01\x08\x10\n\x0f\n\x07\ + \x04\n\x03\0\x02\x06\x05\x12\x04\xbd\x01\x11\x17\n\x0f\n\x07\x04\n\x03\0\ + \x02\x06\x01\x12\x04\xbd\x01\x18#\n\x0f\n\x07\x04\n\x03\0\x02\x06\x03\ + \x12\x04\xbd\x01&'\n\x20\n\x06\x04\n\x03\0\x02\x07\x12\x04\xbe\x01\x08&\ + \"\x10\x20only\x20for\x20Zcash\n\n\x0f\n\x07\x04\n\x03\0\x02\x07\x04\x12\ + \x04\xbe\x01\x08\x10\n\x0f\n\x07\x04\n\x03\0\x02\x07\x05\x12\x04\xbe\x01\ + \x11\x16\n\x0f\n\x07\x04\n\x03\0\x02\x07\x01\x12\x04\xbe\x01\x17!\n\x0f\ + \n\x07\x04\n\x03\0\x02\x07\x03\x12\x04\xbe\x01$%\n\x20\n\x06\x04\n\x03\0\ + \x02\x08\x12\x04\xbf\x01\x08+\"\x10\x20only\x20for\x20Zcash\n\n\x0f\n\ + \x07\x04\n\x03\0\x02\x08\x04\x12\x04\xbf\x01\x08\x10\n\x0f\n\x07\x04\n\ + \x03\0\x02\x08\x05\x12\x04\xbf\x01\x11\x17\n\x0f\n\x07\x04\n\x03\0\x02\ + \x08\x01\x12\x04\xbf\x01\x18&\n\x0f\n\x07\x04\n\x03\0\x02\x08\x03\x12\ + \x04\xbf\x01)*\n+\n\x06\x04\n\x03\0\x02\t\x12\x04\xc0\x01\x08$\"\x1b\x20\ + only\x20for\x20Decred\x20and\x20Zcash\n\n\x0f\n\x07\x04\n\x03\0\x02\t\ + \x04\x12\x04\xc0\x01\x08\x10\n\x0f\n\x07\x04\n\x03\0\x02\t\x05\x12\x04\ + \xc0\x01\x11\x17\n\x0f\n\x07\x04\n\x03\0\x02\t\x01\x12\x04\xc0\x01\x18\ + \x1e\n\x0f\n\x07\x04\n\x03\0\x02\t\x03\x12\x04\xc0\x01!#\n\x20\n\x06\x04\ + \n\x03\0\x02\n\x12\x04\xc1\x01\x08(\"\x10\x20only\x20for\x20Zcash\n\n\ + \x0f\n\x07\x04\n\x03\0\x02\n\x04\x12\x04\xc1\x01\x08\x10\n\x0f\n\x07\x04\ + \n\x03\0\x02\n\x05\x12\x04\xc1\x01\x11\x15\n\x0f\n\x07\x04\n\x03\0\x02\n\ + \x01\x12\x04\xc1\x01\x16\"\n\x0f\n\x07\x04\n\x03\0\x02\n\x03\x12\x04\xc1\ + \x01%'\n>\n\x06\x04\n\x03\0\x03\0\x12\x06\xc5\x01\x08\xd2\x01\t\x1a,*\n\ + \x20Structure\x20representing\x20transaction\x20input\n\n\x0f\n\x07\x04\ + \n\x03\0\x03\0\x01\x12\x04\xc5\x01\x10\x1b\nB\n\x08\x04\n\x03\0\x03\0\ + \x02\0\x12\x04\xc6\x01\x0c*\"0\x20BIP-32\x20path\x20to\x20derive\x20the\ + \x20key\x20from\x20master\x20node\n\n\x11\n\t\x04\n\x03\0\x03\0\x02\0\ + \x04\x12\x04\xc6\x01\x0c\x14\n\x11\n\t\x04\n\x03\0\x03\0\x02\0\x05\x12\ + \x04\xc6\x01\x15\x1b\n\x11\n\t\x04\n\x03\0\x03\0\x02\0\x01\x12\x04\xc6\ + \x01\x1c%\n\x11\n\t\x04\n\x03\0\x03\0\x02\0\x03\x12\x04\xc6\x01()\nN\n\ + \x08\x04\n\x03\0\x03\0\x02\x01\x12\x04\xc7\x01\x0c)\"<\x20hash\x20of\x20\ + previous\x20transaction\x20output\x20to\x20spend\x20by\x20this\x20input\ + \n\n\x11\n\t\x04\n\x03\0\x03\0\x02\x01\x04\x12\x04\xc7\x01\x0c\x14\n\x11\ + \n\t\x04\n\x03\0\x03\0\x02\x01\x05\x12\x04\xc7\x01\x15\x1a\n\x11\n\t\x04\ + \n\x03\0\x03\0\x02\x01\x01\x12\x04\xc7\x01\x1b$\n\x11\n\t\x04\n\x03\0\ + \x03\0\x02\x01\x03\x12\x04\xc7\x01'(\n5\n\x08\x04\n\x03\0\x03\0\x02\x02\ + \x12\x04\xc8\x01\x0c+\"#\x20index\x20of\x20previous\x20output\x20to\x20s\ + pend\n\n\x11\n\t\x04\n\x03\0\x03\0\x02\x02\x04\x12\x04\xc8\x01\x0c\x14\n\ + \x11\n\t\x04\n\x03\0\x03\0\x02\x02\x05\x12\x04\xc8\x01\x15\x1b\n\x11\n\t\ + \x04\n\x03\0\x03\0\x02\x02\x01\x12\x04\xc8\x01\x1c&\n\x11\n\t\x04\n\x03\ + \0\x03\0\x02\x02\x03\x12\x04\xc8\x01)*\n:\n\x08\x04\n\x03\0\x03\0\x02\ + \x03\x12\x04\xc9\x01\x0c*\"(\x20script\x20signature,\x20unset\x20for\x20\ + tx\x20to\x20sign\n\n\x11\n\t\x04\n\x03\0\x03\0\x02\x03\x04\x12\x04\xc9\ + \x01\x0c\x14\n\x11\n\t\x04\n\x03\0\x03\0\x02\x03\x05\x12\x04\xc9\x01\x15\ + \x1a\n\x11\n\t\x04\n\x03\0\x03\0\x02\x03\x01\x12\x04\xc9\x01\x1b%\n\x11\ + \n\t\x04\n\x03\0\x03\0\x02\x03\x03\x12\x04\xc9\x01()\n1\n\x08\x04\n\x03\ + \0\x03\0\x02\x04\x12\x04\xca\x01\x0c>\"\x1f\x20sequence\x20(default=0xff\ + ffffff)\n\n\x11\n\t\x04\n\x03\0\x03\0\x02\x04\x04\x12\x04\xca\x01\x0c\ + \x14\n\x11\n\t\x04\n\x03\0\x03\0\x02\x04\x05\x12\x04\xca\x01\x15\x1b\n\ + \x11\n\t\x04\n\x03\0\x03\0\x02\x04\x01\x12\x04\xca\x01\x1c$\n\x11\n\t\ + \x04\n\x03\0\x03\0\x02\x04\x03\x12\x04\xca\x01'(\n\x11\n\t\x04\n\x03\0\ + \x03\0\x02\x04\x08\x12\x04\xca\x01)=\n\x11\n\t\x04\n\x03\0\x03\0\x02\x04\ + \x07\x12\x04\xca\x012<\n4\n\x08\x04\n\x03\0\x03\0\x02\x05\x12\x04\xcb\ + \x01\x0cL\"\"\x20defines\x20template\x20of\x20input\x20script\n\n\x11\n\ + \t\x04\n\x03\0\x03\0\x02\x05\x04\x12\x04\xcb\x01\x0c\x14\n\x11\n\t\x04\n\ + \x03\0\x03\0\x02\x05\x06\x12\x04\xcb\x01\x15$\n\x11\n\t\x04\n\x03\0\x03\ + \0\x02\x05\x01\x12\x04\xcb\x01%0\n\x11\n\t\x04\n\x03\0\x03\0\x02\x05\x03\ + \x12\x04\xcb\x0134\n\x11\n\t\x04\n\x03\0\x03\0\x02\x05\x08\x12\x04\xcb\ + \x015K\n\x11\n\t\x04\n\x03\0\x03\0\x02\x05\x07\x12\x04\xcb\x01>J\nA\n\ + \x08\x04\n\x03\0\x03\0\x02\x06\x12\x04\xcc\x01\x0c;\"/\x20Filled\x20if\ + \x20input\x20is\x20going\x20to\x20spend\x20multisig\x20tx\n\n\x11\n\t\ + \x04\n\x03\0\x03\0\x02\x06\x04\x12\x04\xcc\x01\x0c\x14\n\x11\n\t\x04\n\ + \x03\0\x03\0\x02\x06\x06\x12\x04\xcc\x01\x15-\n\x11\n\t\x04\n\x03\0\x03\ + \0\x02\x06\x01\x12\x04\xcc\x01.6\n\x11\n\t\x04\n\x03\0\x03\0\x02\x06\x03\ + \x12\x04\xcc\x019:\nK\n\x08\x04\n\x03\0\x03\0\x02\x07\x12\x04\xcd\x01\ + \x0c'\"9\x20amount\x20of\x20previous\x20transaction\x20output\x20(for\ + \x20segwit\x20only)\n\n\x11\n\t\x04\n\x03\0\x03\0\x02\x07\x04\x12\x04\ + \xcd\x01\x0c\x14\n\x11\n\t\x04\n\x03\0\x03\0\x02\x07\x05\x12\x04\xcd\x01\ + \x15\x1b\n\x11\n\t\x04\n\x03\0\x03\0\x02\x07\x01\x12\x04\xcd\x01\x1c\"\n\ + \x11\n\t\x04\n\x03\0\x03\0\x02\x07\x03\x12\x04\xcd\x01%&\n\x10\n\x08\x04\ + \n\x03\0\x03\0\x02\x08\x12\x04\xce\x01\x0c,\n\x11\n\t\x04\n\x03\0\x03\0\ + \x02\x08\x04\x12\x04\xce\x01\x0c\x14\n\x11\n\t\x04\n\x03\0\x03\0\x02\x08\ + \x05\x12\x04\xce\x01\x15\x1b\n\x11\n\t\x04\n\x03\0\x03\0\x02\x08\x01\x12\ + \x04\xce\x01\x1c'\n\x11\n\t\x04\n\x03\0\x03\0\x02\x08\x03\x12\x04\xce\ + \x01*+\n\x10\n\x08\x04\n\x03\0\x03\0\x02\t\x12\x04\xcf\x01\x0c7\n\x11\n\ + \t\x04\n\x03\0\x03\0\x02\t\x04\x12\x04\xcf\x01\x0c\x14\n\x11\n\t\x04\n\ + \x03\0\x03\0\x02\t\x05\x12\x04\xcf\x01\x15\x1b\n\x11\n\t\x04\n\x03\0\x03\ + \0\x02\t\x01\x12\x04\xcf\x01\x1c1\n\x11\n\t\x04\n\x03\0\x03\0\x02\t\x03\ + \x12\x04\xcf\x0146\nY\n\x08\x04\n\x03\0\x03\0\x02\n\x12\x04\xd0\x01\x0c7\ + \"G\x20block\x20hash\x20of\x20previous\x20transaction\x20output\x20(for\ + \x20bip115\x20implementation)\n\n\x11\n\t\x04\n\x03\0\x03\0\x02\n\x04\ + \x12\x04\xd0\x01\x0c\x14\n\x11\n\t\x04\n\x03\0\x03\0\x02\n\x05\x12\x04\ + \xd0\x01\x15\x1a\n\x11\n\t\x04\n\x03\0\x03\0\x02\n\x01\x12\x04\xd0\x01\ + \x1b1\n\x11\n\t\x04\n\x03\0\x03\0\x02\n\x03\x12\x04\xd0\x0146\n[\n\x08\ + \x04\n\x03\0\x03\0\x02\x0b\x12\x04\xd1\x01\x0c:\"I\x20block\x20height\ + \x20of\x20previous\x20transaction\x20output\x20(for\x20bip115\x20impleme\ + ntation)\n\n\x11\n\t\x04\n\x03\0\x03\0\x02\x0b\x04\x12\x04\xd1\x01\x0c\ + \x14\n\x11\n\t\x04\n\x03\0\x03\0\x02\x0b\x05\x12\x04\xd1\x01\x15\x1b\n\ + \x11\n\t\x04\n\x03\0\x03\0\x02\x0b\x01\x12\x04\xd1\x01\x1c4\n\x11\n\t\ + \x04\n\x03\0\x03\0\x02\x0b\x03\x12\x04\xd1\x0179\nH\n\x06\x04\n\x03\0\ + \x03\x01\x12\x06\xd6\x01\x08\xda\x01\t\x1a6*\n\x20Structure\x20represent\ + ing\x20compiled\x20transaction\x20output\n\n\x0f\n\x07\x04\n\x03\0\x03\ + \x01\x01\x12\x04\xd6\x01\x10\x1f\n\x10\n\x08\x04\n\x03\0\x03\x01\x02\0\ + \x12\x04\xd7\x01\x0c'\n\x11\n\t\x04\n\x03\0\x03\x01\x02\0\x04\x12\x04\ + \xd7\x01\x0c\x14\n\x11\n\t\x04\n\x03\0\x03\x01\x02\0\x05\x12\x04\xd7\x01\ + \x15\x1b\n\x11\n\t\x04\n\x03\0\x03\x01\x02\0\x01\x12\x04\xd7\x01\x1c\"\n\ + \x11\n\t\x04\n\x03\0\x03\x01\x02\0\x03\x12\x04\xd7\x01%&\n\x10\n\x08\x04\ + \n\x03\0\x03\x01\x02\x01\x12\x04\xd8\x01\x0c-\n\x11\n\t\x04\n\x03\0\x03\ + \x01\x02\x01\x04\x12\x04\xd8\x01\x0c\x14\n\x11\n\t\x04\n\x03\0\x03\x01\ + \x02\x01\x05\x12\x04\xd8\x01\x15\x1a\n\x11\n\t\x04\n\x03\0\x03\x01\x02\ + \x01\x01\x12\x04\xd8\x01\x1b(\n\x11\n\t\x04\n\x03\0\x03\x01\x02\x01\x03\ + \x12\x04\xd8\x01+,\n\x10\n\x08\x04\n\x03\0\x03\x01\x02\x02\x12\x04\xd9\ + \x01\x0c6\n\x11\n\t\x04\n\x03\0\x03\x01\x02\x02\x04\x12\x04\xd9\x01\x0c\ + \x14\n\x11\n\t\x04\n\x03\0\x03\x01\x02\x02\x05\x12\x04\xd9\x01\x15\x1b\n\ + \x11\n\t\x04\n\x03\0\x03\x01\x02\x02\x01\x12\x04\xd9\x01\x1c1\n\x11\n\t\ + \x04\n\x03\0\x03\x01\x02\x02\x03\x12\x04\xd9\x0145\n?\n\x06\x04\n\x03\0\ + \x03\x02\x12\x06\xde\x01\x08\xf0\x01\t\x1a-*\n\x20Structure\x20represent\ + ing\x20transaction\x20output\n\n\x0f\n\x07\x04\n\x03\0\x03\x02\x01\x12\ + \x04\xde\x01\x10\x1c\n:\n\x08\x04\n\x03\0\x03\x02\x02\0\x12\x04\xdf\x01\ + \x0c(\"(\x20target\x20coin\x20address\x20in\x20Base58\x20encoding\n\n\ + \x11\n\t\x04\n\x03\0\x03\x02\x02\0\x04\x12\x04\xdf\x01\x0c\x14\n\x11\n\t\ + \x04\n\x03\0\x03\x02\x02\0\x05\x12\x04\xdf\x01\x15\x1b\n\x11\n\t\x04\n\ + \x03\0\x03\x02\x02\0\x01\x12\x04\xdf\x01\x1c#\n\x11\n\t\x04\n\x03\0\x03\ + \x02\x02\0\x03\x12\x04\xdf\x01&'\nf\n\x08\x04\n\x03\0\x03\x02\x02\x01\ + \x12\x04\xe0\x01\x0c*\"T\x20BIP-32\x20path\x20to\x20derive\x20the\x20key\ + \x20from\x20master\x20node;\x20has\x20higher\x20priority\x20than\x20\"ad\ + dress\"\n\n\x11\n\t\x04\n\x03\0\x03\x02\x02\x01\x04\x12\x04\xe0\x01\x0c\ + \x14\n\x11\n\t\x04\n\x03\0\x03\x02\x02\x01\x05\x12\x04\xe0\x01\x15\x1b\n\ + \x11\n\t\x04\n\x03\0\x03\x02\x02\x01\x01\x12\x04\xe0\x01\x1c%\n\x11\n\t\ + \x04\n\x03\0\x03\x02\x02\x01\x03\x12\x04\xe0\x01()\n/\n\x08\x04\n\x03\0\ + \x03\x02\x02\x02\x12\x04\xe1\x01\x0c'\"\x1d\x20amount\x20to\x20spend\x20\ + in\x20satoshis\n\n\x11\n\t\x04\n\x03\0\x03\x02\x02\x02\x04\x12\x04\xe1\ + \x01\x0c\x14\n\x11\n\t\x04\n\x03\0\x03\x02\x02\x02\x05\x12\x04\xe1\x01\ + \x15\x1b\n\x11\n\t\x04\n\x03\0\x03\x02\x02\x02\x01\x12\x04\xe1\x01\x1c\"\ + \n\x11\n\t\x04\n\x03\0\x03\x02\x02\x02\x03\x12\x04\xe1\x01%&\n&\n\x08\ + \x04\n\x03\0\x03\x02\x02\x03\x12\x04\xe2\x01\x0c6\"\x14\x20output\x20scr\ + ipt\x20type\n\n\x11\n\t\x04\n\x03\0\x03\x02\x02\x03\x04\x12\x04\xe2\x01\ + \x0c\x14\n\x11\n\t\x04\n\x03\0\x03\x02\x02\x03\x06\x12\x04\xe2\x01\x15%\ + \n\x11\n\t\x04\n\x03\0\x03\x02\x02\x03\x01\x12\x04\xe2\x01&1\n\x11\n\t\ + \x04\n\x03\0\x03\x02\x02\x03\x03\x12\x04\xe2\x0145\nO\n\x08\x04\n\x03\0\ + \x03\x02\x02\x04\x12\x04\xe3\x01\x0c;\"=\x20defines\x20multisig\x20addre\ + ss;\x20script_type\x20must\x20be\x20PAYTOMULTISIG\n\n\x11\n\t\x04\n\x03\ + \0\x03\x02\x02\x04\x04\x12\x04\xe3\x01\x0c\x14\n\x11\n\t\x04\n\x03\0\x03\ + \x02\x02\x04\x06\x12\x04\xe3\x01\x15-\n\x11\n\t\x04\n\x03\0\x03\x02\x02\ + \x04\x01\x12\x04\xe3\x01.6\n\x11\n\t\x04\n\x03\0\x03\x02\x02\x04\x03\x12\ + \x04\xe3\x019:\n_\n\x08\x04\n\x03\0\x03\x02\x02\x05\x12\x04\xe4\x01\x0c.\ + \"M\x20defines\x20op_return\x20data;\x20script_type\x20must\x20be\x20PAY\ + TOOPRETURN,\x20amount\x20must\x20be\x200\n\n\x11\n\t\x04\n\x03\0\x03\x02\ + \x02\x05\x04\x12\x04\xe4\x01\x0c\x14\n\x11\n\t\x04\n\x03\0\x03\x02\x02\ + \x05\x05\x12\x04\xe4\x01\x15\x1a\n\x11\n\t\x04\n\x03\0\x03\x02\x02\x05\ + \x01\x12\x04\xe4\x01\x1b)\n\x11\n\t\x04\n\x03\0\x03\x02\x02\x05\x03\x12\ + \x04\xe4\x01,-\n\x10\n\x08\x04\n\x03\0\x03\x02\x02\x06\x12\x04\xe5\x01\ + \x0c6\n\x11\n\t\x04\n\x03\0\x03\x02\x02\x06\x04\x12\x04\xe5\x01\x0c\x14\ + \n\x11\n\t\x04\n\x03\0\x03\x02\x02\x06\x05\x12\x04\xe5\x01\x15\x1b\n\x11\ + \n\t\x04\n\x03\0\x03\x02\x02\x06\x01\x12\x04\xe5\x01\x1c1\n\x11\n\t\x04\ + \n\x03\0\x03\x02\x02\x06\x03\x12\x04\xe5\x0145\nn\n\x08\x04\n\x03\0\x03\ + \x02\x02\x07\x12\x04\xe6\x01\x0c1\"\\\x20block\x20hash\x20of\x20existing\ + \x20block\x20(recommended\x20current_block\x20-\x20300)\x20(for\x20bip11\ + 5\x20implementation)\n\n\x11\n\t\x04\n\x03\0\x03\x02\x02\x07\x04\x12\x04\ + \xe6\x01\x0c\x14\n\x11\n\t\x04\n\x03\0\x03\x02\x02\x07\x05\x12\x04\xe6\ + \x01\x15\x1a\n\x11\n\t\x04\n\x03\0\x03\x02\x02\x07\x01\x12\x04\xe6\x01\ + \x1b,\n\x11\n\t\x04\n\x03\0\x03\x02\x02\x07\x03\x12\x04\xe6\x01/0\np\n\ + \x08\x04\n\x03\0\x03\x02\x02\x08\x12\x04\xe7\x01\x0c4\"^\x20block\x20hei\ + ght\x20of\x20existing\x20block\x20(recommended\x20current_block\x20-\x20\ + 300)\x20(for\x20bip115\x20implementation)\n\n\x11\n\t\x04\n\x03\0\x03\ + \x02\x02\x08\x04\x12\x04\xe7\x01\x0c\x14\n\x11\n\t\x04\n\x03\0\x03\x02\ + \x02\x08\x05\x12\x04\xe7\x01\x15\x1b\n\x11\n\t\x04\n\x03\0\x03\x02\x02\ + \x08\x01\x12\x04\xe7\x01\x1c/\n\x11\n\t\x04\n\x03\0\x03\x02\x02\x08\x03\ + \x12\x04\xe7\x0123\n\x12\n\x08\x04\n\x03\0\x03\x02\x04\0\x12\x06\xe8\x01\ + \x0c\xef\x01\r\n\x11\n\t\x04\n\x03\0\x03\x02\x04\0\x01\x12\x04\xe8\x01\ + \x11!\nE\n\n\x04\n\x03\0\x03\x02\x04\0\x02\0\x12\x04\xe9\x01\x10!\"1\x20\ + used\x20for\x20all\x20addresses\x20(bitcoin,\x20p2sh,\x20witness)\n\n\ + \x13\n\x0b\x04\n\x03\0\x03\x02\x04\0\x02\0\x01\x12\x04\xe9\x01\x10\x1c\n\ + \x13\n\x0b\x04\n\x03\0\x03\x02\x04\0\x02\0\x02\x12\x04\xe9\x01\x1f\x20\n\ + A\n\n\x04\n\x03\0\x03\x02\x04\0\x02\x01\x12\x04\xea\x01\x10$\"-\x20p2sh\ + \x20address\x20(deprecated;\x20use\x20PAYTOADDRESS)\n\n\x13\n\x0b\x04\n\ + \x03\0\x03\x02\x04\0\x02\x01\x01\x12\x04\xea\x01\x10\x1f\n\x13\n\x0b\x04\ + \n\x03\0\x03\x02\x04\0\x02\x01\x02\x12\x04\xea\x01\"#\n,\n\n\x04\n\x03\0\ + \x03\x02\x04\0\x02\x02\x12\x04\xeb\x01\x10\"\"\x18\x20only\x20for\x20cha\ + nge\x20output\n\n\x13\n\x0b\x04\n\x03\0\x03\x02\x04\0\x02\x02\x01\x12\ + \x04\xeb\x01\x10\x1d\n\x13\n\x0b\x04\n\x03\0\x03\x02\x04\0\x02\x02\x02\ + \x12\x04\xeb\x01\x20!\n\x1f\n\n\x04\n\x03\0\x03\x02\x04\0\x02\x03\x12\ + \x04\xec\x01\x10\"\"\x0b\x20op_return\n\n\x13\n\x0b\x04\n\x03\0\x03\x02\ + \x04\0\x02\x03\x01\x12\x04\xec\x01\x10\x1d\n\x13\n\x0b\x04\n\x03\0\x03\ + \x02\x04\0\x02\x03\x02\x12\x04\xec\x01\x20!\n,\n\n\x04\n\x03\0\x03\x02\ + \x04\0\x02\x04\x12\x04\xed\x01\x10!\"\x18\x20only\x20for\x20change\x20ou\ + tput\n\n\x13\n\x0b\x04\n\x03\0\x03\x02\x04\0\x02\x04\x01\x12\x04\xed\x01\ + \x10\x1c\n\x13\n\x0b\x04\n\x03\0\x03\x02\x04\0\x02\x04\x02\x12\x04\xed\ + \x01\x1f\x20\n,\n\n\x04\n\x03\0\x03\x02\x04\0\x02\x05\x12\x04\xee\x01\ + \x10%\"\x18\x20only\x20for\x20change\x20output\n\n\x13\n\x0b\x04\n\x03\0\ + \x03\x02\x04\0\x02\x05\x01\x12\x04\xee\x01\x10\x20\n\x13\n\x0b\x04\n\x03\ + \0\x03\x02\x04\0\x02\x05\x02\x12\x04\xee\x01#$\ +"; + +static mut file_descriptor_proto_lazy: ::protobuf::lazy::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::descriptor::FileDescriptorProto, +}; + +fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto { + ::protobuf::parse_from_bytes(file_descriptor_proto_data).unwrap() +} + +pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { + unsafe { + file_descriptor_proto_lazy.get(|| { + parse_descriptor_proto() + }) + } +} diff --git a/src/protos/messages_bootloader.rs b/src/protos/messages_bootloader.rs new file mode 100644 index 0000000..7539703 --- /dev/null +++ b/src/protos/messages_bootloader.rs @@ -0,0 +1,850 @@ +// This file is generated by rust-protobuf 2.0.4. Do not edit +// @generated + +// https://github.com/Manishearth/rust-clippy/issues/702 +#![allow(unknown_lints)] +#![allow(clippy)] + +#![cfg_attr(rustfmt, rustfmt_skip)] + +#![allow(box_pointers)] +#![allow(dead_code)] +#![allow(missing_docs)] +#![allow(non_camel_case_types)] +#![allow(non_snake_case)] +#![allow(non_upper_case_globals)] +#![allow(trivial_casts)] +#![allow(unsafe_code)] +#![allow(unused_imports)] +#![allow(unused_results)] + +use protobuf::Message as Message_imported_for_functions; +use protobuf::ProtobufEnum as ProtobufEnum_imported_for_functions; + +#[derive(PartialEq,Clone,Default)] +pub struct FirmwareErase { + // message fields + length: ::std::option::Option, + // special fields + unknown_fields: ::protobuf::UnknownFields, + cached_size: ::protobuf::CachedSize, +} + +impl FirmwareErase { + pub fn new() -> FirmwareErase { + ::std::default::Default::default() + } + + // optional uint32 length = 1; + + pub fn clear_length(&mut self) { + self.length = ::std::option::Option::None; + } + + pub fn has_length(&self) -> bool { + self.length.is_some() + } + + // Param is passed by value, moved + pub fn set_length(&mut self, v: u32) { + self.length = ::std::option::Option::Some(v); + } + + pub fn get_length(&self) -> u32 { + self.length.unwrap_or(0) + } +} + +impl ::protobuf::Message for FirmwareErase { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_uint32()?; + self.length = ::std::option::Option::Some(tmp); + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if let Some(v) = self.length { + my_size += ::protobuf::rt::value_size(1, v, ::protobuf::wire_format::WireTypeVarint); + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + if let Some(v) = self.length { + os.write_uint32(1, v)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &::std::any::Any { + self as &::std::any::Any + } + fn as_any_mut(&mut self) -> &mut ::std::any::Any { + self as &mut ::std::any::Any + } + fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> FirmwareErase { + FirmwareErase::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( + "length", + |m: &FirmwareErase| { &m.length }, + |m: &mut FirmwareErase| { &mut m.length }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "FirmwareErase", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static FirmwareErase { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const FirmwareErase, + }; + unsafe { + instance.get(FirmwareErase::new) + } + } +} + +impl ::protobuf::Clear for FirmwareErase { + fn clear(&mut self) { + self.clear_length(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for FirmwareErase { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for FirmwareErase { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct FirmwareRequest { + // message fields + offset: ::std::option::Option, + length: ::std::option::Option, + // special fields + unknown_fields: ::protobuf::UnknownFields, + cached_size: ::protobuf::CachedSize, +} + +impl FirmwareRequest { + pub fn new() -> FirmwareRequest { + ::std::default::Default::default() + } + + // optional uint32 offset = 1; + + pub fn clear_offset(&mut self) { + self.offset = ::std::option::Option::None; + } + + pub fn has_offset(&self) -> bool { + self.offset.is_some() + } + + // Param is passed by value, moved + pub fn set_offset(&mut self, v: u32) { + self.offset = ::std::option::Option::Some(v); + } + + pub fn get_offset(&self) -> u32 { + self.offset.unwrap_or(0) + } + + // optional uint32 length = 2; + + pub fn clear_length(&mut self) { + self.length = ::std::option::Option::None; + } + + pub fn has_length(&self) -> bool { + self.length.is_some() + } + + // Param is passed by value, moved + pub fn set_length(&mut self, v: u32) { + self.length = ::std::option::Option::Some(v); + } + + pub fn get_length(&self) -> u32 { + self.length.unwrap_or(0) + } +} + +impl ::protobuf::Message for FirmwareRequest { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_uint32()?; + self.offset = ::std::option::Option::Some(tmp); + }, + 2 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_uint32()?; + self.length = ::std::option::Option::Some(tmp); + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if let Some(v) = self.offset { + my_size += ::protobuf::rt::value_size(1, v, ::protobuf::wire_format::WireTypeVarint); + } + if let Some(v) = self.length { + my_size += ::protobuf::rt::value_size(2, v, ::protobuf::wire_format::WireTypeVarint); + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + if let Some(v) = self.offset { + os.write_uint32(1, v)?; + } + if let Some(v) = self.length { + os.write_uint32(2, v)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &::std::any::Any { + self as &::std::any::Any + } + fn as_any_mut(&mut self) -> &mut ::std::any::Any { + self as &mut ::std::any::Any + } + fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> FirmwareRequest { + FirmwareRequest::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( + "offset", + |m: &FirmwareRequest| { &m.offset }, + |m: &mut FirmwareRequest| { &mut m.offset }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( + "length", + |m: &FirmwareRequest| { &m.length }, + |m: &mut FirmwareRequest| { &mut m.length }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "FirmwareRequest", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static FirmwareRequest { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const FirmwareRequest, + }; + unsafe { + instance.get(FirmwareRequest::new) + } + } +} + +impl ::protobuf::Clear for FirmwareRequest { + fn clear(&mut self) { + self.clear_offset(); + self.clear_length(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for FirmwareRequest { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for FirmwareRequest { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct FirmwareUpload { + // message fields + payload: ::protobuf::SingularField<::std::vec::Vec>, + hash: ::protobuf::SingularField<::std::vec::Vec>, + // special fields + unknown_fields: ::protobuf::UnknownFields, + cached_size: ::protobuf::CachedSize, +} + +impl FirmwareUpload { + pub fn new() -> FirmwareUpload { + ::std::default::Default::default() + } + + // required bytes payload = 1; + + pub fn clear_payload(&mut self) { + self.payload.clear(); + } + + pub fn has_payload(&self) -> bool { + self.payload.is_some() + } + + // Param is passed by value, moved + pub fn set_payload(&mut self, v: ::std::vec::Vec) { + self.payload = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_payload(&mut self) -> &mut ::std::vec::Vec { + if self.payload.is_none() { + self.payload.set_default(); + } + self.payload.as_mut().unwrap() + } + + // Take field + pub fn take_payload(&mut self) -> ::std::vec::Vec { + self.payload.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + pub fn get_payload(&self) -> &[u8] { + match self.payload.as_ref() { + Some(v) => &v, + None => &[], + } + } + + // optional bytes hash = 2; + + pub fn clear_hash(&mut self) { + self.hash.clear(); + } + + pub fn has_hash(&self) -> bool { + self.hash.is_some() + } + + // Param is passed by value, moved + pub fn set_hash(&mut self, v: ::std::vec::Vec) { + self.hash = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_hash(&mut self) -> &mut ::std::vec::Vec { + if self.hash.is_none() { + self.hash.set_default(); + } + self.hash.as_mut().unwrap() + } + + // Take field + pub fn take_hash(&mut self) -> ::std::vec::Vec { + self.hash.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + pub fn get_hash(&self) -> &[u8] { + match self.hash.as_ref() { + Some(v) => &v, + None => &[], + } + } +} + +impl ::protobuf::Message for FirmwareUpload { + fn is_initialized(&self) -> bool { + if self.payload.is_none() { + return false; + } + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.payload)?; + }, + 2 => { + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.hash)?; + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if let Some(ref v) = self.payload.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &v); + } + if let Some(ref v) = self.hash.as_ref() { + my_size += ::protobuf::rt::bytes_size(2, &v); + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + if let Some(ref v) = self.payload.as_ref() { + os.write_bytes(1, &v)?; + } + if let Some(ref v) = self.hash.as_ref() { + os.write_bytes(2, &v)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &::std::any::Any { + self as &::std::any::Any + } + fn as_any_mut(&mut self) -> &mut ::std::any::Any { + self as &mut ::std::any::Any + } + fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> FirmwareUpload { + FirmwareUpload::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "payload", + |m: &FirmwareUpload| { &m.payload }, + |m: &mut FirmwareUpload| { &mut m.payload }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "hash", + |m: &FirmwareUpload| { &m.hash }, + |m: &mut FirmwareUpload| { &mut m.hash }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "FirmwareUpload", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static FirmwareUpload { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const FirmwareUpload, + }; + unsafe { + instance.get(FirmwareUpload::new) + } + } +} + +impl ::protobuf::Clear for FirmwareUpload { + fn clear(&mut self) { + self.clear_payload(); + self.clear_hash(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for FirmwareUpload { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for FirmwareUpload { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct SelfTest { + // message fields + payload: ::protobuf::SingularField<::std::vec::Vec>, + // special fields + unknown_fields: ::protobuf::UnknownFields, + cached_size: ::protobuf::CachedSize, +} + +impl SelfTest { + pub fn new() -> SelfTest { + ::std::default::Default::default() + } + + // optional bytes payload = 1; + + pub fn clear_payload(&mut self) { + self.payload.clear(); + } + + pub fn has_payload(&self) -> bool { + self.payload.is_some() + } + + // Param is passed by value, moved + pub fn set_payload(&mut self, v: ::std::vec::Vec) { + self.payload = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_payload(&mut self) -> &mut ::std::vec::Vec { + if self.payload.is_none() { + self.payload.set_default(); + } + self.payload.as_mut().unwrap() + } + + // Take field + pub fn take_payload(&mut self) -> ::std::vec::Vec { + self.payload.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + pub fn get_payload(&self) -> &[u8] { + match self.payload.as_ref() { + Some(v) => &v, + None => &[], + } + } +} + +impl ::protobuf::Message for SelfTest { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.payload)?; + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if let Some(ref v) = self.payload.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &v); + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + if let Some(ref v) = self.payload.as_ref() { + os.write_bytes(1, &v)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &::std::any::Any { + self as &::std::any::Any + } + fn as_any_mut(&mut self) -> &mut ::std::any::Any { + self as &mut ::std::any::Any + } + fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> SelfTest { + SelfTest::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "payload", + |m: &SelfTest| { &m.payload }, + |m: &mut SelfTest| { &mut m.payload }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "SelfTest", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static SelfTest { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const SelfTest, + }; + unsafe { + instance.get(SelfTest::new) + } + } +} + +impl ::protobuf::Clear for SelfTest { + fn clear(&mut self) { + self.clear_payload(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for SelfTest { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for SelfTest { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +static file_descriptor_proto_data: &'static [u8] = b"\ + \n\x19messages-bootloader.proto\x12\x1dhw.trezor.messages.bootloader\"'\ + \n\rFirmwareErase\x12\x16\n\x06length\x18\x01\x20\x01(\rR\x06length\"A\n\ + \x0fFirmwareRequest\x12\x16\n\x06offset\x18\x01\x20\x01(\rR\x06offset\ + \x12\x16\n\x06length\x18\x02\x20\x01(\rR\x06length\">\n\x0eFirmwareUploa\ + d\x12\x18\n\x07payload\x18\x01\x20\x02(\x0cR\x07payload\x12\x12\n\x04has\ + h\x18\x02\x20\x01(\x0cR\x04hash\"$\n\x08SelfTest\x12\x18\n\x07payload\ + \x18\x01\x20\x01(\x0cR\x07payloadB>\n#com.satoshilabs.trezor.lib.protobu\ + fB\x17TrezorMessageBootloaderJ\x99\t\n\x06\x12\x04\0\0+\x01\n\x08\n\x01\ + \x0c\x12\x03\0\0\x12\n\x08\n\x01\x02\x12\x03\x01\x08%\n\x08\n\x01\x08\ + \x12\x03\x04\0<\n.\n\x02\x08\x01\x12\x03\x04\0<\x1a#\x20Sugar\x20for\x20\ + easier\x20handling\x20in\x20Java\n\n\x08\n\x01\x08\x12\x03\x05\08\n\t\n\ + \x02\x08\x08\x12\x03\x05\08\n\x83\x01\n\x02\x04\0\x12\x04\x0c\0\x0e\x01\ + \x1aw*\n\x20Request:\x20Ask\x20device\x20to\x20erase\x20its\x20firmware\ + \x20(so\x20it\x20can\x20be\x20replaced\x20via\x20FirmwareUpload)\n\x20@s\ + tart\n\x20@next\x20FirmwareRequest\n\n\n\n\x03\x04\0\x01\x12\x03\x0c\x08\ + \x15\n%\n\x04\x04\0\x02\0\x12\x03\r\x04\x1f\"\x18\x20length\x20of\x20new\ + \x20firmware\n\n\x0c\n\x05\x04\0\x02\0\x04\x12\x03\r\x04\x0c\n\x0c\n\x05\ + \x04\0\x02\0\x05\x12\x03\r\r\x13\n\x0c\n\x05\x04\0\x02\0\x01\x12\x03\r\ + \x14\x1a\n\x0c\n\x05\x04\0\x02\0\x03\x12\x03\r\x1d\x1e\nF\n\x02\x04\x01\ + \x12\x04\x14\0\x17\x01\x1a:*\n\x20Response:\x20Ask\x20for\x20firmware\ + \x20chunk\n\x20@next\x20FirmwareUpload\n\n\n\n\x03\x04\x01\x01\x12\x03\ + \x14\x08\x17\n1\n\x04\x04\x01\x02\0\x12\x03\x15\x04\x1f\"$\x20offset\x20\ + of\x20requested\x20firmware\x20chunk\n\n\x0c\n\x05\x04\x01\x02\0\x04\x12\ + \x03\x15\x04\x0c\n\x0c\n\x05\x04\x01\x02\0\x05\x12\x03\x15\r\x13\n\x0c\n\ + \x05\x04\x01\x02\0\x01\x12\x03\x15\x14\x1a\n\x0c\n\x05\x04\x01\x02\0\x03\ + \x12\x03\x15\x1d\x1e\n1\n\x04\x04\x01\x02\x01\x12\x03\x16\x04\x1f\"$\x20\ + length\x20of\x20requested\x20firmware\x20chunk\n\n\x0c\n\x05\x04\x01\x02\ + \x01\x04\x12\x03\x16\x04\x0c\n\x0c\n\x05\x04\x01\x02\x01\x05\x12\x03\x16\ + \r\x13\n\x0c\n\x05\x04\x01\x02\x01\x01\x12\x03\x16\x14\x1a\n\x0c\n\x05\ + \x04\x01\x02\x01\x03\x12\x03\x16\x1d\x1e\nx\n\x02\x04\x02\x12\x04\x1f\0\ + \"\x01\x1al*\n\x20Request:\x20Send\x20firmware\x20in\x20binary\x20form\ + \x20to\x20the\x20device\n\x20@next\x20FirmwareRequest\n\x20@next\x20Succ\ + ess\n\x20@next\x20Failure\n\n\n\n\x03\x04\x02\x01\x12\x03\x1f\x08\x16\n0\ + \n\x04\x04\x02\x02\0\x12\x03\x20\x04\x1f\"#\x20firmware\x20to\x20be\x20l\ + oaded\x20into\x20device\n\n\x0c\n\x05\x04\x02\x02\0\x04\x12\x03\x20\x04\ + \x0c\n\x0c\n\x05\x04\x02\x02\0\x05\x12\x03\x20\r\x12\n\x0c\n\x05\x04\x02\ + \x02\0\x01\x12\x03\x20\x13\x1a\n\x0c\n\x05\x04\x02\x02\0\x03\x12\x03\x20\ + \x1d\x1e\n\"\n\x04\x04\x02\x02\x01\x12\x03!\x04\x1c\"\x15\x20hash\x20of\ + \x20the\x20payload\n\n\x0c\n\x05\x04\x02\x02\x01\x04\x12\x03!\x04\x0c\n\ + \x0c\n\x05\x04\x02\x02\x01\x05\x12\x03!\r\x12\n\x0c\n\x05\x04\x02\x02\ + \x01\x01\x12\x03!\x13\x17\n\x0c\n\x05\x04\x02\x02\x01\x03\x12\x03!\x1a\ + \x1b\nQ\n\x02\x04\x03\x12\x04)\0+\x01\x1aE*\n\x20Request:\x20Perform\x20\ + a\x20device\x20self-test\n\x20@next\x20Success\n\x20@next\x20Failure\n\n\ + \n\n\x03\x04\x03\x01\x12\x03)\x08\x10\n.\n\x04\x04\x03\x02\0\x12\x03*\ + \x04\x1f\"!\x20payload\x20to\x20be\x20used\x20in\x20self-test\n\n\x0c\n\ + \x05\x04\x03\x02\0\x04\x12\x03*\x04\x0c\n\x0c\n\x05\x04\x03\x02\0\x05\ + \x12\x03*\r\x12\n\x0c\n\x05\x04\x03\x02\0\x01\x12\x03*\x13\x1a\n\x0c\n\ + \x05\x04\x03\x02\0\x03\x12\x03*\x1d\x1e\ +"; + +static mut file_descriptor_proto_lazy: ::protobuf::lazy::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::descriptor::FileDescriptorProto, +}; + +fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto { + ::protobuf::parse_from_bytes(file_descriptor_proto_data).unwrap() +} + +pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { + unsafe { + file_descriptor_proto_lazy.get(|| { + parse_descriptor_proto() + }) + } +} diff --git a/src/protos/messages_common.rs b/src/protos/messages_common.rs new file mode 100644 index 0000000..705a0a7 --- /dev/null +++ b/src/protos/messages_common.rs @@ -0,0 +1,2596 @@ +// This file is generated by rust-protobuf 2.0.4. Do not edit +// @generated + +// https://github.com/Manishearth/rust-clippy/issues/702 +#![allow(unknown_lints)] +#![allow(clippy)] + +#![cfg_attr(rustfmt, rustfmt_skip)] + +#![allow(box_pointers)] +#![allow(dead_code)] +#![allow(missing_docs)] +#![allow(non_camel_case_types)] +#![allow(non_snake_case)] +#![allow(non_upper_case_globals)] +#![allow(trivial_casts)] +#![allow(unsafe_code)] +#![allow(unused_imports)] +#![allow(unused_results)] + +use protobuf::Message as Message_imported_for_functions; +use protobuf::ProtobufEnum as ProtobufEnum_imported_for_functions; + +#[derive(PartialEq,Clone,Default)] +pub struct Success { + // message fields + message: ::protobuf::SingularField<::std::string::String>, + // special fields + unknown_fields: ::protobuf::UnknownFields, + cached_size: ::protobuf::CachedSize, +} + +impl Success { + pub fn new() -> Success { + ::std::default::Default::default() + } + + // optional string message = 1; + + pub fn clear_message(&mut self) { + self.message.clear(); + } + + pub fn has_message(&self) -> bool { + self.message.is_some() + } + + // Param is passed by value, moved + pub fn set_message(&mut self, v: ::std::string::String) { + self.message = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_message(&mut self) -> &mut ::std::string::String { + if self.message.is_none() { + self.message.set_default(); + } + self.message.as_mut().unwrap() + } + + // Take field + pub fn take_message(&mut self) -> ::std::string::String { + self.message.take().unwrap_or_else(|| ::std::string::String::new()) + } + + pub fn get_message(&self) -> &str { + match self.message.as_ref() { + Some(v) => &v, + None => "", + } + } +} + +impl ::protobuf::Message for Success { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.message)?; + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if let Some(ref v) = self.message.as_ref() { + my_size += ::protobuf::rt::string_size(1, &v); + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + if let Some(ref v) = self.message.as_ref() { + os.write_string(1, &v)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &::std::any::Any { + self as &::std::any::Any + } + fn as_any_mut(&mut self) -> &mut ::std::any::Any { + self as &mut ::std::any::Any + } + fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> Success { + Success::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "message", + |m: &Success| { &m.message }, + |m: &mut Success| { &mut m.message }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "Success", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static Success { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const Success, + }; + unsafe { + instance.get(Success::new) + } + } +} + +impl ::protobuf::Clear for Success { + fn clear(&mut self) { + self.clear_message(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for Success { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for Success { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct Failure { + // message fields + code: ::std::option::Option, + message: ::protobuf::SingularField<::std::string::String>, + // special fields + unknown_fields: ::protobuf::UnknownFields, + cached_size: ::protobuf::CachedSize, +} + +impl Failure { + pub fn new() -> Failure { + ::std::default::Default::default() + } + + // optional .hw.trezor.messages.common.Failure.FailureType code = 1; + + pub fn clear_code(&mut self) { + self.code = ::std::option::Option::None; + } + + pub fn has_code(&self) -> bool { + self.code.is_some() + } + + // Param is passed by value, moved + pub fn set_code(&mut self, v: Failure_FailureType) { + self.code = ::std::option::Option::Some(v); + } + + pub fn get_code(&self) -> Failure_FailureType { + self.code.unwrap_or(Failure_FailureType::Failure_UnexpectedMessage) + } + + // optional string message = 2; + + pub fn clear_message(&mut self) { + self.message.clear(); + } + + pub fn has_message(&self) -> bool { + self.message.is_some() + } + + // Param is passed by value, moved + pub fn set_message(&mut self, v: ::std::string::String) { + self.message = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_message(&mut self) -> &mut ::std::string::String { + if self.message.is_none() { + self.message.set_default(); + } + self.message.as_mut().unwrap() + } + + // Take field + pub fn take_message(&mut self) -> ::std::string::String { + self.message.take().unwrap_or_else(|| ::std::string::String::new()) + } + + pub fn get_message(&self) -> &str { + match self.message.as_ref() { + Some(v) => &v, + None => "", + } + } +} + +impl ::protobuf::Message for Failure { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_proto2_enum_with_unknown_fields_into(wire_type, is, &mut self.code, 1, &mut self.unknown_fields)? + }, + 2 => { + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.message)?; + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if let Some(v) = self.code { + my_size += ::protobuf::rt::enum_size(1, v); + } + if let Some(ref v) = self.message.as_ref() { + my_size += ::protobuf::rt::string_size(2, &v); + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + if let Some(v) = self.code { + os.write_enum(1, v.value())?; + } + if let Some(ref v) = self.message.as_ref() { + os.write_string(2, &v)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &::std::any::Any { + self as &::std::any::Any + } + fn as_any_mut(&mut self) -> &mut ::std::any::Any { + self as &mut ::std::any::Any + } + fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> Failure { + Failure::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( + "code", + |m: &Failure| { &m.code }, + |m: &mut Failure| { &mut m.code }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "message", + |m: &Failure| { &m.message }, + |m: &mut Failure| { &mut m.message }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "Failure", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static Failure { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const Failure, + }; + unsafe { + instance.get(Failure::new) + } + } +} + +impl ::protobuf::Clear for Failure { + fn clear(&mut self) { + self.clear_code(); + self.clear_message(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for Failure { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for Failure { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(Clone,PartialEq,Eq,Debug,Hash)] +pub enum Failure_FailureType { + Failure_UnexpectedMessage = 1, + Failure_ButtonExpected = 2, + Failure_DataError = 3, + Failure_ActionCancelled = 4, + Failure_PinExpected = 5, + Failure_PinCancelled = 6, + Failure_PinInvalid = 7, + Failure_InvalidSignature = 8, + Failure_ProcessError = 9, + Failure_NotEnoughFunds = 10, + Failure_NotInitialized = 11, + Failure_PinMismatch = 12, + Failure_FirmwareError = 99, +} + +impl ::protobuf::ProtobufEnum for Failure_FailureType { + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 1 => ::std::option::Option::Some(Failure_FailureType::Failure_UnexpectedMessage), + 2 => ::std::option::Option::Some(Failure_FailureType::Failure_ButtonExpected), + 3 => ::std::option::Option::Some(Failure_FailureType::Failure_DataError), + 4 => ::std::option::Option::Some(Failure_FailureType::Failure_ActionCancelled), + 5 => ::std::option::Option::Some(Failure_FailureType::Failure_PinExpected), + 6 => ::std::option::Option::Some(Failure_FailureType::Failure_PinCancelled), + 7 => ::std::option::Option::Some(Failure_FailureType::Failure_PinInvalid), + 8 => ::std::option::Option::Some(Failure_FailureType::Failure_InvalidSignature), + 9 => ::std::option::Option::Some(Failure_FailureType::Failure_ProcessError), + 10 => ::std::option::Option::Some(Failure_FailureType::Failure_NotEnoughFunds), + 11 => ::std::option::Option::Some(Failure_FailureType::Failure_NotInitialized), + 12 => ::std::option::Option::Some(Failure_FailureType::Failure_PinMismatch), + 99 => ::std::option::Option::Some(Failure_FailureType::Failure_FirmwareError), + _ => ::std::option::Option::None + } + } + + fn values() -> &'static [Self] { + static values: &'static [Failure_FailureType] = &[ + Failure_FailureType::Failure_UnexpectedMessage, + Failure_FailureType::Failure_ButtonExpected, + Failure_FailureType::Failure_DataError, + Failure_FailureType::Failure_ActionCancelled, + Failure_FailureType::Failure_PinExpected, + Failure_FailureType::Failure_PinCancelled, + Failure_FailureType::Failure_PinInvalid, + Failure_FailureType::Failure_InvalidSignature, + Failure_FailureType::Failure_ProcessError, + Failure_FailureType::Failure_NotEnoughFunds, + Failure_FailureType::Failure_NotInitialized, + Failure_FailureType::Failure_PinMismatch, + Failure_FailureType::Failure_FirmwareError, + ]; + values + } + + fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::EnumDescriptor, + }; + unsafe { + descriptor.get(|| { + ::protobuf::reflect::EnumDescriptor::new("Failure_FailureType", file_descriptor_proto()) + }) + } + } +} + +impl ::std::marker::Copy for Failure_FailureType { +} + +impl ::protobuf::reflect::ProtobufValue for Failure_FailureType { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct ButtonRequest { + // message fields + code: ::std::option::Option, + data: ::protobuf::SingularField<::std::string::String>, + // special fields + unknown_fields: ::protobuf::UnknownFields, + cached_size: ::protobuf::CachedSize, +} + +impl ButtonRequest { + pub fn new() -> ButtonRequest { + ::std::default::Default::default() + } + + // optional .hw.trezor.messages.common.ButtonRequest.ButtonRequestType code = 1; + + pub fn clear_code(&mut self) { + self.code = ::std::option::Option::None; + } + + pub fn has_code(&self) -> bool { + self.code.is_some() + } + + // Param is passed by value, moved + pub fn set_code(&mut self, v: ButtonRequest_ButtonRequestType) { + self.code = ::std::option::Option::Some(v); + } + + pub fn get_code(&self) -> ButtonRequest_ButtonRequestType { + self.code.unwrap_or(ButtonRequest_ButtonRequestType::ButtonRequest_Other) + } + + // optional string data = 2; + + pub fn clear_data(&mut self) { + self.data.clear(); + } + + pub fn has_data(&self) -> bool { + self.data.is_some() + } + + // Param is passed by value, moved + pub fn set_data(&mut self, v: ::std::string::String) { + self.data = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_data(&mut self) -> &mut ::std::string::String { + if self.data.is_none() { + self.data.set_default(); + } + self.data.as_mut().unwrap() + } + + // Take field + pub fn take_data(&mut self) -> ::std::string::String { + self.data.take().unwrap_or_else(|| ::std::string::String::new()) + } + + pub fn get_data(&self) -> &str { + match self.data.as_ref() { + Some(v) => &v, + None => "", + } + } +} + +impl ::protobuf::Message for ButtonRequest { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_proto2_enum_with_unknown_fields_into(wire_type, is, &mut self.code, 1, &mut self.unknown_fields)? + }, + 2 => { + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.data)?; + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if let Some(v) = self.code { + my_size += ::protobuf::rt::enum_size(1, v); + } + if let Some(ref v) = self.data.as_ref() { + my_size += ::protobuf::rt::string_size(2, &v); + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + if let Some(v) = self.code { + os.write_enum(1, v.value())?; + } + if let Some(ref v) = self.data.as_ref() { + os.write_string(2, &v)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &::std::any::Any { + self as &::std::any::Any + } + fn as_any_mut(&mut self) -> &mut ::std::any::Any { + self as &mut ::std::any::Any + } + fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> ButtonRequest { + ButtonRequest::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( + "code", + |m: &ButtonRequest| { &m.code }, + |m: &mut ButtonRequest| { &mut m.code }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "data", + |m: &ButtonRequest| { &m.data }, + |m: &mut ButtonRequest| { &mut m.data }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "ButtonRequest", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static ButtonRequest { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ButtonRequest, + }; + unsafe { + instance.get(ButtonRequest::new) + } + } +} + +impl ::protobuf::Clear for ButtonRequest { + fn clear(&mut self) { + self.clear_code(); + self.clear_data(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for ButtonRequest { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for ButtonRequest { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(Clone,PartialEq,Eq,Debug,Hash)] +pub enum ButtonRequest_ButtonRequestType { + ButtonRequest_Other = 1, + ButtonRequest_FeeOverThreshold = 2, + ButtonRequest_ConfirmOutput = 3, + ButtonRequest_ResetDevice = 4, + ButtonRequest_ConfirmWord = 5, + ButtonRequest_WipeDevice = 6, + ButtonRequest_ProtectCall = 7, + ButtonRequest_SignTx = 8, + ButtonRequest_FirmwareCheck = 9, + ButtonRequest_Address = 10, + ButtonRequest_PublicKey = 11, + ButtonRequest_MnemonicWordCount = 12, + ButtonRequest_MnemonicInput = 13, + ButtonRequest_PassphraseType = 14, + ButtonRequest_UnknownDerivationPath = 15, +} + +impl ::protobuf::ProtobufEnum for ButtonRequest_ButtonRequestType { + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 1 => ::std::option::Option::Some(ButtonRequest_ButtonRequestType::ButtonRequest_Other), + 2 => ::std::option::Option::Some(ButtonRequest_ButtonRequestType::ButtonRequest_FeeOverThreshold), + 3 => ::std::option::Option::Some(ButtonRequest_ButtonRequestType::ButtonRequest_ConfirmOutput), + 4 => ::std::option::Option::Some(ButtonRequest_ButtonRequestType::ButtonRequest_ResetDevice), + 5 => ::std::option::Option::Some(ButtonRequest_ButtonRequestType::ButtonRequest_ConfirmWord), + 6 => ::std::option::Option::Some(ButtonRequest_ButtonRequestType::ButtonRequest_WipeDevice), + 7 => ::std::option::Option::Some(ButtonRequest_ButtonRequestType::ButtonRequest_ProtectCall), + 8 => ::std::option::Option::Some(ButtonRequest_ButtonRequestType::ButtonRequest_SignTx), + 9 => ::std::option::Option::Some(ButtonRequest_ButtonRequestType::ButtonRequest_FirmwareCheck), + 10 => ::std::option::Option::Some(ButtonRequest_ButtonRequestType::ButtonRequest_Address), + 11 => ::std::option::Option::Some(ButtonRequest_ButtonRequestType::ButtonRequest_PublicKey), + 12 => ::std::option::Option::Some(ButtonRequest_ButtonRequestType::ButtonRequest_MnemonicWordCount), + 13 => ::std::option::Option::Some(ButtonRequest_ButtonRequestType::ButtonRequest_MnemonicInput), + 14 => ::std::option::Option::Some(ButtonRequest_ButtonRequestType::ButtonRequest_PassphraseType), + 15 => ::std::option::Option::Some(ButtonRequest_ButtonRequestType::ButtonRequest_UnknownDerivationPath), + _ => ::std::option::Option::None + } + } + + fn values() -> &'static [Self] { + static values: &'static [ButtonRequest_ButtonRequestType] = &[ + ButtonRequest_ButtonRequestType::ButtonRequest_Other, + ButtonRequest_ButtonRequestType::ButtonRequest_FeeOverThreshold, + ButtonRequest_ButtonRequestType::ButtonRequest_ConfirmOutput, + ButtonRequest_ButtonRequestType::ButtonRequest_ResetDevice, + ButtonRequest_ButtonRequestType::ButtonRequest_ConfirmWord, + ButtonRequest_ButtonRequestType::ButtonRequest_WipeDevice, + ButtonRequest_ButtonRequestType::ButtonRequest_ProtectCall, + ButtonRequest_ButtonRequestType::ButtonRequest_SignTx, + ButtonRequest_ButtonRequestType::ButtonRequest_FirmwareCheck, + ButtonRequest_ButtonRequestType::ButtonRequest_Address, + ButtonRequest_ButtonRequestType::ButtonRequest_PublicKey, + ButtonRequest_ButtonRequestType::ButtonRequest_MnemonicWordCount, + ButtonRequest_ButtonRequestType::ButtonRequest_MnemonicInput, + ButtonRequest_ButtonRequestType::ButtonRequest_PassphraseType, + ButtonRequest_ButtonRequestType::ButtonRequest_UnknownDerivationPath, + ]; + values + } + + fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::EnumDescriptor, + }; + unsafe { + descriptor.get(|| { + ::protobuf::reflect::EnumDescriptor::new("ButtonRequest_ButtonRequestType", file_descriptor_proto()) + }) + } + } +} + +impl ::std::marker::Copy for ButtonRequest_ButtonRequestType { +} + +impl ::protobuf::reflect::ProtobufValue for ButtonRequest_ButtonRequestType { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct ButtonAck { + // special fields + unknown_fields: ::protobuf::UnknownFields, + cached_size: ::protobuf::CachedSize, +} + +impl ButtonAck { + pub fn new() -> ButtonAck { + ::std::default::Default::default() + } +} + +impl ::protobuf::Message for ButtonAck { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &::std::any::Any { + self as &::std::any::Any + } + fn as_any_mut(&mut self) -> &mut ::std::any::Any { + self as &mut ::std::any::Any + } + fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> ButtonAck { + ButtonAck::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let fields = ::std::vec::Vec::new(); + ::protobuf::reflect::MessageDescriptor::new::( + "ButtonAck", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static ButtonAck { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ButtonAck, + }; + unsafe { + instance.get(ButtonAck::new) + } + } +} + +impl ::protobuf::Clear for ButtonAck { + fn clear(&mut self) { + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for ButtonAck { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for ButtonAck { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct PinMatrixRequest { + // message fields + field_type: ::std::option::Option, + // special fields + unknown_fields: ::protobuf::UnknownFields, + cached_size: ::protobuf::CachedSize, +} + +impl PinMatrixRequest { + pub fn new() -> PinMatrixRequest { + ::std::default::Default::default() + } + + // optional .hw.trezor.messages.common.PinMatrixRequest.PinMatrixRequestType type = 1; + + pub fn clear_field_type(&mut self) { + self.field_type = ::std::option::Option::None; + } + + pub fn has_field_type(&self) -> bool { + self.field_type.is_some() + } + + // Param is passed by value, moved + pub fn set_field_type(&mut self, v: PinMatrixRequest_PinMatrixRequestType) { + self.field_type = ::std::option::Option::Some(v); + } + + pub fn get_field_type(&self) -> PinMatrixRequest_PinMatrixRequestType { + self.field_type.unwrap_or(PinMatrixRequest_PinMatrixRequestType::PinMatrixRequestType_Current) + } +} + +impl ::protobuf::Message for PinMatrixRequest { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_proto2_enum_with_unknown_fields_into(wire_type, is, &mut self.field_type, 1, &mut self.unknown_fields)? + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if let Some(v) = self.field_type { + my_size += ::protobuf::rt::enum_size(1, v); + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + if let Some(v) = self.field_type { + os.write_enum(1, v.value())?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &::std::any::Any { + self as &::std::any::Any + } + fn as_any_mut(&mut self) -> &mut ::std::any::Any { + self as &mut ::std::any::Any + } + fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> PinMatrixRequest { + PinMatrixRequest::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( + "type", + |m: &PinMatrixRequest| { &m.field_type }, + |m: &mut PinMatrixRequest| { &mut m.field_type }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "PinMatrixRequest", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static PinMatrixRequest { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const PinMatrixRequest, + }; + unsafe { + instance.get(PinMatrixRequest::new) + } + } +} + +impl ::protobuf::Clear for PinMatrixRequest { + fn clear(&mut self) { + self.clear_field_type(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for PinMatrixRequest { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for PinMatrixRequest { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(Clone,PartialEq,Eq,Debug,Hash)] +pub enum PinMatrixRequest_PinMatrixRequestType { + PinMatrixRequestType_Current = 1, + PinMatrixRequestType_NewFirst = 2, + PinMatrixRequestType_NewSecond = 3, +} + +impl ::protobuf::ProtobufEnum for PinMatrixRequest_PinMatrixRequestType { + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 1 => ::std::option::Option::Some(PinMatrixRequest_PinMatrixRequestType::PinMatrixRequestType_Current), + 2 => ::std::option::Option::Some(PinMatrixRequest_PinMatrixRequestType::PinMatrixRequestType_NewFirst), + 3 => ::std::option::Option::Some(PinMatrixRequest_PinMatrixRequestType::PinMatrixRequestType_NewSecond), + _ => ::std::option::Option::None + } + } + + fn values() -> &'static [Self] { + static values: &'static [PinMatrixRequest_PinMatrixRequestType] = &[ + PinMatrixRequest_PinMatrixRequestType::PinMatrixRequestType_Current, + PinMatrixRequest_PinMatrixRequestType::PinMatrixRequestType_NewFirst, + PinMatrixRequest_PinMatrixRequestType::PinMatrixRequestType_NewSecond, + ]; + values + } + + fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::EnumDescriptor, + }; + unsafe { + descriptor.get(|| { + ::protobuf::reflect::EnumDescriptor::new("PinMatrixRequest_PinMatrixRequestType", file_descriptor_proto()) + }) + } + } +} + +impl ::std::marker::Copy for PinMatrixRequest_PinMatrixRequestType { +} + +impl ::protobuf::reflect::ProtobufValue for PinMatrixRequest_PinMatrixRequestType { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct PinMatrixAck { + // message fields + pin: ::protobuf::SingularField<::std::string::String>, + // special fields + unknown_fields: ::protobuf::UnknownFields, + cached_size: ::protobuf::CachedSize, +} + +impl PinMatrixAck { + pub fn new() -> PinMatrixAck { + ::std::default::Default::default() + } + + // required string pin = 1; + + pub fn clear_pin(&mut self) { + self.pin.clear(); + } + + pub fn has_pin(&self) -> bool { + self.pin.is_some() + } + + // Param is passed by value, moved + pub fn set_pin(&mut self, v: ::std::string::String) { + self.pin = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_pin(&mut self) -> &mut ::std::string::String { + if self.pin.is_none() { + self.pin.set_default(); + } + self.pin.as_mut().unwrap() + } + + // Take field + pub fn take_pin(&mut self) -> ::std::string::String { + self.pin.take().unwrap_or_else(|| ::std::string::String::new()) + } + + pub fn get_pin(&self) -> &str { + match self.pin.as_ref() { + Some(v) => &v, + None => "", + } + } +} + +impl ::protobuf::Message for PinMatrixAck { + fn is_initialized(&self) -> bool { + if self.pin.is_none() { + return false; + } + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.pin)?; + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if let Some(ref v) = self.pin.as_ref() { + my_size += ::protobuf::rt::string_size(1, &v); + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + if let Some(ref v) = self.pin.as_ref() { + os.write_string(1, &v)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &::std::any::Any { + self as &::std::any::Any + } + fn as_any_mut(&mut self) -> &mut ::std::any::Any { + self as &mut ::std::any::Any + } + fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> PinMatrixAck { + PinMatrixAck::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "pin", + |m: &PinMatrixAck| { &m.pin }, + |m: &mut PinMatrixAck| { &mut m.pin }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "PinMatrixAck", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static PinMatrixAck { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const PinMatrixAck, + }; + unsafe { + instance.get(PinMatrixAck::new) + } + } +} + +impl ::protobuf::Clear for PinMatrixAck { + fn clear(&mut self) { + self.clear_pin(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for PinMatrixAck { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for PinMatrixAck { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct PassphraseRequest { + // message fields + on_device: ::std::option::Option, + // special fields + unknown_fields: ::protobuf::UnknownFields, + cached_size: ::protobuf::CachedSize, +} + +impl PassphraseRequest { + pub fn new() -> PassphraseRequest { + ::std::default::Default::default() + } + + // optional bool on_device = 1; + + pub fn clear_on_device(&mut self) { + self.on_device = ::std::option::Option::None; + } + + pub fn has_on_device(&self) -> bool { + self.on_device.is_some() + } + + // Param is passed by value, moved + pub fn set_on_device(&mut self, v: bool) { + self.on_device = ::std::option::Option::Some(v); + } + + pub fn get_on_device(&self) -> bool { + self.on_device.unwrap_or(false) + } +} + +impl ::protobuf::Message for PassphraseRequest { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_bool()?; + self.on_device = ::std::option::Option::Some(tmp); + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if let Some(v) = self.on_device { + my_size += 2; + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + if let Some(v) = self.on_device { + os.write_bool(1, v)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &::std::any::Any { + self as &::std::any::Any + } + fn as_any_mut(&mut self) -> &mut ::std::any::Any { + self as &mut ::std::any::Any + } + fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> PassphraseRequest { + PassphraseRequest::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "on_device", + |m: &PassphraseRequest| { &m.on_device }, + |m: &mut PassphraseRequest| { &mut m.on_device }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "PassphraseRequest", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static PassphraseRequest { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const PassphraseRequest, + }; + unsafe { + instance.get(PassphraseRequest::new) + } + } +} + +impl ::protobuf::Clear for PassphraseRequest { + fn clear(&mut self) { + self.clear_on_device(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for PassphraseRequest { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for PassphraseRequest { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct PassphraseAck { + // message fields + passphrase: ::protobuf::SingularField<::std::string::String>, + state: ::protobuf::SingularField<::std::vec::Vec>, + // special fields + unknown_fields: ::protobuf::UnknownFields, + cached_size: ::protobuf::CachedSize, +} + +impl PassphraseAck { + pub fn new() -> PassphraseAck { + ::std::default::Default::default() + } + + // optional string passphrase = 1; + + pub fn clear_passphrase(&mut self) { + self.passphrase.clear(); + } + + pub fn has_passphrase(&self) -> bool { + self.passphrase.is_some() + } + + // Param is passed by value, moved + pub fn set_passphrase(&mut self, v: ::std::string::String) { + self.passphrase = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_passphrase(&mut self) -> &mut ::std::string::String { + if self.passphrase.is_none() { + self.passphrase.set_default(); + } + self.passphrase.as_mut().unwrap() + } + + // Take field + pub fn take_passphrase(&mut self) -> ::std::string::String { + self.passphrase.take().unwrap_or_else(|| ::std::string::String::new()) + } + + pub fn get_passphrase(&self) -> &str { + match self.passphrase.as_ref() { + Some(v) => &v, + None => "", + } + } + + // optional bytes state = 2; + + pub fn clear_state(&mut self) { + self.state.clear(); + } + + pub fn has_state(&self) -> bool { + self.state.is_some() + } + + // Param is passed by value, moved + pub fn set_state(&mut self, v: ::std::vec::Vec) { + self.state = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_state(&mut self) -> &mut ::std::vec::Vec { + if self.state.is_none() { + self.state.set_default(); + } + self.state.as_mut().unwrap() + } + + // Take field + pub fn take_state(&mut self) -> ::std::vec::Vec { + self.state.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + pub fn get_state(&self) -> &[u8] { + match self.state.as_ref() { + Some(v) => &v, + None => &[], + } + } +} + +impl ::protobuf::Message for PassphraseAck { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.passphrase)?; + }, + 2 => { + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.state)?; + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if let Some(ref v) = self.passphrase.as_ref() { + my_size += ::protobuf::rt::string_size(1, &v); + } + if let Some(ref v) = self.state.as_ref() { + my_size += ::protobuf::rt::bytes_size(2, &v); + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + if let Some(ref v) = self.passphrase.as_ref() { + os.write_string(1, &v)?; + } + if let Some(ref v) = self.state.as_ref() { + os.write_bytes(2, &v)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &::std::any::Any { + self as &::std::any::Any + } + fn as_any_mut(&mut self) -> &mut ::std::any::Any { + self as &mut ::std::any::Any + } + fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> PassphraseAck { + PassphraseAck::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "passphrase", + |m: &PassphraseAck| { &m.passphrase }, + |m: &mut PassphraseAck| { &mut m.passphrase }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "state", + |m: &PassphraseAck| { &m.state }, + |m: &mut PassphraseAck| { &mut m.state }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "PassphraseAck", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static PassphraseAck { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const PassphraseAck, + }; + unsafe { + instance.get(PassphraseAck::new) + } + } +} + +impl ::protobuf::Clear for PassphraseAck { + fn clear(&mut self) { + self.clear_passphrase(); + self.clear_state(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for PassphraseAck { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for PassphraseAck { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct PassphraseStateRequest { + // message fields + state: ::protobuf::SingularField<::std::vec::Vec>, + // special fields + unknown_fields: ::protobuf::UnknownFields, + cached_size: ::protobuf::CachedSize, +} + +impl PassphraseStateRequest { + pub fn new() -> PassphraseStateRequest { + ::std::default::Default::default() + } + + // optional bytes state = 1; + + pub fn clear_state(&mut self) { + self.state.clear(); + } + + pub fn has_state(&self) -> bool { + self.state.is_some() + } + + // Param is passed by value, moved + pub fn set_state(&mut self, v: ::std::vec::Vec) { + self.state = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_state(&mut self) -> &mut ::std::vec::Vec { + if self.state.is_none() { + self.state.set_default(); + } + self.state.as_mut().unwrap() + } + + // Take field + pub fn take_state(&mut self) -> ::std::vec::Vec { + self.state.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + pub fn get_state(&self) -> &[u8] { + match self.state.as_ref() { + Some(v) => &v, + None => &[], + } + } +} + +impl ::protobuf::Message for PassphraseStateRequest { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.state)?; + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if let Some(ref v) = self.state.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &v); + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + if let Some(ref v) = self.state.as_ref() { + os.write_bytes(1, &v)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &::std::any::Any { + self as &::std::any::Any + } + fn as_any_mut(&mut self) -> &mut ::std::any::Any { + self as &mut ::std::any::Any + } + fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> PassphraseStateRequest { + PassphraseStateRequest::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "state", + |m: &PassphraseStateRequest| { &m.state }, + |m: &mut PassphraseStateRequest| { &mut m.state }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "PassphraseStateRequest", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static PassphraseStateRequest { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const PassphraseStateRequest, + }; + unsafe { + instance.get(PassphraseStateRequest::new) + } + } +} + +impl ::protobuf::Clear for PassphraseStateRequest { + fn clear(&mut self) { + self.clear_state(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for PassphraseStateRequest { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for PassphraseStateRequest { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct PassphraseStateAck { + // special fields + unknown_fields: ::protobuf::UnknownFields, + cached_size: ::protobuf::CachedSize, +} + +impl PassphraseStateAck { + pub fn new() -> PassphraseStateAck { + ::std::default::Default::default() + } +} + +impl ::protobuf::Message for PassphraseStateAck { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &::std::any::Any { + self as &::std::any::Any + } + fn as_any_mut(&mut self) -> &mut ::std::any::Any { + self as &mut ::std::any::Any + } + fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> PassphraseStateAck { + PassphraseStateAck::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let fields = ::std::vec::Vec::new(); + ::protobuf::reflect::MessageDescriptor::new::( + "PassphraseStateAck", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static PassphraseStateAck { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const PassphraseStateAck, + }; + unsafe { + instance.get(PassphraseStateAck::new) + } + } +} + +impl ::protobuf::Clear for PassphraseStateAck { + fn clear(&mut self) { + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for PassphraseStateAck { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for PassphraseStateAck { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct HDNodeType { + // message fields + depth: ::std::option::Option, + fingerprint: ::std::option::Option, + child_num: ::std::option::Option, + chain_code: ::protobuf::SingularField<::std::vec::Vec>, + private_key: ::protobuf::SingularField<::std::vec::Vec>, + public_key: ::protobuf::SingularField<::std::vec::Vec>, + // special fields + unknown_fields: ::protobuf::UnknownFields, + cached_size: ::protobuf::CachedSize, +} + +impl HDNodeType { + pub fn new() -> HDNodeType { + ::std::default::Default::default() + } + + // required uint32 depth = 1; + + pub fn clear_depth(&mut self) { + self.depth = ::std::option::Option::None; + } + + pub fn has_depth(&self) -> bool { + self.depth.is_some() + } + + // Param is passed by value, moved + pub fn set_depth(&mut self, v: u32) { + self.depth = ::std::option::Option::Some(v); + } + + pub fn get_depth(&self) -> u32 { + self.depth.unwrap_or(0) + } + + // required uint32 fingerprint = 2; + + pub fn clear_fingerprint(&mut self) { + self.fingerprint = ::std::option::Option::None; + } + + pub fn has_fingerprint(&self) -> bool { + self.fingerprint.is_some() + } + + // Param is passed by value, moved + pub fn set_fingerprint(&mut self, v: u32) { + self.fingerprint = ::std::option::Option::Some(v); + } + + pub fn get_fingerprint(&self) -> u32 { + self.fingerprint.unwrap_or(0) + } + + // required uint32 child_num = 3; + + pub fn clear_child_num(&mut self) { + self.child_num = ::std::option::Option::None; + } + + pub fn has_child_num(&self) -> bool { + self.child_num.is_some() + } + + // Param is passed by value, moved + pub fn set_child_num(&mut self, v: u32) { + self.child_num = ::std::option::Option::Some(v); + } + + pub fn get_child_num(&self) -> u32 { + self.child_num.unwrap_or(0) + } + + // required bytes chain_code = 4; + + pub fn clear_chain_code(&mut self) { + self.chain_code.clear(); + } + + pub fn has_chain_code(&self) -> bool { + self.chain_code.is_some() + } + + // Param is passed by value, moved + pub fn set_chain_code(&mut self, v: ::std::vec::Vec) { + self.chain_code = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_chain_code(&mut self) -> &mut ::std::vec::Vec { + if self.chain_code.is_none() { + self.chain_code.set_default(); + } + self.chain_code.as_mut().unwrap() + } + + // Take field + pub fn take_chain_code(&mut self) -> ::std::vec::Vec { + self.chain_code.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + pub fn get_chain_code(&self) -> &[u8] { + match self.chain_code.as_ref() { + Some(v) => &v, + None => &[], + } + } + + // optional bytes private_key = 5; + + pub fn clear_private_key(&mut self) { + self.private_key.clear(); + } + + pub fn has_private_key(&self) -> bool { + self.private_key.is_some() + } + + // Param is passed by value, moved + pub fn set_private_key(&mut self, v: ::std::vec::Vec) { + self.private_key = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_private_key(&mut self) -> &mut ::std::vec::Vec { + if self.private_key.is_none() { + self.private_key.set_default(); + } + self.private_key.as_mut().unwrap() + } + + // Take field + pub fn take_private_key(&mut self) -> ::std::vec::Vec { + self.private_key.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + pub fn get_private_key(&self) -> &[u8] { + match self.private_key.as_ref() { + Some(v) => &v, + None => &[], + } + } + + // optional bytes public_key = 6; + + pub fn clear_public_key(&mut self) { + self.public_key.clear(); + } + + pub fn has_public_key(&self) -> bool { + self.public_key.is_some() + } + + // Param is passed by value, moved + pub fn set_public_key(&mut self, v: ::std::vec::Vec) { + self.public_key = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_public_key(&mut self) -> &mut ::std::vec::Vec { + if self.public_key.is_none() { + self.public_key.set_default(); + } + self.public_key.as_mut().unwrap() + } + + // Take field + pub fn take_public_key(&mut self) -> ::std::vec::Vec { + self.public_key.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + pub fn get_public_key(&self) -> &[u8] { + match self.public_key.as_ref() { + Some(v) => &v, + None => &[], + } + } +} + +impl ::protobuf::Message for HDNodeType { + fn is_initialized(&self) -> bool { + if self.depth.is_none() { + return false; + } + if self.fingerprint.is_none() { + return false; + } + if self.child_num.is_none() { + return false; + } + if self.chain_code.is_none() { + return false; + } + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_uint32()?; + self.depth = ::std::option::Option::Some(tmp); + }, + 2 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_uint32()?; + self.fingerprint = ::std::option::Option::Some(tmp); + }, + 3 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_uint32()?; + self.child_num = ::std::option::Option::Some(tmp); + }, + 4 => { + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.chain_code)?; + }, + 5 => { + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.private_key)?; + }, + 6 => { + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.public_key)?; + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if let Some(v) = self.depth { + my_size += ::protobuf::rt::value_size(1, v, ::protobuf::wire_format::WireTypeVarint); + } + if let Some(v) = self.fingerprint { + my_size += ::protobuf::rt::value_size(2, v, ::protobuf::wire_format::WireTypeVarint); + } + if let Some(v) = self.child_num { + my_size += ::protobuf::rt::value_size(3, v, ::protobuf::wire_format::WireTypeVarint); + } + if let Some(ref v) = self.chain_code.as_ref() { + my_size += ::protobuf::rt::bytes_size(4, &v); + } + if let Some(ref v) = self.private_key.as_ref() { + my_size += ::protobuf::rt::bytes_size(5, &v); + } + if let Some(ref v) = self.public_key.as_ref() { + my_size += ::protobuf::rt::bytes_size(6, &v); + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + if let Some(v) = self.depth { + os.write_uint32(1, v)?; + } + if let Some(v) = self.fingerprint { + os.write_uint32(2, v)?; + } + if let Some(v) = self.child_num { + os.write_uint32(3, v)?; + } + if let Some(ref v) = self.chain_code.as_ref() { + os.write_bytes(4, &v)?; + } + if let Some(ref v) = self.private_key.as_ref() { + os.write_bytes(5, &v)?; + } + if let Some(ref v) = self.public_key.as_ref() { + os.write_bytes(6, &v)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &::std::any::Any { + self as &::std::any::Any + } + fn as_any_mut(&mut self) -> &mut ::std::any::Any { + self as &mut ::std::any::Any + } + fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> HDNodeType { + HDNodeType::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( + "depth", + |m: &HDNodeType| { &m.depth }, + |m: &mut HDNodeType| { &mut m.depth }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( + "fingerprint", + |m: &HDNodeType| { &m.fingerprint }, + |m: &mut HDNodeType| { &mut m.fingerprint }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( + "child_num", + |m: &HDNodeType| { &m.child_num }, + |m: &mut HDNodeType| { &mut m.child_num }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "chain_code", + |m: &HDNodeType| { &m.chain_code }, + |m: &mut HDNodeType| { &mut m.chain_code }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "private_key", + |m: &HDNodeType| { &m.private_key }, + |m: &mut HDNodeType| { &mut m.private_key }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "public_key", + |m: &HDNodeType| { &m.public_key }, + |m: &mut HDNodeType| { &mut m.public_key }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "HDNodeType", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static HDNodeType { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const HDNodeType, + }; + unsafe { + instance.get(HDNodeType::new) + } + } +} + +impl ::protobuf::Clear for HDNodeType { + fn clear(&mut self) { + self.clear_depth(); + self.clear_fingerprint(); + self.clear_child_num(); + self.clear_chain_code(); + self.clear_private_key(); + self.clear_public_key(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for HDNodeType { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for HDNodeType { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +static file_descriptor_proto_data: &'static [u8] = b"\ + \n\x15messages-common.proto\x12\x19hw.trezor.messages.common\"#\n\x07Suc\ + cess\x12\x18\n\x07message\x18\x01\x20\x01(\tR\x07message\"\xd5\x03\n\x07\ + Failure\x12B\n\x04code\x18\x01\x20\x01(\x0e2..hw.trezor.messages.common.\ + Failure.FailureTypeR\x04code\x12\x18\n\x07message\x18\x02\x20\x01(\tR\ + \x07message\"\xeb\x02\n\x0bFailureType\x12\x1d\n\x19Failure_UnexpectedMe\ + ssage\x10\x01\x12\x1a\n\x16Failure_ButtonExpected\x10\x02\x12\x15\n\x11F\ + ailure_DataError\x10\x03\x12\x1b\n\x17Failure_ActionCancelled\x10\x04\ + \x12\x17\n\x13Failure_PinExpected\x10\x05\x12\x18\n\x14Failure_PinCancel\ + led\x10\x06\x12\x16\n\x12Failure_PinInvalid\x10\x07\x12\x1c\n\x18Failure\ + _InvalidSignature\x10\x08\x12\x18\n\x14Failure_ProcessError\x10\t\x12\ + \x1a\n\x16Failure_NotEnoughFunds\x10\n\x12\x1a\n\x16Failure_NotInitializ\ + ed\x10\x0b\x12\x17\n\x13Failure_PinMismatch\x10\x0c\x12\x19\n\x15Failure\ + _FirmwareError\x10c\"\xe6\x04\n\rButtonRequest\x12N\n\x04code\x18\x01\ + \x20\x01(\x0e2:.hw.trezor.messages.common.ButtonRequest.ButtonRequestTyp\ + eR\x04code\x12\x12\n\x04data\x18\x02\x20\x01(\tR\x04data\"\xf0\x03\n\x11\ + ButtonRequestType\x12\x17\n\x13ButtonRequest_Other\x10\x01\x12\"\n\x1eBu\ + ttonRequest_FeeOverThreshold\x10\x02\x12\x1f\n\x1bButtonRequest_ConfirmO\ + utput\x10\x03\x12\x1d\n\x19ButtonRequest_ResetDevice\x10\x04\x12\x1d\n\ + \x19ButtonRequest_ConfirmWord\x10\x05\x12\x1c\n\x18ButtonRequest_WipeDev\ + ice\x10\x06\x12\x1d\n\x19ButtonRequest_ProtectCall\x10\x07\x12\x18\n\x14\ + ButtonRequest_SignTx\x10\x08\x12\x1f\n\x1bButtonRequest_FirmwareCheck\ + \x10\t\x12\x19\n\x15ButtonRequest_Address\x10\n\x12\x1b\n\x17ButtonReque\ + st_PublicKey\x10\x0b\x12#\n\x1fButtonRequest_MnemonicWordCount\x10\x0c\ + \x12\x1f\n\x1bButtonRequest_MnemonicInput\x10\r\x12\x20\n\x1cButtonReque\ + st_PassphraseType\x10\x0e\x12'\n#ButtonRequest_UnknownDerivationPath\x10\ + \x0f\"\x0b\n\tButtonAck\"\xe9\x01\n\x10PinMatrixRequest\x12T\n\x04type\ + \x18\x01\x20\x01(\x0e2@.hw.trezor.messages.common.PinMatrixRequest.PinMa\ + trixRequestTypeR\x04type\"\x7f\n\x14PinMatrixRequestType\x12\x20\n\x1cPi\ + nMatrixRequestType_Current\x10\x01\x12!\n\x1dPinMatrixRequestType_NewFir\ + st\x10\x02\x12\"\n\x1ePinMatrixRequestType_NewSecond\x10\x03\"\x20\n\x0c\ + PinMatrixAck\x12\x10\n\x03pin\x18\x01\x20\x02(\tR\x03pin\"0\n\x11Passphr\ + aseRequest\x12\x1b\n\ton_device\x18\x01\x20\x01(\x08R\x08onDevice\"E\n\r\ + PassphraseAck\x12\x1e\n\npassphrase\x18\x01\x20\x01(\tR\npassphrase\x12\ + \x14\n\x05state\x18\x02\x20\x01(\x0cR\x05state\".\n\x16PassphraseStateRe\ + quest\x12\x14\n\x05state\x18\x01\x20\x01(\x0cR\x05state\"\x14\n\x12Passp\ + hraseStateAck\"\xc0\x01\n\nHDNodeType\x12\x14\n\x05depth\x18\x01\x20\x02\ + (\rR\x05depth\x12\x20\n\x0bfingerprint\x18\x02\x20\x02(\rR\x0bfingerprin\ + t\x12\x1b\n\tchild_num\x18\x03\x20\x02(\rR\x08childNum\x12\x1d\n\nchain_\ + code\x18\x04\x20\x02(\x0cR\tchainCode\x12\x1f\n\x0bprivate_key\x18\x05\ + \x20\x01(\x0cR\nprivateKey\x12\x1d\n\npublic_key\x18\x06\x20\x01(\x0cR\t\ + publicKeyJ\xb7!\n\x07\x12\x05\0\0\x8e\x01\x01\n\x08\n\x01\x0c\x12\x03\0\ + \0\x12\n\x08\n\x01\x02\x12\x03\x01\x08!\n?\n\x02\x04\0\x12\x04\x07\0\t\ + \x01\x1a3*\n\x20Response:\x20Success\x20of\x20the\x20previous\x20request\ + \n\x20@end\n\n\n\n\x03\x04\0\x01\x12\x03\x07\x08\x0f\nO\n\x04\x04\0\x02\ + \0\x12\x03\x08\x04\x20\"B\x20human\x20readable\x20description\x20of\x20a\ + ction\x20or\x20request-specific\x20payload\n\n\x0c\n\x05\x04\0\x02\0\x04\ + \x12\x03\x08\x04\x0c\n\x0c\n\x05\x04\0\x02\0\x05\x12\x03\x08\r\x13\n\x0c\ + \n\x05\x04\0\x02\0\x01\x12\x03\x08\x14\x1b\n\x0c\n\x05\x04\0\x02\0\x03\ + \x12\x03\x08\x1e\x1f\n?\n\x02\x04\x01\x12\x04\x0f\0!\x01\x1a3*\n\x20Resp\ + onse:\x20Failure\x20of\x20the\x20previous\x20request\n\x20@end\n\n\n\n\ + \x03\x04\x01\x01\x12\x03\x0f\x08\x0f\n>\n\x04\x04\x01\x02\0\x12\x03\x10\ + \x04\"\"1\x20computer-readable\x20definition\x20of\x20the\x20error\x20st\ + ate\n\n\x0c\n\x05\x04\x01\x02\0\x04\x12\x03\x10\x04\x0c\n\x0c\n\x05\x04\ + \x01\x02\0\x06\x12\x03\x10\r\x18\n\x0c\n\x05\x04\x01\x02\0\x01\x12\x03\ + \x10\x19\x1d\n\x0c\n\x05\x04\x01\x02\0\x03\x12\x03\x10\x20!\n8\n\x04\x04\ + \x01\x02\x01\x12\x03\x11\x04\x20\"+\x20human-readable\x20message\x20of\ + \x20the\x20error\x20state\n\n\x0c\n\x05\x04\x01\x02\x01\x04\x12\x03\x11\ + \x04\x0c\n\x0c\n\x05\x04\x01\x02\x01\x05\x12\x03\x11\r\x13\n\x0c\n\x05\ + \x04\x01\x02\x01\x01\x12\x03\x11\x14\x1b\n\x0c\n\x05\x04\x01\x02\x01\x03\ + \x12\x03\x11\x1e\x1f\n\x0c\n\x04\x04\x01\x04\0\x12\x04\x12\x04\x20\x05\n\ + \x0c\n\x05\x04\x01\x04\0\x01\x12\x03\x12\t\x14\n\r\n\x06\x04\x01\x04\0\ + \x02\0\x12\x03\x13\x08&\n\x0e\n\x07\x04\x01\x04\0\x02\0\x01\x12\x03\x13\ + \x08!\n\x0e\n\x07\x04\x01\x04\0\x02\0\x02\x12\x03\x13$%\n\r\n\x06\x04\ + \x01\x04\0\x02\x01\x12\x03\x14\x08#\n\x0e\n\x07\x04\x01\x04\0\x02\x01\ + \x01\x12\x03\x14\x08\x1e\n\x0e\n\x07\x04\x01\x04\0\x02\x01\x02\x12\x03\ + \x14!\"\n\r\n\x06\x04\x01\x04\0\x02\x02\x12\x03\x15\x08\x1e\n\x0e\n\x07\ + \x04\x01\x04\0\x02\x02\x01\x12\x03\x15\x08\x19\n\x0e\n\x07\x04\x01\x04\0\ + \x02\x02\x02\x12\x03\x15\x1c\x1d\n\r\n\x06\x04\x01\x04\0\x02\x03\x12\x03\ + \x16\x08$\n\x0e\n\x07\x04\x01\x04\0\x02\x03\x01\x12\x03\x16\x08\x1f\n\ + \x0e\n\x07\x04\x01\x04\0\x02\x03\x02\x12\x03\x16\"#\n\r\n\x06\x04\x01\ + \x04\0\x02\x04\x12\x03\x17\x08\x20\n\x0e\n\x07\x04\x01\x04\0\x02\x04\x01\ + \x12\x03\x17\x08\x1b\n\x0e\n\x07\x04\x01\x04\0\x02\x04\x02\x12\x03\x17\ + \x1e\x1f\n\r\n\x06\x04\x01\x04\0\x02\x05\x12\x03\x18\x08!\n\x0e\n\x07\ + \x04\x01\x04\0\x02\x05\x01\x12\x03\x18\x08\x1c\n\x0e\n\x07\x04\x01\x04\0\ + \x02\x05\x02\x12\x03\x18\x1f\x20\n\r\n\x06\x04\x01\x04\0\x02\x06\x12\x03\ + \x19\x08\x1f\n\x0e\n\x07\x04\x01\x04\0\x02\x06\x01\x12\x03\x19\x08\x1a\n\ + \x0e\n\x07\x04\x01\x04\0\x02\x06\x02\x12\x03\x19\x1d\x1e\n\r\n\x06\x04\ + \x01\x04\0\x02\x07\x12\x03\x1a\x08%\n\x0e\n\x07\x04\x01\x04\0\x02\x07\ + \x01\x12\x03\x1a\x08\x20\n\x0e\n\x07\x04\x01\x04\0\x02\x07\x02\x12\x03\ + \x1a#$\n\r\n\x06\x04\x01\x04\0\x02\x08\x12\x03\x1b\x08!\n\x0e\n\x07\x04\ + \x01\x04\0\x02\x08\x01\x12\x03\x1b\x08\x1c\n\x0e\n\x07\x04\x01\x04\0\x02\ + \x08\x02\x12\x03\x1b\x1f\x20\n\r\n\x06\x04\x01\x04\0\x02\t\x12\x03\x1c\ + \x08$\n\x0e\n\x07\x04\x01\x04\0\x02\t\x01\x12\x03\x1c\x08\x1e\n\x0e\n\ + \x07\x04\x01\x04\0\x02\t\x02\x12\x03\x1c!#\n\r\n\x06\x04\x01\x04\0\x02\n\ + \x12\x03\x1d\x08$\n\x0e\n\x07\x04\x01\x04\0\x02\n\x01\x12\x03\x1d\x08\ + \x1e\n\x0e\n\x07\x04\x01\x04\0\x02\n\x02\x12\x03\x1d!#\n\r\n\x06\x04\x01\ + \x04\0\x02\x0b\x12\x03\x1e\x08!\n\x0e\n\x07\x04\x01\x04\0\x02\x0b\x01\ + \x12\x03\x1e\x08\x1b\n\x0e\n\x07\x04\x01\x04\0\x02\x0b\x02\x12\x03\x1e\ + \x1e\x20\n\r\n\x06\x04\x01\x04\0\x02\x0c\x12\x03\x1f\x08#\n\x0e\n\x07\ + \x04\x01\x04\0\x02\x0c\x01\x12\x03\x1f\x08\x1d\n\x0e\n\x07\x04\x01\x04\0\ + \x02\x0c\x02\x12\x03\x1f\x20\"\n\\\n\x02\x04\x02\x12\x04(\0?\x01\x1aP*\n\ + \x20Response:\x20Device\x20is\x20waiting\x20for\x20HW\x20button\x20press\ + .\n\x20@auxstart\n\x20@next\x20ButtonAck\n\n\n\n\x03\x04\x02\x01\x12\x03\ + (\x08\x15\n\x0b\n\x04\x04\x02\x02\0\x12\x03)\x04(\n\x0c\n\x05\x04\x02\ + \x02\0\x04\x12\x03)\x04\x0c\n\x0c\n\x05\x04\x02\x02\0\x06\x12\x03)\r\x1e\ + \n\x0c\n\x05\x04\x02\x02\0\x01\x12\x03)\x1f#\n\x0c\n\x05\x04\x02\x02\0\ + \x03\x12\x03)&'\n\x0b\n\x04\x04\x02\x02\x01\x12\x03*\x04\x1d\n\x0c\n\x05\ + \x04\x02\x02\x01\x04\x12\x03*\x04\x0c\n\x0c\n\x05\x04\x02\x02\x01\x05\ + \x12\x03*\r\x13\n\x0c\n\x05\x04\x02\x02\x01\x01\x12\x03*\x14\x18\n\x0c\n\ + \x05\x04\x02\x02\x01\x03\x12\x03*\x1b\x1c\n(\n\x04\x04\x02\x04\0\x12\x04\ + .\x04>\x05\x1a\x1a*\n\x20Type\x20of\x20button\x20request\n\n\x0c\n\x05\ + \x04\x02\x04\0\x01\x12\x03.\t\x1a\n\r\n\x06\x04\x02\x04\0\x02\0\x12\x03/\ + \x08\x20\n\x0e\n\x07\x04\x02\x04\0\x02\0\x01\x12\x03/\x08\x1b\n\x0e\n\ + \x07\x04\x02\x04\0\x02\0\x02\x12\x03/\x1e\x1f\n\r\n\x06\x04\x02\x04\0\ + \x02\x01\x12\x030\x08+\n\x0e\n\x07\x04\x02\x04\0\x02\x01\x01\x12\x030\ + \x08&\n\x0e\n\x07\x04\x02\x04\0\x02\x01\x02\x12\x030)*\n\r\n\x06\x04\x02\ + \x04\0\x02\x02\x12\x031\x08(\n\x0e\n\x07\x04\x02\x04\0\x02\x02\x01\x12\ + \x031\x08#\n\x0e\n\x07\x04\x02\x04\0\x02\x02\x02\x12\x031&'\n\r\n\x06\ + \x04\x02\x04\0\x02\x03\x12\x032\x08&\n\x0e\n\x07\x04\x02\x04\0\x02\x03\ + \x01\x12\x032\x08!\n\x0e\n\x07\x04\x02\x04\0\x02\x03\x02\x12\x032$%\n\r\ + \n\x06\x04\x02\x04\0\x02\x04\x12\x033\x08&\n\x0e\n\x07\x04\x02\x04\0\x02\ + \x04\x01\x12\x033\x08!\n\x0e\n\x07\x04\x02\x04\0\x02\x04\x02\x12\x033$%\ + \n\r\n\x06\x04\x02\x04\0\x02\x05\x12\x034\x08%\n\x0e\n\x07\x04\x02\x04\0\ + \x02\x05\x01\x12\x034\x08\x20\n\x0e\n\x07\x04\x02\x04\0\x02\x05\x02\x12\ + \x034#$\n\r\n\x06\x04\x02\x04\0\x02\x06\x12\x035\x08&\n\x0e\n\x07\x04\ + \x02\x04\0\x02\x06\x01\x12\x035\x08!\n\x0e\n\x07\x04\x02\x04\0\x02\x06\ + \x02\x12\x035$%\n\r\n\x06\x04\x02\x04\0\x02\x07\x12\x036\x08!\n\x0e\n\ + \x07\x04\x02\x04\0\x02\x07\x01\x12\x036\x08\x1c\n\x0e\n\x07\x04\x02\x04\ + \0\x02\x07\x02\x12\x036\x1f\x20\n\r\n\x06\x04\x02\x04\0\x02\x08\x12\x037\ + \x08(\n\x0e\n\x07\x04\x02\x04\0\x02\x08\x01\x12\x037\x08#\n\x0e\n\x07\ + \x04\x02\x04\0\x02\x08\x02\x12\x037&'\n\r\n\x06\x04\x02\x04\0\x02\t\x12\ + \x038\x08#\n\x0e\n\x07\x04\x02\x04\0\x02\t\x01\x12\x038\x08\x1d\n\x0e\n\ + \x07\x04\x02\x04\0\x02\t\x02\x12\x038\x20\"\n\r\n\x06\x04\x02\x04\0\x02\ + \n\x12\x039\x08%\n\x0e\n\x07\x04\x02\x04\0\x02\n\x01\x12\x039\x08\x1f\n\ + \x0e\n\x07\x04\x02\x04\0\x02\n\x02\x12\x039\"$\n\r\n\x06\x04\x02\x04\0\ + \x02\x0b\x12\x03:\x08-\n\x0e\n\x07\x04\x02\x04\0\x02\x0b\x01\x12\x03:\ + \x08'\n\x0e\n\x07\x04\x02\x04\0\x02\x0b\x02\x12\x03:*,\n\r\n\x06\x04\x02\ + \x04\0\x02\x0c\x12\x03;\x08)\n\x0e\n\x07\x04\x02\x04\0\x02\x0c\x01\x12\ + \x03;\x08#\n\x0e\n\x07\x04\x02\x04\0\x02\x0c\x02\x12\x03;&(\n\r\n\x06\ + \x04\x02\x04\0\x02\r\x12\x03<\x08*\n\x0e\n\x07\x04\x02\x04\0\x02\r\x01\ + \x12\x03<\x08$\n\x0e\n\x07\x04\x02\x04\0\x02\r\x02\x12\x03<')\n\r\n\x06\ + \x04\x02\x04\0\x02\x0e\x12\x03=\x081\n\x0e\n\x07\x04\x02\x04\0\x02\x0e\ + \x01\x12\x03=\x08+\n\x0e\n\x07\x04\x02\x04\0\x02\x0e\x02\x12\x03=.0\nM\n\ + \x02\x04\x03\x12\x04E\0F\x01\x1aA*\n\x20Request:\x20Computer\x20agrees\ + \x20to\x20wait\x20for\x20HW\x20button\x20press\n\x20@auxend\n\n\n\n\x03\ + \x04\x03\x01\x12\x03E\x08\x11\n\x96\x01\n\x02\x04\x04\x12\x04M\0W\x01\ + \x1a\x89\x01*\n\x20Response:\x20Device\x20is\x20asking\x20computer\x20to\ + \x20show\x20PIN\x20matrix\x20and\x20awaits\x20PIN\x20encoded\x20using\ + \x20this\x20matrix\x20scheme\n\x20@auxstart\n\x20@next\x20PinMatrixAck\n\ + \n\n\n\x03\x04\x04\x01\x12\x03M\x08\x18\n\x0b\n\x04\x04\x04\x02\0\x12\ + \x03N\x04+\n\x0c\n\x05\x04\x04\x02\0\x04\x12\x03N\x04\x0c\n\x0c\n\x05\ + \x04\x04\x02\0\x06\x12\x03N\r!\n\x0c\n\x05\x04\x04\x02\0\x01\x12\x03N\"&\ + \n\x0c\n\x05\x04\x04\x02\0\x03\x12\x03N)*\n%\n\x04\x04\x04\x04\0\x12\x04\ + R\x04V\x05\x1a\x17*\n\x20Type\x20of\x20PIN\x20request\n\n\x0c\n\x05\x04\ + \x04\x04\0\x01\x12\x03R\t\x1d\n\r\n\x06\x04\x04\x04\0\x02\0\x12\x03S\x08\ + )\n\x0e\n\x07\x04\x04\x04\0\x02\0\x01\x12\x03S\x08$\n\x0e\n\x07\x04\x04\ + \x04\0\x02\0\x02\x12\x03S'(\n\r\n\x06\x04\x04\x04\0\x02\x01\x12\x03T\x08\ + *\n\x0e\n\x07\x04\x04\x04\0\x02\x01\x01\x12\x03T\x08%\n\x0e\n\x07\x04\ + \x04\x04\0\x02\x01\x02\x12\x03T()\n\r\n\x06\x04\x04\x04\0\x02\x02\x12\ + \x03U\x08+\n\x0e\n\x07\x04\x04\x04\0\x02\x02\x01\x12\x03U\x08&\n\x0e\n\ + \x07\x04\x04\x04\0\x02\x02\x02\x12\x03U)*\nD\n\x02\x04\x05\x12\x04]\0_\ + \x01\x1a8*\n\x20Request:\x20Computer\x20responds\x20with\x20encoded\x20P\ + IN\n\x20@auxend\n\n\n\n\x03\x04\x05\x01\x12\x03]\x08\x14\n1\n\x04\x04\ + \x05\x02\0\x12\x03^\x04\x1c\"$\x20matrix\x20encoded\x20PIN\x20entered\ + \x20by\x20user\n\n\x0c\n\x05\x04\x05\x02\0\x04\x12\x03^\x04\x0c\n\x0c\n\ + \x05\x04\x05\x02\0\x05\x12\x03^\r\x13\n\x0c\n\x05\x04\x05\x02\0\x01\x12\ + \x03^\x14\x17\n\x0c\n\x05\x04\x05\x02\0\x03\x12\x03^\x1a\x1b\n]\n\x02\ + \x04\x06\x12\x04f\0h\x01\x1aQ*\n\x20Response:\x20Device\x20awaits\x20enc\ + ryption\x20passphrase\n\x20@auxstart\n\x20@next\x20PassphraseAck\n\n\n\n\ + \x03\x04\x06\x01\x12\x03f\x08\x19\n8\n\x04\x04\x06\x02\0\x12\x03g\x04\ + \x20\"+\x20passphrase\x20is\x20being\x20entered\x20on\x20the\x20device\n\ + \n\x0c\n\x05\x04\x06\x02\0\x04\x12\x03g\x04\x0c\n\x0c\n\x05\x04\x06\x02\ + \0\x05\x12\x03g\r\x11\n\x0c\n\x05\x04\x06\x02\0\x01\x12\x03g\x12\x1b\n\ + \x0c\n\x05\x04\x06\x02\0\x03\x12\x03g\x1e\x1f\nK\n\x02\x04\x07\x12\x04n\ + \0q\x01\x1a?*\n\x20Request:\x20Send\x20passphrase\x20back\n\x20@next\x20\ + PassphraseStateRequest\n\n\n\n\x03\x04\x07\x01\x12\x03n\x08\x15\n\x0b\n\ + \x04\x04\x07\x02\0\x12\x03o\x04#\n\x0c\n\x05\x04\x07\x02\0\x04\x12\x03o\ + \x04\x0c\n\x0c\n\x05\x04\x07\x02\0\x05\x12\x03o\r\x13\n\x0c\n\x05\x04\ + \x07\x02\0\x01\x12\x03o\x14\x1e\n\x0c\n\x05\x04\x07\x02\0\x03\x12\x03o!\ + \"\n$\n\x04\x04\x07\x02\x01\x12\x03p\x04\x1d\"\x17\x20expected\x20device\ + \x20state\n\n\x0c\n\x05\x04\x07\x02\x01\x04\x12\x03p\x04\x0c\n\x0c\n\x05\ + \x04\x07\x02\x01\x05\x12\x03p\r\x12\n\x0c\n\x05\x04\x07\x02\x01\x01\x12\ + \x03p\x13\x18\n\x0c\n\x05\x04\x07\x02\x01\x03\x12\x03p\x1b\x1c\nR\n\x02\ + \x04\x08\x12\x04w\0y\x01\x1aF*\n\x20Response:\x20Device\x20awaits\x20pas\ + sphrase\x20state\n\x20@next\x20PassphraseStateAck\n\n\n\n\x03\x04\x08\ + \x01\x12\x03w\x08\x1e\n\"\n\x04\x04\x08\x02\0\x12\x03x\x04\x1d\"\x15\x20\ + actual\x20device\x20state\n\n\x0c\n\x05\x04\x08\x02\0\x04\x12\x03x\x04\ + \x0c\n\x0c\n\x05\x04\x08\x02\0\x05\x12\x03x\r\x12\n\x0c\n\x05\x04\x08\ + \x02\0\x01\x12\x03x\x13\x18\n\x0c\n\x05\x04\x08\x02\0\x03\x12\x03x\x1b\ + \x1c\n=\n\x02\x04\t\x12\x05\x7f\0\x80\x01\x01\x1a0*\n\x20Request:\x20Sen\ + d\x20passphrase\x20state\x20back\n\x20@auxend\n\n\n\n\x03\x04\t\x01\x12\ + \x03\x7f\x08\x1a\n\xb1\x01\n\x02\x04\n\x12\x06\x87\x01\0\x8e\x01\x01\x1a\ + \xa2\x01*\n\x20Structure\x20representing\x20BIP32\x20(hierarchical\x20de\ + terministic)\x20node\n\x20Used\x20for\x20imports\x20of\x20private\x20key\ + \x20into\x20the\x20device\x20and\x20exporting\x20public\x20key\x20out\ + \x20of\x20device\n\x20@embed\n\n\x0b\n\x03\x04\n\x01\x12\x04\x87\x01\x08\ + \x12\n\x0c\n\x04\x04\n\x02\0\x12\x04\x88\x01\x04\x1e\n\r\n\x05\x04\n\x02\ + \0\x04\x12\x04\x88\x01\x04\x0c\n\r\n\x05\x04\n\x02\0\x05\x12\x04\x88\x01\ + \r\x13\n\r\n\x05\x04\n\x02\0\x01\x12\x04\x88\x01\x14\x19\n\r\n\x05\x04\n\ + \x02\0\x03\x12\x04\x88\x01\x1c\x1d\n\x0c\n\x04\x04\n\x02\x01\x12\x04\x89\ + \x01\x04$\n\r\n\x05\x04\n\x02\x01\x04\x12\x04\x89\x01\x04\x0c\n\r\n\x05\ + \x04\n\x02\x01\x05\x12\x04\x89\x01\r\x13\n\r\n\x05\x04\n\x02\x01\x01\x12\ + \x04\x89\x01\x14\x1f\n\r\n\x05\x04\n\x02\x01\x03\x12\x04\x89\x01\"#\n\ + \x0c\n\x04\x04\n\x02\x02\x12\x04\x8a\x01\x04\"\n\r\n\x05\x04\n\x02\x02\ + \x04\x12\x04\x8a\x01\x04\x0c\n\r\n\x05\x04\n\x02\x02\x05\x12\x04\x8a\x01\ + \r\x13\n\r\n\x05\x04\n\x02\x02\x01\x12\x04\x8a\x01\x14\x1d\n\r\n\x05\x04\ + \n\x02\x02\x03\x12\x04\x8a\x01\x20!\n\x0c\n\x04\x04\n\x02\x03\x12\x04\ + \x8b\x01\x04\"\n\r\n\x05\x04\n\x02\x03\x04\x12\x04\x8b\x01\x04\x0c\n\r\n\ + \x05\x04\n\x02\x03\x05\x12\x04\x8b\x01\r\x12\n\r\n\x05\x04\n\x02\x03\x01\ + \x12\x04\x8b\x01\x13\x1d\n\r\n\x05\x04\n\x02\x03\x03\x12\x04\x8b\x01\x20\ + !\n\x0c\n\x04\x04\n\x02\x04\x12\x04\x8c\x01\x04#\n\r\n\x05\x04\n\x02\x04\ + \x04\x12\x04\x8c\x01\x04\x0c\n\r\n\x05\x04\n\x02\x04\x05\x12\x04\x8c\x01\ + \r\x12\n\r\n\x05\x04\n\x02\x04\x01\x12\x04\x8c\x01\x13\x1e\n\r\n\x05\x04\ + \n\x02\x04\x03\x12\x04\x8c\x01!\"\n\x0c\n\x04\x04\n\x02\x05\x12\x04\x8d\ + \x01\x04\"\n\r\n\x05\x04\n\x02\x05\x04\x12\x04\x8d\x01\x04\x0c\n\r\n\x05\ + \x04\n\x02\x05\x05\x12\x04\x8d\x01\r\x12\n\r\n\x05\x04\n\x02\x05\x01\x12\ + \x04\x8d\x01\x13\x1d\n\r\n\x05\x04\n\x02\x05\x03\x12\x04\x8d\x01\x20!\ +"; + +static mut file_descriptor_proto_lazy: ::protobuf::lazy::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::descriptor::FileDescriptorProto, +}; + +fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto { + ::protobuf::parse_from_bytes(file_descriptor_proto_data).unwrap() +} + +pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { + unsafe { + file_descriptor_proto_lazy.get(|| { + parse_descriptor_proto() + }) + } +} diff --git a/src/protos/messages_crypto.rs b/src/protos/messages_crypto.rs new file mode 100644 index 0000000..d6a6239 --- /dev/null +++ b/src/protos/messages_crypto.rs @@ -0,0 +1,3263 @@ +// This file is generated by rust-protobuf 2.0.4. Do not edit +// @generated + +// https://github.com/Manishearth/rust-clippy/issues/702 +#![allow(unknown_lints)] +#![allow(clippy)] + +#![cfg_attr(rustfmt, rustfmt_skip)] + +#![allow(box_pointers)] +#![allow(dead_code)] +#![allow(missing_docs)] +#![allow(non_camel_case_types)] +#![allow(non_snake_case)] +#![allow(non_upper_case_globals)] +#![allow(trivial_casts)] +#![allow(unsafe_code)] +#![allow(unused_imports)] +#![allow(unused_results)] + +use protobuf::Message as Message_imported_for_functions; +use protobuf::ProtobufEnum as ProtobufEnum_imported_for_functions; + +#[derive(PartialEq,Clone,Default)] +pub struct CipherKeyValue { + // message fields + address_n: ::std::vec::Vec, + key: ::protobuf::SingularField<::std::string::String>, + value: ::protobuf::SingularField<::std::vec::Vec>, + encrypt: ::std::option::Option, + ask_on_encrypt: ::std::option::Option, + ask_on_decrypt: ::std::option::Option, + iv: ::protobuf::SingularField<::std::vec::Vec>, + // special fields + unknown_fields: ::protobuf::UnknownFields, + cached_size: ::protobuf::CachedSize, +} + +impl CipherKeyValue { + pub fn new() -> CipherKeyValue { + ::std::default::Default::default() + } + + // repeated uint32 address_n = 1; + + pub fn clear_address_n(&mut self) { + self.address_n.clear(); + } + + // Param is passed by value, moved + pub fn set_address_n(&mut self, v: ::std::vec::Vec) { + self.address_n = v; + } + + // Mutable pointer to the field. + pub fn mut_address_n(&mut self) -> &mut ::std::vec::Vec { + &mut self.address_n + } + + // Take field + pub fn take_address_n(&mut self) -> ::std::vec::Vec { + ::std::mem::replace(&mut self.address_n, ::std::vec::Vec::new()) + } + + pub fn get_address_n(&self) -> &[u32] { + &self.address_n + } + + // optional string key = 2; + + pub fn clear_key(&mut self) { + self.key.clear(); + } + + pub fn has_key(&self) -> bool { + self.key.is_some() + } + + // Param is passed by value, moved + pub fn set_key(&mut self, v: ::std::string::String) { + self.key = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_key(&mut self) -> &mut ::std::string::String { + if self.key.is_none() { + self.key.set_default(); + } + self.key.as_mut().unwrap() + } + + // Take field + pub fn take_key(&mut self) -> ::std::string::String { + self.key.take().unwrap_or_else(|| ::std::string::String::new()) + } + + pub fn get_key(&self) -> &str { + match self.key.as_ref() { + Some(v) => &v, + None => "", + } + } + + // optional bytes value = 3; + + pub fn clear_value(&mut self) { + self.value.clear(); + } + + pub fn has_value(&self) -> bool { + self.value.is_some() + } + + // Param is passed by value, moved + pub fn set_value(&mut self, v: ::std::vec::Vec) { + self.value = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_value(&mut self) -> &mut ::std::vec::Vec { + if self.value.is_none() { + self.value.set_default(); + } + self.value.as_mut().unwrap() + } + + // Take field + pub fn take_value(&mut self) -> ::std::vec::Vec { + self.value.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + pub fn get_value(&self) -> &[u8] { + match self.value.as_ref() { + Some(v) => &v, + None => &[], + } + } + + // optional bool encrypt = 4; + + pub fn clear_encrypt(&mut self) { + self.encrypt = ::std::option::Option::None; + } + + pub fn has_encrypt(&self) -> bool { + self.encrypt.is_some() + } + + // Param is passed by value, moved + pub fn set_encrypt(&mut self, v: bool) { + self.encrypt = ::std::option::Option::Some(v); + } + + pub fn get_encrypt(&self) -> bool { + self.encrypt.unwrap_or(false) + } + + // optional bool ask_on_encrypt = 5; + + pub fn clear_ask_on_encrypt(&mut self) { + self.ask_on_encrypt = ::std::option::Option::None; + } + + pub fn has_ask_on_encrypt(&self) -> bool { + self.ask_on_encrypt.is_some() + } + + // Param is passed by value, moved + pub fn set_ask_on_encrypt(&mut self, v: bool) { + self.ask_on_encrypt = ::std::option::Option::Some(v); + } + + pub fn get_ask_on_encrypt(&self) -> bool { + self.ask_on_encrypt.unwrap_or(false) + } + + // optional bool ask_on_decrypt = 6; + + pub fn clear_ask_on_decrypt(&mut self) { + self.ask_on_decrypt = ::std::option::Option::None; + } + + pub fn has_ask_on_decrypt(&self) -> bool { + self.ask_on_decrypt.is_some() + } + + // Param is passed by value, moved + pub fn set_ask_on_decrypt(&mut self, v: bool) { + self.ask_on_decrypt = ::std::option::Option::Some(v); + } + + pub fn get_ask_on_decrypt(&self) -> bool { + self.ask_on_decrypt.unwrap_or(false) + } + + // optional bytes iv = 7; + + pub fn clear_iv(&mut self) { + self.iv.clear(); + } + + pub fn has_iv(&self) -> bool { + self.iv.is_some() + } + + // Param is passed by value, moved + pub fn set_iv(&mut self, v: ::std::vec::Vec) { + self.iv = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_iv(&mut self) -> &mut ::std::vec::Vec { + if self.iv.is_none() { + self.iv.set_default(); + } + self.iv.as_mut().unwrap() + } + + // Take field + pub fn take_iv(&mut self) -> ::std::vec::Vec { + self.iv.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + pub fn get_iv(&self) -> &[u8] { + match self.iv.as_ref() { + Some(v) => &v, + None => &[], + } + } +} + +impl ::protobuf::Message for CipherKeyValue { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_repeated_uint32_into(wire_type, is, &mut self.address_n)?; + }, + 2 => { + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.key)?; + }, + 3 => { + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.value)?; + }, + 4 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_bool()?; + self.encrypt = ::std::option::Option::Some(tmp); + }, + 5 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_bool()?; + self.ask_on_encrypt = ::std::option::Option::Some(tmp); + }, + 6 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_bool()?; + self.ask_on_decrypt = ::std::option::Option::Some(tmp); + }, + 7 => { + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.iv)?; + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + for value in &self.address_n { + my_size += ::protobuf::rt::value_size(1, *value, ::protobuf::wire_format::WireTypeVarint); + }; + if let Some(ref v) = self.key.as_ref() { + my_size += ::protobuf::rt::string_size(2, &v); + } + if let Some(ref v) = self.value.as_ref() { + my_size += ::protobuf::rt::bytes_size(3, &v); + } + if let Some(v) = self.encrypt { + my_size += 2; + } + if let Some(v) = self.ask_on_encrypt { + my_size += 2; + } + if let Some(v) = self.ask_on_decrypt { + my_size += 2; + } + if let Some(ref v) = self.iv.as_ref() { + my_size += ::protobuf::rt::bytes_size(7, &v); + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + for v in &self.address_n { + os.write_uint32(1, *v)?; + }; + if let Some(ref v) = self.key.as_ref() { + os.write_string(2, &v)?; + } + if let Some(ref v) = self.value.as_ref() { + os.write_bytes(3, &v)?; + } + if let Some(v) = self.encrypt { + os.write_bool(4, v)?; + } + if let Some(v) = self.ask_on_encrypt { + os.write_bool(5, v)?; + } + if let Some(v) = self.ask_on_decrypt { + os.write_bool(6, v)?; + } + if let Some(ref v) = self.iv.as_ref() { + os.write_bytes(7, &v)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &::std::any::Any { + self as &::std::any::Any + } + fn as_any_mut(&mut self) -> &mut ::std::any::Any { + self as &mut ::std::any::Any + } + fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> CipherKeyValue { + CipherKeyValue::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_vec_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( + "address_n", + |m: &CipherKeyValue| { &m.address_n }, + |m: &mut CipherKeyValue| { &mut m.address_n }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "key", + |m: &CipherKeyValue| { &m.key }, + |m: &mut CipherKeyValue| { &mut m.key }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "value", + |m: &CipherKeyValue| { &m.value }, + |m: &mut CipherKeyValue| { &mut m.value }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "encrypt", + |m: &CipherKeyValue| { &m.encrypt }, + |m: &mut CipherKeyValue| { &mut m.encrypt }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "ask_on_encrypt", + |m: &CipherKeyValue| { &m.ask_on_encrypt }, + |m: &mut CipherKeyValue| { &mut m.ask_on_encrypt }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "ask_on_decrypt", + |m: &CipherKeyValue| { &m.ask_on_decrypt }, + |m: &mut CipherKeyValue| { &mut m.ask_on_decrypt }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "iv", + |m: &CipherKeyValue| { &m.iv }, + |m: &mut CipherKeyValue| { &mut m.iv }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "CipherKeyValue", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static CipherKeyValue { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const CipherKeyValue, + }; + unsafe { + instance.get(CipherKeyValue::new) + } + } +} + +impl ::protobuf::Clear for CipherKeyValue { + fn clear(&mut self) { + self.clear_address_n(); + self.clear_key(); + self.clear_value(); + self.clear_encrypt(); + self.clear_ask_on_encrypt(); + self.clear_ask_on_decrypt(); + self.clear_iv(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for CipherKeyValue { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for CipherKeyValue { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct CipheredKeyValue { + // message fields + value: ::protobuf::SingularField<::std::vec::Vec>, + // special fields + unknown_fields: ::protobuf::UnknownFields, + cached_size: ::protobuf::CachedSize, +} + +impl CipheredKeyValue { + pub fn new() -> CipheredKeyValue { + ::std::default::Default::default() + } + + // optional bytes value = 1; + + pub fn clear_value(&mut self) { + self.value.clear(); + } + + pub fn has_value(&self) -> bool { + self.value.is_some() + } + + // Param is passed by value, moved + pub fn set_value(&mut self, v: ::std::vec::Vec) { + self.value = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_value(&mut self) -> &mut ::std::vec::Vec { + if self.value.is_none() { + self.value.set_default(); + } + self.value.as_mut().unwrap() + } + + // Take field + pub fn take_value(&mut self) -> ::std::vec::Vec { + self.value.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + pub fn get_value(&self) -> &[u8] { + match self.value.as_ref() { + Some(v) => &v, + None => &[], + } + } +} + +impl ::protobuf::Message for CipheredKeyValue { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.value)?; + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if let Some(ref v) = self.value.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &v); + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + if let Some(ref v) = self.value.as_ref() { + os.write_bytes(1, &v)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &::std::any::Any { + self as &::std::any::Any + } + fn as_any_mut(&mut self) -> &mut ::std::any::Any { + self as &mut ::std::any::Any + } + fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> CipheredKeyValue { + CipheredKeyValue::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "value", + |m: &CipheredKeyValue| { &m.value }, + |m: &mut CipheredKeyValue| { &mut m.value }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "CipheredKeyValue", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static CipheredKeyValue { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const CipheredKeyValue, + }; + unsafe { + instance.get(CipheredKeyValue::new) + } + } +} + +impl ::protobuf::Clear for CipheredKeyValue { + fn clear(&mut self) { + self.clear_value(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for CipheredKeyValue { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for CipheredKeyValue { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct IdentityType { + // message fields + proto: ::protobuf::SingularField<::std::string::String>, + user: ::protobuf::SingularField<::std::string::String>, + host: ::protobuf::SingularField<::std::string::String>, + port: ::protobuf::SingularField<::std::string::String>, + path: ::protobuf::SingularField<::std::string::String>, + index: ::std::option::Option, + // special fields + unknown_fields: ::protobuf::UnknownFields, + cached_size: ::protobuf::CachedSize, +} + +impl IdentityType { + pub fn new() -> IdentityType { + ::std::default::Default::default() + } + + // optional string proto = 1; + + pub fn clear_proto(&mut self) { + self.proto.clear(); + } + + pub fn has_proto(&self) -> bool { + self.proto.is_some() + } + + // Param is passed by value, moved + pub fn set_proto(&mut self, v: ::std::string::String) { + self.proto = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_proto(&mut self) -> &mut ::std::string::String { + if self.proto.is_none() { + self.proto.set_default(); + } + self.proto.as_mut().unwrap() + } + + // Take field + pub fn take_proto(&mut self) -> ::std::string::String { + self.proto.take().unwrap_or_else(|| ::std::string::String::new()) + } + + pub fn get_proto(&self) -> &str { + match self.proto.as_ref() { + Some(v) => &v, + None => "", + } + } + + // optional string user = 2; + + pub fn clear_user(&mut self) { + self.user.clear(); + } + + pub fn has_user(&self) -> bool { + self.user.is_some() + } + + // Param is passed by value, moved + pub fn set_user(&mut self, v: ::std::string::String) { + self.user = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_user(&mut self) -> &mut ::std::string::String { + if self.user.is_none() { + self.user.set_default(); + } + self.user.as_mut().unwrap() + } + + // Take field + pub fn take_user(&mut self) -> ::std::string::String { + self.user.take().unwrap_or_else(|| ::std::string::String::new()) + } + + pub fn get_user(&self) -> &str { + match self.user.as_ref() { + Some(v) => &v, + None => "", + } + } + + // optional string host = 3; + + pub fn clear_host(&mut self) { + self.host.clear(); + } + + pub fn has_host(&self) -> bool { + self.host.is_some() + } + + // Param is passed by value, moved + pub fn set_host(&mut self, v: ::std::string::String) { + self.host = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_host(&mut self) -> &mut ::std::string::String { + if self.host.is_none() { + self.host.set_default(); + } + self.host.as_mut().unwrap() + } + + // Take field + pub fn take_host(&mut self) -> ::std::string::String { + self.host.take().unwrap_or_else(|| ::std::string::String::new()) + } + + pub fn get_host(&self) -> &str { + match self.host.as_ref() { + Some(v) => &v, + None => "", + } + } + + // optional string port = 4; + + pub fn clear_port(&mut self) { + self.port.clear(); + } + + pub fn has_port(&self) -> bool { + self.port.is_some() + } + + // Param is passed by value, moved + pub fn set_port(&mut self, v: ::std::string::String) { + self.port = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_port(&mut self) -> &mut ::std::string::String { + if self.port.is_none() { + self.port.set_default(); + } + self.port.as_mut().unwrap() + } + + // Take field + pub fn take_port(&mut self) -> ::std::string::String { + self.port.take().unwrap_or_else(|| ::std::string::String::new()) + } + + pub fn get_port(&self) -> &str { + match self.port.as_ref() { + Some(v) => &v, + None => "", + } + } + + // optional string path = 5; + + pub fn clear_path(&mut self) { + self.path.clear(); + } + + pub fn has_path(&self) -> bool { + self.path.is_some() + } + + // Param is passed by value, moved + pub fn set_path(&mut self, v: ::std::string::String) { + self.path = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_path(&mut self) -> &mut ::std::string::String { + if self.path.is_none() { + self.path.set_default(); + } + self.path.as_mut().unwrap() + } + + // Take field + pub fn take_path(&mut self) -> ::std::string::String { + self.path.take().unwrap_or_else(|| ::std::string::String::new()) + } + + pub fn get_path(&self) -> &str { + match self.path.as_ref() { + Some(v) => &v, + None => "", + } + } + + // optional uint32 index = 6; + + pub fn clear_index(&mut self) { + self.index = ::std::option::Option::None; + } + + pub fn has_index(&self) -> bool { + self.index.is_some() + } + + // Param is passed by value, moved + pub fn set_index(&mut self, v: u32) { + self.index = ::std::option::Option::Some(v); + } + + pub fn get_index(&self) -> u32 { + self.index.unwrap_or(0u32) + } +} + +impl ::protobuf::Message for IdentityType { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.proto)?; + }, + 2 => { + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.user)?; + }, + 3 => { + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.host)?; + }, + 4 => { + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.port)?; + }, + 5 => { + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.path)?; + }, + 6 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_uint32()?; + self.index = ::std::option::Option::Some(tmp); + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if let Some(ref v) = self.proto.as_ref() { + my_size += ::protobuf::rt::string_size(1, &v); + } + if let Some(ref v) = self.user.as_ref() { + my_size += ::protobuf::rt::string_size(2, &v); + } + if let Some(ref v) = self.host.as_ref() { + my_size += ::protobuf::rt::string_size(3, &v); + } + if let Some(ref v) = self.port.as_ref() { + my_size += ::protobuf::rt::string_size(4, &v); + } + if let Some(ref v) = self.path.as_ref() { + my_size += ::protobuf::rt::string_size(5, &v); + } + if let Some(v) = self.index { + my_size += ::protobuf::rt::value_size(6, v, ::protobuf::wire_format::WireTypeVarint); + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + if let Some(ref v) = self.proto.as_ref() { + os.write_string(1, &v)?; + } + if let Some(ref v) = self.user.as_ref() { + os.write_string(2, &v)?; + } + if let Some(ref v) = self.host.as_ref() { + os.write_string(3, &v)?; + } + if let Some(ref v) = self.port.as_ref() { + os.write_string(4, &v)?; + } + if let Some(ref v) = self.path.as_ref() { + os.write_string(5, &v)?; + } + if let Some(v) = self.index { + os.write_uint32(6, v)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &::std::any::Any { + self as &::std::any::Any + } + fn as_any_mut(&mut self) -> &mut ::std::any::Any { + self as &mut ::std::any::Any + } + fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> IdentityType { + IdentityType::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "proto", + |m: &IdentityType| { &m.proto }, + |m: &mut IdentityType| { &mut m.proto }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "user", + |m: &IdentityType| { &m.user }, + |m: &mut IdentityType| { &mut m.user }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "host", + |m: &IdentityType| { &m.host }, + |m: &mut IdentityType| { &mut m.host }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "port", + |m: &IdentityType| { &m.port }, + |m: &mut IdentityType| { &mut m.port }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "path", + |m: &IdentityType| { &m.path }, + |m: &mut IdentityType| { &mut m.path }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( + "index", + |m: &IdentityType| { &m.index }, + |m: &mut IdentityType| { &mut m.index }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "IdentityType", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static IdentityType { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const IdentityType, + }; + unsafe { + instance.get(IdentityType::new) + } + } +} + +impl ::protobuf::Clear for IdentityType { + fn clear(&mut self) { + self.clear_proto(); + self.clear_user(); + self.clear_host(); + self.clear_port(); + self.clear_path(); + self.clear_index(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for IdentityType { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for IdentityType { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct SignIdentity { + // message fields + identity: ::protobuf::SingularPtrField, + challenge_hidden: ::protobuf::SingularField<::std::vec::Vec>, + challenge_visual: ::protobuf::SingularField<::std::string::String>, + ecdsa_curve_name: ::protobuf::SingularField<::std::string::String>, + // special fields + unknown_fields: ::protobuf::UnknownFields, + cached_size: ::protobuf::CachedSize, +} + +impl SignIdentity { + pub fn new() -> SignIdentity { + ::std::default::Default::default() + } + + // optional .hw.trezor.messages.crypto.IdentityType identity = 1; + + pub fn clear_identity(&mut self) { + self.identity.clear(); + } + + pub fn has_identity(&self) -> bool { + self.identity.is_some() + } + + // Param is passed by value, moved + pub fn set_identity(&mut self, v: IdentityType) { + self.identity = ::protobuf::SingularPtrField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_identity(&mut self) -> &mut IdentityType { + if self.identity.is_none() { + self.identity.set_default(); + } + self.identity.as_mut().unwrap() + } + + // Take field + pub fn take_identity(&mut self) -> IdentityType { + self.identity.take().unwrap_or_else(|| IdentityType::new()) + } + + pub fn get_identity(&self) -> &IdentityType { + self.identity.as_ref().unwrap_or_else(|| IdentityType::default_instance()) + } + + // optional bytes challenge_hidden = 2; + + pub fn clear_challenge_hidden(&mut self) { + self.challenge_hidden.clear(); + } + + pub fn has_challenge_hidden(&self) -> bool { + self.challenge_hidden.is_some() + } + + // Param is passed by value, moved + pub fn set_challenge_hidden(&mut self, v: ::std::vec::Vec) { + self.challenge_hidden = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_challenge_hidden(&mut self) -> &mut ::std::vec::Vec { + if self.challenge_hidden.is_none() { + self.challenge_hidden.set_default(); + } + self.challenge_hidden.as_mut().unwrap() + } + + // Take field + pub fn take_challenge_hidden(&mut self) -> ::std::vec::Vec { + self.challenge_hidden.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + pub fn get_challenge_hidden(&self) -> &[u8] { + match self.challenge_hidden.as_ref() { + Some(v) => &v, + None => &[], + } + } + + // optional string challenge_visual = 3; + + pub fn clear_challenge_visual(&mut self) { + self.challenge_visual.clear(); + } + + pub fn has_challenge_visual(&self) -> bool { + self.challenge_visual.is_some() + } + + // Param is passed by value, moved + pub fn set_challenge_visual(&mut self, v: ::std::string::String) { + self.challenge_visual = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_challenge_visual(&mut self) -> &mut ::std::string::String { + if self.challenge_visual.is_none() { + self.challenge_visual.set_default(); + } + self.challenge_visual.as_mut().unwrap() + } + + // Take field + pub fn take_challenge_visual(&mut self) -> ::std::string::String { + self.challenge_visual.take().unwrap_or_else(|| ::std::string::String::new()) + } + + pub fn get_challenge_visual(&self) -> &str { + match self.challenge_visual.as_ref() { + Some(v) => &v, + None => "", + } + } + + // optional string ecdsa_curve_name = 4; + + pub fn clear_ecdsa_curve_name(&mut self) { + self.ecdsa_curve_name.clear(); + } + + pub fn has_ecdsa_curve_name(&self) -> bool { + self.ecdsa_curve_name.is_some() + } + + // Param is passed by value, moved + pub fn set_ecdsa_curve_name(&mut self, v: ::std::string::String) { + self.ecdsa_curve_name = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_ecdsa_curve_name(&mut self) -> &mut ::std::string::String { + if self.ecdsa_curve_name.is_none() { + self.ecdsa_curve_name.set_default(); + } + self.ecdsa_curve_name.as_mut().unwrap() + } + + // Take field + pub fn take_ecdsa_curve_name(&mut self) -> ::std::string::String { + self.ecdsa_curve_name.take().unwrap_or_else(|| ::std::string::String::new()) + } + + pub fn get_ecdsa_curve_name(&self) -> &str { + match self.ecdsa_curve_name.as_ref() { + Some(v) => &v, + None => "", + } + } +} + +impl ::protobuf::Message for SignIdentity { + fn is_initialized(&self) -> bool { + for v in &self.identity { + if !v.is_initialized() { + return false; + } + }; + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.identity)?; + }, + 2 => { + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.challenge_hidden)?; + }, + 3 => { + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.challenge_visual)?; + }, + 4 => { + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.ecdsa_curve_name)?; + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if let Some(ref v) = self.identity.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + } + if let Some(ref v) = self.challenge_hidden.as_ref() { + my_size += ::protobuf::rt::bytes_size(2, &v); + } + if let Some(ref v) = self.challenge_visual.as_ref() { + my_size += ::protobuf::rt::string_size(3, &v); + } + if let Some(ref v) = self.ecdsa_curve_name.as_ref() { + my_size += ::protobuf::rt::string_size(4, &v); + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + if let Some(ref v) = self.identity.as_ref() { + os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + } + if let Some(ref v) = self.challenge_hidden.as_ref() { + os.write_bytes(2, &v)?; + } + if let Some(ref v) = self.challenge_visual.as_ref() { + os.write_string(3, &v)?; + } + if let Some(ref v) = self.ecdsa_curve_name.as_ref() { + os.write_string(4, &v)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &::std::any::Any { + self as &::std::any::Any + } + fn as_any_mut(&mut self) -> &mut ::std::any::Any { + self as &mut ::std::any::Any + } + fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> SignIdentity { + SignIdentity::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "identity", + |m: &SignIdentity| { &m.identity }, + |m: &mut SignIdentity| { &mut m.identity }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "challenge_hidden", + |m: &SignIdentity| { &m.challenge_hidden }, + |m: &mut SignIdentity| { &mut m.challenge_hidden }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "challenge_visual", + |m: &SignIdentity| { &m.challenge_visual }, + |m: &mut SignIdentity| { &mut m.challenge_visual }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "ecdsa_curve_name", + |m: &SignIdentity| { &m.ecdsa_curve_name }, + |m: &mut SignIdentity| { &mut m.ecdsa_curve_name }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "SignIdentity", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static SignIdentity { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const SignIdentity, + }; + unsafe { + instance.get(SignIdentity::new) + } + } +} + +impl ::protobuf::Clear for SignIdentity { + fn clear(&mut self) { + self.clear_identity(); + self.clear_challenge_hidden(); + self.clear_challenge_visual(); + self.clear_ecdsa_curve_name(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for SignIdentity { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for SignIdentity { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct SignedIdentity { + // message fields + address: ::protobuf::SingularField<::std::string::String>, + public_key: ::protobuf::SingularField<::std::vec::Vec>, + signature: ::protobuf::SingularField<::std::vec::Vec>, + // special fields + unknown_fields: ::protobuf::UnknownFields, + cached_size: ::protobuf::CachedSize, +} + +impl SignedIdentity { + pub fn new() -> SignedIdentity { + ::std::default::Default::default() + } + + // optional string address = 1; + + pub fn clear_address(&mut self) { + self.address.clear(); + } + + pub fn has_address(&self) -> bool { + self.address.is_some() + } + + // Param is passed by value, moved + pub fn set_address(&mut self, v: ::std::string::String) { + self.address = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_address(&mut self) -> &mut ::std::string::String { + if self.address.is_none() { + self.address.set_default(); + } + self.address.as_mut().unwrap() + } + + // Take field + pub fn take_address(&mut self) -> ::std::string::String { + self.address.take().unwrap_or_else(|| ::std::string::String::new()) + } + + pub fn get_address(&self) -> &str { + match self.address.as_ref() { + Some(v) => &v, + None => "", + } + } + + // optional bytes public_key = 2; + + pub fn clear_public_key(&mut self) { + self.public_key.clear(); + } + + pub fn has_public_key(&self) -> bool { + self.public_key.is_some() + } + + // Param is passed by value, moved + pub fn set_public_key(&mut self, v: ::std::vec::Vec) { + self.public_key = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_public_key(&mut self) -> &mut ::std::vec::Vec { + if self.public_key.is_none() { + self.public_key.set_default(); + } + self.public_key.as_mut().unwrap() + } + + // Take field + pub fn take_public_key(&mut self) -> ::std::vec::Vec { + self.public_key.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + pub fn get_public_key(&self) -> &[u8] { + match self.public_key.as_ref() { + Some(v) => &v, + None => &[], + } + } + + // optional bytes signature = 3; + + pub fn clear_signature(&mut self) { + self.signature.clear(); + } + + pub fn has_signature(&self) -> bool { + self.signature.is_some() + } + + // Param is passed by value, moved + pub fn set_signature(&mut self, v: ::std::vec::Vec) { + self.signature = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_signature(&mut self) -> &mut ::std::vec::Vec { + if self.signature.is_none() { + self.signature.set_default(); + } + self.signature.as_mut().unwrap() + } + + // Take field + pub fn take_signature(&mut self) -> ::std::vec::Vec { + self.signature.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + pub fn get_signature(&self) -> &[u8] { + match self.signature.as_ref() { + Some(v) => &v, + None => &[], + } + } +} + +impl ::protobuf::Message for SignedIdentity { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.address)?; + }, + 2 => { + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.public_key)?; + }, + 3 => { + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.signature)?; + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if let Some(ref v) = self.address.as_ref() { + my_size += ::protobuf::rt::string_size(1, &v); + } + if let Some(ref v) = self.public_key.as_ref() { + my_size += ::protobuf::rt::bytes_size(2, &v); + } + if let Some(ref v) = self.signature.as_ref() { + my_size += ::protobuf::rt::bytes_size(3, &v); + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + if let Some(ref v) = self.address.as_ref() { + os.write_string(1, &v)?; + } + if let Some(ref v) = self.public_key.as_ref() { + os.write_bytes(2, &v)?; + } + if let Some(ref v) = self.signature.as_ref() { + os.write_bytes(3, &v)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &::std::any::Any { + self as &::std::any::Any + } + fn as_any_mut(&mut self) -> &mut ::std::any::Any { + self as &mut ::std::any::Any + } + fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> SignedIdentity { + SignedIdentity::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "address", + |m: &SignedIdentity| { &m.address }, + |m: &mut SignedIdentity| { &mut m.address }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "public_key", + |m: &SignedIdentity| { &m.public_key }, + |m: &mut SignedIdentity| { &mut m.public_key }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "signature", + |m: &SignedIdentity| { &m.signature }, + |m: &mut SignedIdentity| { &mut m.signature }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "SignedIdentity", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static SignedIdentity { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const SignedIdentity, + }; + unsafe { + instance.get(SignedIdentity::new) + } + } +} + +impl ::protobuf::Clear for SignedIdentity { + fn clear(&mut self) { + self.clear_address(); + self.clear_public_key(); + self.clear_signature(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for SignedIdentity { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for SignedIdentity { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct GetECDHSessionKey { + // message fields + identity: ::protobuf::SingularPtrField, + peer_public_key: ::protobuf::SingularField<::std::vec::Vec>, + ecdsa_curve_name: ::protobuf::SingularField<::std::string::String>, + // special fields + unknown_fields: ::protobuf::UnknownFields, + cached_size: ::protobuf::CachedSize, +} + +impl GetECDHSessionKey { + pub fn new() -> GetECDHSessionKey { + ::std::default::Default::default() + } + + // optional .hw.trezor.messages.crypto.IdentityType identity = 1; + + pub fn clear_identity(&mut self) { + self.identity.clear(); + } + + pub fn has_identity(&self) -> bool { + self.identity.is_some() + } + + // Param is passed by value, moved + pub fn set_identity(&mut self, v: IdentityType) { + self.identity = ::protobuf::SingularPtrField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_identity(&mut self) -> &mut IdentityType { + if self.identity.is_none() { + self.identity.set_default(); + } + self.identity.as_mut().unwrap() + } + + // Take field + pub fn take_identity(&mut self) -> IdentityType { + self.identity.take().unwrap_or_else(|| IdentityType::new()) + } + + pub fn get_identity(&self) -> &IdentityType { + self.identity.as_ref().unwrap_or_else(|| IdentityType::default_instance()) + } + + // optional bytes peer_public_key = 2; + + pub fn clear_peer_public_key(&mut self) { + self.peer_public_key.clear(); + } + + pub fn has_peer_public_key(&self) -> bool { + self.peer_public_key.is_some() + } + + // Param is passed by value, moved + pub fn set_peer_public_key(&mut self, v: ::std::vec::Vec) { + self.peer_public_key = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_peer_public_key(&mut self) -> &mut ::std::vec::Vec { + if self.peer_public_key.is_none() { + self.peer_public_key.set_default(); + } + self.peer_public_key.as_mut().unwrap() + } + + // Take field + pub fn take_peer_public_key(&mut self) -> ::std::vec::Vec { + self.peer_public_key.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + pub fn get_peer_public_key(&self) -> &[u8] { + match self.peer_public_key.as_ref() { + Some(v) => &v, + None => &[], + } + } + + // optional string ecdsa_curve_name = 3; + + pub fn clear_ecdsa_curve_name(&mut self) { + self.ecdsa_curve_name.clear(); + } + + pub fn has_ecdsa_curve_name(&self) -> bool { + self.ecdsa_curve_name.is_some() + } + + // Param is passed by value, moved + pub fn set_ecdsa_curve_name(&mut self, v: ::std::string::String) { + self.ecdsa_curve_name = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_ecdsa_curve_name(&mut self) -> &mut ::std::string::String { + if self.ecdsa_curve_name.is_none() { + self.ecdsa_curve_name.set_default(); + } + self.ecdsa_curve_name.as_mut().unwrap() + } + + // Take field + pub fn take_ecdsa_curve_name(&mut self) -> ::std::string::String { + self.ecdsa_curve_name.take().unwrap_or_else(|| ::std::string::String::new()) + } + + pub fn get_ecdsa_curve_name(&self) -> &str { + match self.ecdsa_curve_name.as_ref() { + Some(v) => &v, + None => "", + } + } +} + +impl ::protobuf::Message for GetECDHSessionKey { + fn is_initialized(&self) -> bool { + for v in &self.identity { + if !v.is_initialized() { + return false; + } + }; + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.identity)?; + }, + 2 => { + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.peer_public_key)?; + }, + 3 => { + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.ecdsa_curve_name)?; + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if let Some(ref v) = self.identity.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + } + if let Some(ref v) = self.peer_public_key.as_ref() { + my_size += ::protobuf::rt::bytes_size(2, &v); + } + if let Some(ref v) = self.ecdsa_curve_name.as_ref() { + my_size += ::protobuf::rt::string_size(3, &v); + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + if let Some(ref v) = self.identity.as_ref() { + os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + } + if let Some(ref v) = self.peer_public_key.as_ref() { + os.write_bytes(2, &v)?; + } + if let Some(ref v) = self.ecdsa_curve_name.as_ref() { + os.write_string(3, &v)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &::std::any::Any { + self as &::std::any::Any + } + fn as_any_mut(&mut self) -> &mut ::std::any::Any { + self as &mut ::std::any::Any + } + fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> GetECDHSessionKey { + GetECDHSessionKey::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "identity", + |m: &GetECDHSessionKey| { &m.identity }, + |m: &mut GetECDHSessionKey| { &mut m.identity }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "peer_public_key", + |m: &GetECDHSessionKey| { &m.peer_public_key }, + |m: &mut GetECDHSessionKey| { &mut m.peer_public_key }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "ecdsa_curve_name", + |m: &GetECDHSessionKey| { &m.ecdsa_curve_name }, + |m: &mut GetECDHSessionKey| { &mut m.ecdsa_curve_name }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "GetECDHSessionKey", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static GetECDHSessionKey { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const GetECDHSessionKey, + }; + unsafe { + instance.get(GetECDHSessionKey::new) + } + } +} + +impl ::protobuf::Clear for GetECDHSessionKey { + fn clear(&mut self) { + self.clear_identity(); + self.clear_peer_public_key(); + self.clear_ecdsa_curve_name(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for GetECDHSessionKey { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for GetECDHSessionKey { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct ECDHSessionKey { + // message fields + session_key: ::protobuf::SingularField<::std::vec::Vec>, + // special fields + unknown_fields: ::protobuf::UnknownFields, + cached_size: ::protobuf::CachedSize, +} + +impl ECDHSessionKey { + pub fn new() -> ECDHSessionKey { + ::std::default::Default::default() + } + + // optional bytes session_key = 1; + + pub fn clear_session_key(&mut self) { + self.session_key.clear(); + } + + pub fn has_session_key(&self) -> bool { + self.session_key.is_some() + } + + // Param is passed by value, moved + pub fn set_session_key(&mut self, v: ::std::vec::Vec) { + self.session_key = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_session_key(&mut self) -> &mut ::std::vec::Vec { + if self.session_key.is_none() { + self.session_key.set_default(); + } + self.session_key.as_mut().unwrap() + } + + // Take field + pub fn take_session_key(&mut self) -> ::std::vec::Vec { + self.session_key.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + pub fn get_session_key(&self) -> &[u8] { + match self.session_key.as_ref() { + Some(v) => &v, + None => &[], + } + } +} + +impl ::protobuf::Message for ECDHSessionKey { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.session_key)?; + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if let Some(ref v) = self.session_key.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &v); + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + if let Some(ref v) = self.session_key.as_ref() { + os.write_bytes(1, &v)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &::std::any::Any { + self as &::std::any::Any + } + fn as_any_mut(&mut self) -> &mut ::std::any::Any { + self as &mut ::std::any::Any + } + fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> ECDHSessionKey { + ECDHSessionKey::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "session_key", + |m: &ECDHSessionKey| { &m.session_key }, + |m: &mut ECDHSessionKey| { &mut m.session_key }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "ECDHSessionKey", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static ECDHSessionKey { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ECDHSessionKey, + }; + unsafe { + instance.get(ECDHSessionKey::new) + } + } +} + +impl ::protobuf::Clear for ECDHSessionKey { + fn clear(&mut self) { + self.clear_session_key(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for ECDHSessionKey { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for ECDHSessionKey { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct CosiCommit { + // message fields + address_n: ::std::vec::Vec, + data: ::protobuf::SingularField<::std::vec::Vec>, + // special fields + unknown_fields: ::protobuf::UnknownFields, + cached_size: ::protobuf::CachedSize, +} + +impl CosiCommit { + pub fn new() -> CosiCommit { + ::std::default::Default::default() + } + + // repeated uint32 address_n = 1; + + pub fn clear_address_n(&mut self) { + self.address_n.clear(); + } + + // Param is passed by value, moved + pub fn set_address_n(&mut self, v: ::std::vec::Vec) { + self.address_n = v; + } + + // Mutable pointer to the field. + pub fn mut_address_n(&mut self) -> &mut ::std::vec::Vec { + &mut self.address_n + } + + // Take field + pub fn take_address_n(&mut self) -> ::std::vec::Vec { + ::std::mem::replace(&mut self.address_n, ::std::vec::Vec::new()) + } + + pub fn get_address_n(&self) -> &[u32] { + &self.address_n + } + + // optional bytes data = 2; + + pub fn clear_data(&mut self) { + self.data.clear(); + } + + pub fn has_data(&self) -> bool { + self.data.is_some() + } + + // Param is passed by value, moved + pub fn set_data(&mut self, v: ::std::vec::Vec) { + self.data = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_data(&mut self) -> &mut ::std::vec::Vec { + if self.data.is_none() { + self.data.set_default(); + } + self.data.as_mut().unwrap() + } + + // Take field + pub fn take_data(&mut self) -> ::std::vec::Vec { + self.data.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + pub fn get_data(&self) -> &[u8] { + match self.data.as_ref() { + Some(v) => &v, + None => &[], + } + } +} + +impl ::protobuf::Message for CosiCommit { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_repeated_uint32_into(wire_type, is, &mut self.address_n)?; + }, + 2 => { + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.data)?; + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + for value in &self.address_n { + my_size += ::protobuf::rt::value_size(1, *value, ::protobuf::wire_format::WireTypeVarint); + }; + if let Some(ref v) = self.data.as_ref() { + my_size += ::protobuf::rt::bytes_size(2, &v); + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + for v in &self.address_n { + os.write_uint32(1, *v)?; + }; + if let Some(ref v) = self.data.as_ref() { + os.write_bytes(2, &v)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &::std::any::Any { + self as &::std::any::Any + } + fn as_any_mut(&mut self) -> &mut ::std::any::Any { + self as &mut ::std::any::Any + } + fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> CosiCommit { + CosiCommit::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_vec_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( + "address_n", + |m: &CosiCommit| { &m.address_n }, + |m: &mut CosiCommit| { &mut m.address_n }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "data", + |m: &CosiCommit| { &m.data }, + |m: &mut CosiCommit| { &mut m.data }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "CosiCommit", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static CosiCommit { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const CosiCommit, + }; + unsafe { + instance.get(CosiCommit::new) + } + } +} + +impl ::protobuf::Clear for CosiCommit { + fn clear(&mut self) { + self.clear_address_n(); + self.clear_data(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for CosiCommit { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for CosiCommit { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct CosiCommitment { + // message fields + commitment: ::protobuf::SingularField<::std::vec::Vec>, + pubkey: ::protobuf::SingularField<::std::vec::Vec>, + // special fields + unknown_fields: ::protobuf::UnknownFields, + cached_size: ::protobuf::CachedSize, +} + +impl CosiCommitment { + pub fn new() -> CosiCommitment { + ::std::default::Default::default() + } + + // optional bytes commitment = 1; + + pub fn clear_commitment(&mut self) { + self.commitment.clear(); + } + + pub fn has_commitment(&self) -> bool { + self.commitment.is_some() + } + + // Param is passed by value, moved + pub fn set_commitment(&mut self, v: ::std::vec::Vec) { + self.commitment = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_commitment(&mut self) -> &mut ::std::vec::Vec { + if self.commitment.is_none() { + self.commitment.set_default(); + } + self.commitment.as_mut().unwrap() + } + + // Take field + pub fn take_commitment(&mut self) -> ::std::vec::Vec { + self.commitment.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + pub fn get_commitment(&self) -> &[u8] { + match self.commitment.as_ref() { + Some(v) => &v, + None => &[], + } + } + + // optional bytes pubkey = 2; + + pub fn clear_pubkey(&mut self) { + self.pubkey.clear(); + } + + pub fn has_pubkey(&self) -> bool { + self.pubkey.is_some() + } + + // Param is passed by value, moved + pub fn set_pubkey(&mut self, v: ::std::vec::Vec) { + self.pubkey = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_pubkey(&mut self) -> &mut ::std::vec::Vec { + if self.pubkey.is_none() { + self.pubkey.set_default(); + } + self.pubkey.as_mut().unwrap() + } + + // Take field + pub fn take_pubkey(&mut self) -> ::std::vec::Vec { + self.pubkey.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + pub fn get_pubkey(&self) -> &[u8] { + match self.pubkey.as_ref() { + Some(v) => &v, + None => &[], + } + } +} + +impl ::protobuf::Message for CosiCommitment { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.commitment)?; + }, + 2 => { + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.pubkey)?; + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if let Some(ref v) = self.commitment.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &v); + } + if let Some(ref v) = self.pubkey.as_ref() { + my_size += ::protobuf::rt::bytes_size(2, &v); + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + if let Some(ref v) = self.commitment.as_ref() { + os.write_bytes(1, &v)?; + } + if let Some(ref v) = self.pubkey.as_ref() { + os.write_bytes(2, &v)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &::std::any::Any { + self as &::std::any::Any + } + fn as_any_mut(&mut self) -> &mut ::std::any::Any { + self as &mut ::std::any::Any + } + fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> CosiCommitment { + CosiCommitment::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "commitment", + |m: &CosiCommitment| { &m.commitment }, + |m: &mut CosiCommitment| { &mut m.commitment }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "pubkey", + |m: &CosiCommitment| { &m.pubkey }, + |m: &mut CosiCommitment| { &mut m.pubkey }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "CosiCommitment", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static CosiCommitment { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const CosiCommitment, + }; + unsafe { + instance.get(CosiCommitment::new) + } + } +} + +impl ::protobuf::Clear for CosiCommitment { + fn clear(&mut self) { + self.clear_commitment(); + self.clear_pubkey(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for CosiCommitment { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for CosiCommitment { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct CosiSign { + // message fields + address_n: ::std::vec::Vec, + data: ::protobuf::SingularField<::std::vec::Vec>, + global_commitment: ::protobuf::SingularField<::std::vec::Vec>, + global_pubkey: ::protobuf::SingularField<::std::vec::Vec>, + // special fields + unknown_fields: ::protobuf::UnknownFields, + cached_size: ::protobuf::CachedSize, +} + +impl CosiSign { + pub fn new() -> CosiSign { + ::std::default::Default::default() + } + + // repeated uint32 address_n = 1; + + pub fn clear_address_n(&mut self) { + self.address_n.clear(); + } + + // Param is passed by value, moved + pub fn set_address_n(&mut self, v: ::std::vec::Vec) { + self.address_n = v; + } + + // Mutable pointer to the field. + pub fn mut_address_n(&mut self) -> &mut ::std::vec::Vec { + &mut self.address_n + } + + // Take field + pub fn take_address_n(&mut self) -> ::std::vec::Vec { + ::std::mem::replace(&mut self.address_n, ::std::vec::Vec::new()) + } + + pub fn get_address_n(&self) -> &[u32] { + &self.address_n + } + + // optional bytes data = 2; + + pub fn clear_data(&mut self) { + self.data.clear(); + } + + pub fn has_data(&self) -> bool { + self.data.is_some() + } + + // Param is passed by value, moved + pub fn set_data(&mut self, v: ::std::vec::Vec) { + self.data = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_data(&mut self) -> &mut ::std::vec::Vec { + if self.data.is_none() { + self.data.set_default(); + } + self.data.as_mut().unwrap() + } + + // Take field + pub fn take_data(&mut self) -> ::std::vec::Vec { + self.data.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + pub fn get_data(&self) -> &[u8] { + match self.data.as_ref() { + Some(v) => &v, + None => &[], + } + } + + // optional bytes global_commitment = 3; + + pub fn clear_global_commitment(&mut self) { + self.global_commitment.clear(); + } + + pub fn has_global_commitment(&self) -> bool { + self.global_commitment.is_some() + } + + // Param is passed by value, moved + pub fn set_global_commitment(&mut self, v: ::std::vec::Vec) { + self.global_commitment = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_global_commitment(&mut self) -> &mut ::std::vec::Vec { + if self.global_commitment.is_none() { + self.global_commitment.set_default(); + } + self.global_commitment.as_mut().unwrap() + } + + // Take field + pub fn take_global_commitment(&mut self) -> ::std::vec::Vec { + self.global_commitment.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + pub fn get_global_commitment(&self) -> &[u8] { + match self.global_commitment.as_ref() { + Some(v) => &v, + None => &[], + } + } + + // optional bytes global_pubkey = 4; + + pub fn clear_global_pubkey(&mut self) { + self.global_pubkey.clear(); + } + + pub fn has_global_pubkey(&self) -> bool { + self.global_pubkey.is_some() + } + + // Param is passed by value, moved + pub fn set_global_pubkey(&mut self, v: ::std::vec::Vec) { + self.global_pubkey = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_global_pubkey(&mut self) -> &mut ::std::vec::Vec { + if self.global_pubkey.is_none() { + self.global_pubkey.set_default(); + } + self.global_pubkey.as_mut().unwrap() + } + + // Take field + pub fn take_global_pubkey(&mut self) -> ::std::vec::Vec { + self.global_pubkey.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + pub fn get_global_pubkey(&self) -> &[u8] { + match self.global_pubkey.as_ref() { + Some(v) => &v, + None => &[], + } + } +} + +impl ::protobuf::Message for CosiSign { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_repeated_uint32_into(wire_type, is, &mut self.address_n)?; + }, + 2 => { + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.data)?; + }, + 3 => { + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.global_commitment)?; + }, + 4 => { + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.global_pubkey)?; + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + for value in &self.address_n { + my_size += ::protobuf::rt::value_size(1, *value, ::protobuf::wire_format::WireTypeVarint); + }; + if let Some(ref v) = self.data.as_ref() { + my_size += ::protobuf::rt::bytes_size(2, &v); + } + if let Some(ref v) = self.global_commitment.as_ref() { + my_size += ::protobuf::rt::bytes_size(3, &v); + } + if let Some(ref v) = self.global_pubkey.as_ref() { + my_size += ::protobuf::rt::bytes_size(4, &v); + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + for v in &self.address_n { + os.write_uint32(1, *v)?; + }; + if let Some(ref v) = self.data.as_ref() { + os.write_bytes(2, &v)?; + } + if let Some(ref v) = self.global_commitment.as_ref() { + os.write_bytes(3, &v)?; + } + if let Some(ref v) = self.global_pubkey.as_ref() { + os.write_bytes(4, &v)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &::std::any::Any { + self as &::std::any::Any + } + fn as_any_mut(&mut self) -> &mut ::std::any::Any { + self as &mut ::std::any::Any + } + fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> CosiSign { + CosiSign::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_vec_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( + "address_n", + |m: &CosiSign| { &m.address_n }, + |m: &mut CosiSign| { &mut m.address_n }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "data", + |m: &CosiSign| { &m.data }, + |m: &mut CosiSign| { &mut m.data }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "global_commitment", + |m: &CosiSign| { &m.global_commitment }, + |m: &mut CosiSign| { &mut m.global_commitment }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "global_pubkey", + |m: &CosiSign| { &m.global_pubkey }, + |m: &mut CosiSign| { &mut m.global_pubkey }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "CosiSign", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static CosiSign { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const CosiSign, + }; + unsafe { + instance.get(CosiSign::new) + } + } +} + +impl ::protobuf::Clear for CosiSign { + fn clear(&mut self) { + self.clear_address_n(); + self.clear_data(); + self.clear_global_commitment(); + self.clear_global_pubkey(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for CosiSign { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for CosiSign { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct CosiSignature { + // message fields + signature: ::protobuf::SingularField<::std::vec::Vec>, + // special fields + unknown_fields: ::protobuf::UnknownFields, + cached_size: ::protobuf::CachedSize, +} + +impl CosiSignature { + pub fn new() -> CosiSignature { + ::std::default::Default::default() + } + + // optional bytes signature = 1; + + pub fn clear_signature(&mut self) { + self.signature.clear(); + } + + pub fn has_signature(&self) -> bool { + self.signature.is_some() + } + + // Param is passed by value, moved + pub fn set_signature(&mut self, v: ::std::vec::Vec) { + self.signature = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_signature(&mut self) -> &mut ::std::vec::Vec { + if self.signature.is_none() { + self.signature.set_default(); + } + self.signature.as_mut().unwrap() + } + + // Take field + pub fn take_signature(&mut self) -> ::std::vec::Vec { + self.signature.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + pub fn get_signature(&self) -> &[u8] { + match self.signature.as_ref() { + Some(v) => &v, + None => &[], + } + } +} + +impl ::protobuf::Message for CosiSignature { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.signature)?; + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if let Some(ref v) = self.signature.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &v); + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + if let Some(ref v) = self.signature.as_ref() { + os.write_bytes(1, &v)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &::std::any::Any { + self as &::std::any::Any + } + fn as_any_mut(&mut self) -> &mut ::std::any::Any { + self as &mut ::std::any::Any + } + fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> CosiSignature { + CosiSignature::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "signature", + |m: &CosiSignature| { &m.signature }, + |m: &mut CosiSignature| { &mut m.signature }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "CosiSignature", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static CosiSignature { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const CosiSignature, + }; + unsafe { + instance.get(CosiSignature::new) + } + } +} + +impl ::protobuf::Clear for CosiSignature { + fn clear(&mut self) { + self.clear_signature(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for CosiSignature { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for CosiSignature { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +static file_descriptor_proto_data: &'static [u8] = b"\ + \n\x15messages-crypto.proto\x12\x19hw.trezor.messages.crypto\"\xcb\x01\n\ + \x0eCipherKeyValue\x12\x1b\n\taddress_n\x18\x01\x20\x03(\rR\x08addressN\ + \x12\x10\n\x03key\x18\x02\x20\x01(\tR\x03key\x12\x14\n\x05value\x18\x03\ + \x20\x01(\x0cR\x05value\x12\x18\n\x07encrypt\x18\x04\x20\x01(\x08R\x07en\ + crypt\x12$\n\x0eask_on_encrypt\x18\x05\x20\x01(\x08R\x0caskOnEncrypt\x12\ + $\n\x0eask_on_decrypt\x18\x06\x20\x01(\x08R\x0caskOnDecrypt\x12\x0e\n\ + \x02iv\x18\x07\x20\x01(\x0cR\x02iv\"(\n\x10CipheredKeyValue\x12\x14\n\ + \x05value\x18\x01\x20\x01(\x0cR\x05value\"\x8d\x01\n\x0cIdentityType\x12\ + \x14\n\x05proto\x18\x01\x20\x01(\tR\x05proto\x12\x12\n\x04user\x18\x02\ + \x20\x01(\tR\x04user\x12\x12\n\x04host\x18\x03\x20\x01(\tR\x04host\x12\ + \x12\n\x04port\x18\x04\x20\x01(\tR\x04port\x12\x12\n\x04path\x18\x05\x20\ + \x01(\tR\x04path\x12\x17\n\x05index\x18\x06\x20\x01(\r:\x010R\x05index\"\ + \xd3\x01\n\x0cSignIdentity\x12C\n\x08identity\x18\x01\x20\x01(\x0b2'.hw.\ + trezor.messages.crypto.IdentityTypeR\x08identity\x12)\n\x10challenge_hid\ + den\x18\x02\x20\x01(\x0cR\x0fchallengeHidden\x12)\n\x10challenge_visual\ + \x18\x03\x20\x01(\tR\x0fchallengeVisual\x12(\n\x10ecdsa_curve_name\x18\ + \x04\x20\x01(\tR\x0eecdsaCurveName\"g\n\x0eSignedIdentity\x12\x18\n\x07a\ + ddress\x18\x01\x20\x01(\tR\x07address\x12\x1d\n\npublic_key\x18\x02\x20\ + \x01(\x0cR\tpublicKey\x12\x1c\n\tsignature\x18\x03\x20\x01(\x0cR\tsignat\ + ure\"\xaa\x01\n\x11GetECDHSessionKey\x12C\n\x08identity\x18\x01\x20\x01(\ + \x0b2'.hw.trezor.messages.crypto.IdentityTypeR\x08identity\x12&\n\x0fpee\ + r_public_key\x18\x02\x20\x01(\x0cR\rpeerPublicKey\x12(\n\x10ecdsa_curve_\ + name\x18\x03\x20\x01(\tR\x0eecdsaCurveName\"1\n\x0eECDHSessionKey\x12\ + \x1f\n\x0bsession_key\x18\x01\x20\x01(\x0cR\nsessionKey\"=\n\nCosiCommit\ + \x12\x1b\n\taddress_n\x18\x01\x20\x03(\rR\x08addressN\x12\x12\n\x04data\ + \x18\x02\x20\x01(\x0cR\x04data\"H\n\x0eCosiCommitment\x12\x1e\n\ncommitm\ + ent\x18\x01\x20\x01(\x0cR\ncommitment\x12\x16\n\x06pubkey\x18\x02\x20\ + \x01(\x0cR\x06pubkey\"\x8d\x01\n\x08CosiSign\x12\x1b\n\taddress_n\x18\ + \x01\x20\x03(\rR\x08addressN\x12\x12\n\x04data\x18\x02\x20\x01(\x0cR\x04\ + data\x12+\n\x11global_commitment\x18\x03\x20\x01(\x0cR\x10globalCommitme\ + nt\x12#\n\rglobal_pubkey\x18\x04\x20\x01(\x0cR\x0cglobalPubkey\"-\n\rCos\ + iSignature\x12\x1c\n\tsignature\x18\x01\x20\x01(\x0cR\tsignatureB:\n#com\ + .satoshilabs.trezor.lib.protobufB\x13TrezorMessageCryptoJ\xff\"\n\x06\ + \x12\x04\0\0~\x01\n\x08\n\x01\x0c\x12\x03\0\0\x12\n\x08\n\x01\x02\x12\ + \x03\x01\x08!\n\x08\n\x01\x08\x12\x03\x04\0<\n.\n\x02\x08\x01\x12\x03\ + \x04\0<\x1a#\x20Sugar\x20for\x20easier\x20handling\x20in\x20Java\n\n\x08\ + \n\x01\x08\x12\x03\x05\04\n\t\n\x02\x08\x08\x12\x03\x05\04\n{\n\x02\x04\ + \0\x12\x04\r\0\x15\x01\x1ao*\n\x20Request:\x20Ask\x20device\x20to\x20enc\ + rypt\x20or\x20decrypt\x20value\x20of\x20given\x20key\n\x20@start\n\x20@n\ + ext\x20CipheredKeyValue\n\x20@next\x20Failure\n\n\n\n\x03\x04\0\x01\x12\ + \x03\r\x08\x16\n=\n\x04\x04\0\x02\0\x12\x03\x0e\x04\"\"0\x20BIP-32\x20pa\ + th\x20to\x20derive\x20the\x20key\x20from\x20master\x20node\n\n\x0c\n\x05\ + \x04\0\x02\0\x04\x12\x03\x0e\x04\x0c\n\x0c\n\x05\x04\0\x02\0\x05\x12\x03\ + \x0e\r\x13\n\x0c\n\x05\x04\0\x02\0\x01\x12\x03\x0e\x14\x1d\n\x0c\n\x05\ + \x04\0\x02\0\x03\x12\x03\x0e\x20!\n)\n\x04\x04\0\x02\x01\x12\x03\x0f\x04\ + \x1c\"\x1c\x20key\x20component\x20of\x20key:value\n\n\x0c\n\x05\x04\0\ + \x02\x01\x04\x12\x03\x0f\x04\x0c\n\x0c\n\x05\x04\0\x02\x01\x05\x12\x03\ + \x0f\r\x13\n\x0c\n\x05\x04\0\x02\x01\x01\x12\x03\x0f\x14\x17\n\x0c\n\x05\ + \x04\0\x02\x01\x03\x12\x03\x0f\x1a\x1b\n+\n\x04\x04\0\x02\x02\x12\x03\ + \x10\x04\x1d\"\x1e\x20value\x20component\x20of\x20key:value\n\n\x0c\n\ + \x05\x04\0\x02\x02\x04\x12\x03\x10\x04\x0c\n\x0c\n\x05\x04\0\x02\x02\x05\ + \x12\x03\x10\r\x12\n\x0c\n\x05\x04\0\x02\x02\x01\x12\x03\x10\x13\x18\n\ + \x0c\n\x05\x04\0\x02\x02\x03\x12\x03\x10\x1b\x1c\n>\n\x04\x04\0\x02\x03\ + \x12\x03\x11\x04\x1e\"1\x20are\x20we\x20encrypting\x20(True)\x20or\x20de\ + crypting\x20(False)?\n\n\x0c\n\x05\x04\0\x02\x03\x04\x12\x03\x11\x04\x0c\ + \n\x0c\n\x05\x04\0\x02\x03\x05\x12\x03\x11\r\x11\n\x0c\n\x05\x04\0\x02\ + \x03\x01\x12\x03\x11\x12\x19\n\x0c\n\x05\x04\0\x02\x03\x03\x12\x03\x11\ + \x1c\x1d\n2\n\x04\x04\0\x02\x04\x12\x03\x12\x04%\"%\x20should\x20we\x20a\ + sk\x20on\x20encrypt\x20operation?\n\n\x0c\n\x05\x04\0\x02\x04\x04\x12\ + \x03\x12\x04\x0c\n\x0c\n\x05\x04\0\x02\x04\x05\x12\x03\x12\r\x11\n\x0c\n\ + \x05\x04\0\x02\x04\x01\x12\x03\x12\x12\x20\n\x0c\n\x05\x04\0\x02\x04\x03\ + \x12\x03\x12#$\n2\n\x04\x04\0\x02\x05\x12\x03\x13\x04%\"%\x20should\x20w\ + e\x20ask\x20on\x20decrypt\x20operation?\n\n\x0c\n\x05\x04\0\x02\x05\x04\ + \x12\x03\x13\x04\x0c\n\x0c\n\x05\x04\0\x02\x05\x05\x12\x03\x13\r\x11\n\ + \x0c\n\x05\x04\0\x02\x05\x01\x12\x03\x13\x12\x20\n\x0c\n\x05\x04\0\x02\ + \x05\x03\x12\x03\x13#$\nB\n\x04\x04\0\x02\x06\x12\x03\x14\x04\x1a\"5\x20\ + initialization\x20vector\x20(will\x20be\x20computed\x20if\x20not\x20set)\ + \n\n\x0c\n\x05\x04\0\x02\x06\x04\x12\x03\x14\x04\x0c\n\x0c\n\x05\x04\0\ + \x02\x06\x05\x12\x03\x14\r\x12\n\x0c\n\x05\x04\0\x02\x06\x01\x12\x03\x14\ + \x13\x15\n\x0c\n\x05\x04\0\x02\x06\x03\x12\x03\x14\x18\x19\n@\n\x02\x04\ + \x01\x12\x04\x1b\0\x1d\x01\x1a4*\n\x20Response:\x20Return\x20ciphered/de\ + ciphered\x20value\n\x20@end\n\n\n\n\x03\x04\x01\x01\x12\x03\x1b\x08\x18\ + \n(\n\x04\x04\x01\x02\0\x12\x03\x1c\x04\x1d\"\x1b\x20ciphered/deciphered\ + \x20value\n\n\x0c\n\x05\x04\x01\x02\0\x04\x12\x03\x1c\x04\x0c\n\x0c\n\ + \x05\x04\x01\x02\0\x05\x12\x03\x1c\r\x12\n\x0c\n\x05\x04\x01\x02\0\x01\ + \x12\x03\x1c\x13\x18\n\x0c\n\x05\x04\x01\x02\0\x03\x12\x03\x1c\x1b\x1c\n\ + <\n\x02\x04\x02\x12\x04#\0*\x01\x1a0*\n\x20Structure\x20representing\x20\ + identity\x20data\n\x20@embed\n\n\n\n\x03\x04\x02\x01\x12\x03#\x08\x14\n\ + \x20\n\x04\x04\x02\x02\0\x12\x03$\x04\x1e\"\x13\x20proto\x20part\x20of\ + \x20URI\n\n\x0c\n\x05\x04\x02\x02\0\x04\x12\x03$\x04\x0c\n\x0c\n\x05\x04\ + \x02\x02\0\x05\x12\x03$\r\x13\n\x0c\n\x05\x04\x02\x02\0\x01\x12\x03$\x14\ + \x19\n\x0c\n\x05\x04\x02\x02\0\x03\x12\x03$\x1c\x1d\n\x1f\n\x04\x04\x02\ + \x02\x01\x12\x03%\x04\x1d\"\x12\x20user\x20part\x20of\x20URI\n\n\x0c\n\ + \x05\x04\x02\x02\x01\x04\x12\x03%\x04\x0c\n\x0c\n\x05\x04\x02\x02\x01\ + \x05\x12\x03%\r\x13\n\x0c\n\x05\x04\x02\x02\x01\x01\x12\x03%\x14\x18\n\ + \x0c\n\x05\x04\x02\x02\x01\x03\x12\x03%\x1b\x1c\n\x1f\n\x04\x04\x02\x02\ + \x02\x12\x03&\x04\x1d\"\x12\x20host\x20part\x20of\x20URI\n\n\x0c\n\x05\ + \x04\x02\x02\x02\x04\x12\x03&\x04\x0c\n\x0c\n\x05\x04\x02\x02\x02\x05\ + \x12\x03&\r\x13\n\x0c\n\x05\x04\x02\x02\x02\x01\x12\x03&\x14\x18\n\x0c\n\ + \x05\x04\x02\x02\x02\x03\x12\x03&\x1b\x1c\n\x1f\n\x04\x04\x02\x02\x03\ + \x12\x03'\x04\x1d\"\x12\x20port\x20part\x20of\x20URI\n\n\x0c\n\x05\x04\ + \x02\x02\x03\x04\x12\x03'\x04\x0c\n\x0c\n\x05\x04\x02\x02\x03\x05\x12\ + \x03'\r\x13\n\x0c\n\x05\x04\x02\x02\x03\x01\x12\x03'\x14\x18\n\x0c\n\x05\ + \x04\x02\x02\x03\x03\x12\x03'\x1b\x1c\n\x1f\n\x04\x04\x02\x02\x04\x12\ + \x03(\x04\x1d\"\x12\x20path\x20part\x20of\x20URI\n\n\x0c\n\x05\x04\x02\ + \x02\x04\x04\x12\x03(\x04\x0c\n\x0c\n\x05\x04\x02\x02\x04\x05\x12\x03(\r\ + \x13\n\x0c\n\x05\x04\x02\x02\x04\x01\x12\x03(\x14\x18\n\x0c\n\x05\x04\ + \x02\x02\x04\x03\x12\x03(\x1b\x1c\n\x1d\n\x04\x04\x02\x02\x05\x12\x03)\ + \x04*\"\x10\x20identity\x20index\n\n\x0c\n\x05\x04\x02\x02\x05\x04\x12\ + \x03)\x04\x0c\n\x0c\n\x05\x04\x02\x02\x05\x05\x12\x03)\r\x13\n\x0c\n\x05\ + \x04\x02\x02\x05\x01\x12\x03)\x14\x19\n\x0c\n\x05\x04\x02\x02\x05\x03\ + \x12\x03)\x1c\x1d\n\x0c\n\x05\x04\x02\x02\x05\x08\x12\x03)\x1e)\n\x0c\n\ + \x05\x04\x02\x02\x05\x07\x12\x03)'(\na\n\x02\x04\x03\x12\x042\07\x01\x1a\ + U*\n\x20Request:\x20Ask\x20device\x20to\x20sign\x20identity\n\x20@start\ + \n\x20@next\x20SignedIdentity\n\x20@next\x20Failure\n\n\n\n\x03\x04\x03\ + \x01\x12\x032\x08\x14\n\x17\n\x04\x04\x03\x02\0\x12\x033\x04'\"\n\x20ide\ + ntity\n\n\x0c\n\x05\x04\x03\x02\0\x04\x12\x033\x04\x0c\n\x0c\n\x05\x04\ + \x03\x02\0\x06\x12\x033\r\x19\n\x0c\n\x05\x04\x03\x02\0\x01\x12\x033\x1a\ + \"\n\x0c\n\x05\x04\x03\x02\0\x03\x12\x033%&\n$\n\x04\x04\x03\x02\x01\x12\ + \x034\x04(\"\x17\x20non-visible\x20challenge\n\n\x0c\n\x05\x04\x03\x02\ + \x01\x04\x12\x034\x04\x0c\n\x0c\n\x05\x04\x03\x02\x01\x05\x12\x034\r\x12\ + \n\x0c\n\x05\x04\x03\x02\x01\x01\x12\x034\x13#\n\x0c\n\x05\x04\x03\x02\ + \x01\x03\x12\x034&'\n:\n\x04\x04\x03\x02\x02\x12\x035\x04)\"-\x20challen\ + ge\x20shown\x20on\x20display\x20(e.g.\x20date+time)\n\n\x0c\n\x05\x04\ + \x03\x02\x02\x04\x12\x035\x04\x0c\n\x0c\n\x05\x04\x03\x02\x02\x05\x12\ + \x035\r\x13\n\x0c\n\x05\x04\x03\x02\x02\x01\x12\x035\x14$\n\x0c\n\x05\ + \x04\x03\x02\x02\x03\x12\x035'(\n&\n\x04\x04\x03\x02\x03\x12\x036\x04)\"\ + \x19\x20ECDSA\x20curve\x20name\x20to\x20use\n\n\x0c\n\x05\x04\x03\x02\ + \x03\x04\x12\x036\x04\x0c\n\x0c\n\x05\x04\x03\x02\x03\x05\x12\x036\r\x13\ + \n\x0c\n\x05\x04\x03\x02\x03\x01\x12\x036\x14$\n\x0c\n\x05\x04\x03\x02\ + \x03\x03\x12\x036'(\n?\n\x02\x04\x04\x12\x04=\0A\x01\x1a3*\n\x20Response\ + :\x20Device\x20provides\x20signed\x20identity\n\x20@end\n\n\n\n\x03\x04\ + \x04\x01\x12\x03=\x08\x16\n\x1f\n\x04\x04\x04\x02\0\x12\x03>\x04\x20\"\ + \x12\x20identity\x20address\n\n\x0c\n\x05\x04\x04\x02\0\x04\x12\x03>\x04\ + \x0c\n\x0c\n\x05\x04\x04\x02\0\x05\x12\x03>\r\x13\n\x0c\n\x05\x04\x04\ + \x02\0\x01\x12\x03>\x14\x1b\n\x0c\n\x05\x04\x04\x02\0\x03\x12\x03>\x1e\ + \x1f\n\"\n\x04\x04\x04\x02\x01\x12\x03?\x04\"\"\x15\x20identity\x20publi\ + c\x20key\n\n\x0c\n\x05\x04\x04\x02\x01\x04\x12\x03?\x04\x0c\n\x0c\n\x05\ + \x04\x04\x02\x01\x05\x12\x03?\r\x12\n\x0c\n\x05\x04\x04\x02\x01\x01\x12\ + \x03?\x13\x1d\n\x0c\n\x05\x04\x04\x02\x01\x03\x12\x03?\x20!\n-\n\x04\x04\ + \x04\x02\x02\x12\x03@\x04!\"\x20\x20signature\x20of\x20the\x20identity\ + \x20data\n\n\x0c\n\x05\x04\x04\x02\x02\x04\x12\x03@\x04\x0c\n\x0c\n\x05\ + \x04\x04\x02\x02\x05\x12\x03@\r\x12\n\x0c\n\x05\x04\x04\x02\x02\x01\x12\ + \x03@\x13\x1c\n\x0c\n\x05\x04\x04\x02\x02\x03\x12\x03@\x1f\x20\nm\n\x02\ + \x04\x05\x12\x04I\0M\x01\x1aa*\n\x20Request:\x20Ask\x20device\x20to\x20g\ + enerate\x20ECDH\x20session\x20key\n\x20@start\n\x20@next\x20ECDHSessionK\ + ey\n\x20@next\x20Failure\n\n\n\n\x03\x04\x05\x01\x12\x03I\x08\x19\n\x17\ + \n\x04\x04\x05\x02\0\x12\x03J\x04'\"\n\x20identity\n\n\x0c\n\x05\x04\x05\ + \x02\0\x04\x12\x03J\x04\x0c\n\x0c\n\x05\x04\x05\x02\0\x06\x12\x03J\r\x19\ + \n\x0c\n\x05\x04\x05\x02\0\x01\x12\x03J\x1a\"\n\x0c\n\x05\x04\x05\x02\0\ + \x03\x12\x03J%&\n\x20\n\x04\x04\x05\x02\x01\x12\x03K\x04'\"\x13\x20peer'\ + s\x20public\x20key\n\n\x0c\n\x05\x04\x05\x02\x01\x04\x12\x03K\x04\x0c\n\ + \x0c\n\x05\x04\x05\x02\x01\x05\x12\x03K\r\x12\n\x0c\n\x05\x04\x05\x02\ + \x01\x01\x12\x03K\x13\"\n\x0c\n\x05\x04\x05\x02\x01\x03\x12\x03K%&\n&\n\ + \x04\x04\x05\x02\x02\x12\x03L\x04)\"\x19\x20ECDSA\x20curve\x20name\x20to\ + \x20use\n\n\x0c\n\x05\x04\x05\x02\x02\x04\x12\x03L\x04\x0c\n\x0c\n\x05\ + \x04\x05\x02\x02\x05\x12\x03L\r\x13\n\x0c\n\x05\x04\x05\x02\x02\x01\x12\ + \x03L\x14$\n\x0c\n\x05\x04\x05\x02\x02\x03\x12\x03L'(\n@\n\x02\x04\x06\ + \x12\x04S\0U\x01\x1a4*\n\x20Response:\x20Device\x20provides\x20ECDH\x20s\ + ession\x20key\n\x20@end\n\n\n\n\x03\x04\x06\x01\x12\x03S\x08\x16\n\x1f\n\ + \x04\x04\x06\x02\0\x12\x03T\x04#\"\x12\x20ECDH\x20session\x20key\n\n\x0c\ + \n\x05\x04\x06\x02\0\x04\x12\x03T\x04\x0c\n\x0c\n\x05\x04\x06\x02\0\x05\ + \x12\x03T\r\x12\n\x0c\n\x05\x04\x06\x02\0\x01\x12\x03T\x13\x1e\n\x0c\n\ + \x05\x04\x06\x02\0\x03\x12\x03T!\"\nj\n\x02\x04\x07\x12\x04]\0`\x01\x1a^\ + *\n\x20Request:\x20Ask\x20device\x20to\x20commit\x20to\x20CoSi\x20signin\ + g\n\x20@start\n\x20@next\x20CosiCommitment\n\x20@next\x20Failure\n\n\n\n\ + \x03\x04\x07\x01\x12\x03]\x08\x12\n=\n\x04\x04\x07\x02\0\x12\x03^\x04\"\ + \"0\x20BIP-32\x20path\x20to\x20derive\x20the\x20key\x20from\x20master\ + \x20node\n\n\x0c\n\x05\x04\x07\x02\0\x04\x12\x03^\x04\x0c\n\x0c\n\x05\ + \x04\x07\x02\0\x05\x12\x03^\r\x13\n\x0c\n\x05\x04\x07\x02\0\x01\x12\x03^\ + \x14\x1d\n\x0c\n\x05\x04\x07\x02\0\x03\x12\x03^\x20!\n\x20\n\x04\x04\x07\ + \x02\x01\x12\x03_\x04\x1c\"\x13\x20Data\x20to\x20be\x20signed\n\n\x0c\n\ + \x05\x04\x07\x02\x01\x04\x12\x03_\x04\x0c\n\x0c\n\x05\x04\x07\x02\x01\ + \x05\x12\x03_\r\x12\n\x0c\n\x05\x04\x07\x02\x01\x01\x12\x03_\x13\x17\n\ + \x0c\n\x05\x04\x07\x02\x01\x03\x12\x03_\x1a\x1b\n:\n\x02\x04\x08\x12\x04\ + f\0i\x01\x1a.*\n\x20Response:\x20Contains\x20a\x20CoSi\x20commitment\n\ + \x20@end\n\n\n\n\x03\x04\x08\x01\x12\x03f\x08\x16\n\x19\n\x04\x04\x08\ + \x02\0\x12\x03g\x04\"\"\x0c\x20Commitment\n\n\x0c\n\x05\x04\x08\x02\0\ + \x04\x12\x03g\x04\x0c\n\x0c\n\x05\x04\x08\x02\0\x05\x12\x03g\r\x12\n\x0c\ + \n\x05\x04\x08\x02\0\x01\x12\x03g\x13\x1d\n\x0c\n\x05\x04\x08\x02\0\x03\ + \x12\x03g\x20!\n\x19\n\x04\x04\x08\x02\x01\x12\x03h\x04\x1e\"\x0c\x20Pub\ + lic\x20key\n\n\x0c\n\x05\x04\x08\x02\x01\x04\x12\x03h\x04\x0c\n\x0c\n\ + \x05\x04\x08\x02\x01\x05\x12\x03h\r\x12\n\x0c\n\x05\x04\x08\x02\x01\x01\ + \x12\x03h\x13\x19\n\x0c\n\x05\x04\x08\x02\x01\x03\x12\x03h\x1c\x1d\nb\n\ + \x02\x04\t\x12\x04q\0v\x01\x1aV*\n\x20Request:\x20Ask\x20device\x20to\ + \x20sign\x20using\x20CoSi\n\x20@start\n\x20@next\x20CosiSignature\n\x20@\ + next\x20Failure\n\n\n\n\x03\x04\t\x01\x12\x03q\x08\x10\n=\n\x04\x04\t\ + \x02\0\x12\x03r\x04\"\"0\x20BIP-32\x20path\x20to\x20derive\x20the\x20key\ + \x20from\x20master\x20node\n\n\x0c\n\x05\x04\t\x02\0\x04\x12\x03r\x04\ + \x0c\n\x0c\n\x05\x04\t\x02\0\x05\x12\x03r\r\x13\n\x0c\n\x05\x04\t\x02\0\ + \x01\x12\x03r\x14\x1d\n\x0c\n\x05\x04\t\x02\0\x03\x12\x03r\x20!\n\x20\n\ + \x04\x04\t\x02\x01\x12\x03s\x04\x1c\"\x13\x20Data\x20to\x20be\x20signed\ + \n\n\x0c\n\x05\x04\t\x02\x01\x04\x12\x03s\x04\x0c\n\x0c\n\x05\x04\t\x02\ + \x01\x05\x12\x03s\r\x12\n\x0c\n\x05\x04\t\x02\x01\x01\x12\x03s\x13\x17\n\ + \x0c\n\x05\x04\t\x02\x01\x03\x12\x03s\x1a\x1b\n$\n\x04\x04\t\x02\x02\x12\ + \x03t\x04)\"\x17\x20Aggregated\x20commitment\n\n\x0c\n\x05\x04\t\x02\x02\ + \x04\x12\x03t\x04\x0c\n\x0c\n\x05\x04\t\x02\x02\x05\x12\x03t\r\x12\n\x0c\ + \n\x05\x04\t\x02\x02\x01\x12\x03t\x13$\n\x0c\n\x05\x04\t\x02\x02\x03\x12\ + \x03t'(\n$\n\x04\x04\t\x02\x03\x12\x03u\x04%\"\x17\x20Aggregated\x20publ\ + ic\x20key\n\n\x0c\n\x05\x04\t\x02\x03\x04\x12\x03u\x04\x0c\n\x0c\n\x05\ + \x04\t\x02\x03\x05\x12\x03u\r\x12\n\x0c\n\x05\x04\t\x02\x03\x01\x12\x03u\ + \x13\x20\n\x0c\n\x05\x04\t\x02\x03\x03\x12\x03u#$\n9\n\x02\x04\n\x12\x04\ + |\0~\x01\x1a-*\n\x20Response:\x20Contains\x20a\x20CoSi\x20signature\n\ + \x20@end\n\n\n\n\x03\x04\n\x01\x12\x03|\x08\x15\n\x18\n\x04\x04\n\x02\0\ + \x12\x03}\x04!\"\x0b\x20Signature\n\n\x0c\n\x05\x04\n\x02\0\x04\x12\x03}\ + \x04\x0c\n\x0c\n\x05\x04\n\x02\0\x05\x12\x03}\r\x12\n\x0c\n\x05\x04\n\ + \x02\0\x01\x12\x03}\x13\x1c\n\x0c\n\x05\x04\n\x02\0\x03\x12\x03}\x1f\x20\ +"; + +static mut file_descriptor_proto_lazy: ::protobuf::lazy::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::descriptor::FileDescriptorProto, +}; + +fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto { + ::protobuf::parse_from_bytes(file_descriptor_proto_data).unwrap() +} + +pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { + unsafe { + file_descriptor_proto_lazy.get(|| { + parse_descriptor_proto() + }) + } +} diff --git a/src/protos/messages_debug.rs b/src/protos/messages_debug.rs new file mode 100644 index 0000000..d085d41 --- /dev/null +++ b/src/protos/messages_debug.rs @@ -0,0 +1,2384 @@ +// This file is generated by rust-protobuf 2.0.4. Do not edit +// @generated + +// https://github.com/Manishearth/rust-clippy/issues/702 +#![allow(unknown_lints)] +#![allow(clippy)] + +#![cfg_attr(rustfmt, rustfmt_skip)] + +#![allow(box_pointers)] +#![allow(dead_code)] +#![allow(missing_docs)] +#![allow(non_camel_case_types)] +#![allow(non_snake_case)] +#![allow(non_upper_case_globals)] +#![allow(trivial_casts)] +#![allow(unsafe_code)] +#![allow(unused_imports)] +#![allow(unused_results)] + +use protobuf::Message as Message_imported_for_functions; +use protobuf::ProtobufEnum as ProtobufEnum_imported_for_functions; + +#[derive(PartialEq,Clone,Default)] +pub struct DebugLinkDecision { + // message fields + yes_no: ::std::option::Option, + up_down: ::std::option::Option, + input: ::protobuf::SingularField<::std::string::String>, + // special fields + unknown_fields: ::protobuf::UnknownFields, + cached_size: ::protobuf::CachedSize, +} + +impl DebugLinkDecision { + pub fn new() -> DebugLinkDecision { + ::std::default::Default::default() + } + + // optional bool yes_no = 1; + + pub fn clear_yes_no(&mut self) { + self.yes_no = ::std::option::Option::None; + } + + pub fn has_yes_no(&self) -> bool { + self.yes_no.is_some() + } + + // Param is passed by value, moved + pub fn set_yes_no(&mut self, v: bool) { + self.yes_no = ::std::option::Option::Some(v); + } + + pub fn get_yes_no(&self) -> bool { + self.yes_no.unwrap_or(false) + } + + // optional bool up_down = 2; + + pub fn clear_up_down(&mut self) { + self.up_down = ::std::option::Option::None; + } + + pub fn has_up_down(&self) -> bool { + self.up_down.is_some() + } + + // Param is passed by value, moved + pub fn set_up_down(&mut self, v: bool) { + self.up_down = ::std::option::Option::Some(v); + } + + pub fn get_up_down(&self) -> bool { + self.up_down.unwrap_or(false) + } + + // optional string input = 3; + + pub fn clear_input(&mut self) { + self.input.clear(); + } + + pub fn has_input(&self) -> bool { + self.input.is_some() + } + + // Param is passed by value, moved + pub fn set_input(&mut self, v: ::std::string::String) { + self.input = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_input(&mut self) -> &mut ::std::string::String { + if self.input.is_none() { + self.input.set_default(); + } + self.input.as_mut().unwrap() + } + + // Take field + pub fn take_input(&mut self) -> ::std::string::String { + self.input.take().unwrap_or_else(|| ::std::string::String::new()) + } + + pub fn get_input(&self) -> &str { + match self.input.as_ref() { + Some(v) => &v, + None => "", + } + } +} + +impl ::protobuf::Message for DebugLinkDecision { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_bool()?; + self.yes_no = ::std::option::Option::Some(tmp); + }, + 2 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_bool()?; + self.up_down = ::std::option::Option::Some(tmp); + }, + 3 => { + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.input)?; + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if let Some(v) = self.yes_no { + my_size += 2; + } + if let Some(v) = self.up_down { + my_size += 2; + } + if let Some(ref v) = self.input.as_ref() { + my_size += ::protobuf::rt::string_size(3, &v); + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + if let Some(v) = self.yes_no { + os.write_bool(1, v)?; + } + if let Some(v) = self.up_down { + os.write_bool(2, v)?; + } + if let Some(ref v) = self.input.as_ref() { + os.write_string(3, &v)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &::std::any::Any { + self as &::std::any::Any + } + fn as_any_mut(&mut self) -> &mut ::std::any::Any { + self as &mut ::std::any::Any + } + fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> DebugLinkDecision { + DebugLinkDecision::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "yes_no", + |m: &DebugLinkDecision| { &m.yes_no }, + |m: &mut DebugLinkDecision| { &mut m.yes_no }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "up_down", + |m: &DebugLinkDecision| { &m.up_down }, + |m: &mut DebugLinkDecision| { &mut m.up_down }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "input", + |m: &DebugLinkDecision| { &m.input }, + |m: &mut DebugLinkDecision| { &mut m.input }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "DebugLinkDecision", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static DebugLinkDecision { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const DebugLinkDecision, + }; + unsafe { + instance.get(DebugLinkDecision::new) + } + } +} + +impl ::protobuf::Clear for DebugLinkDecision { + fn clear(&mut self) { + self.clear_yes_no(); + self.clear_up_down(); + self.clear_input(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for DebugLinkDecision { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for DebugLinkDecision { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct DebugLinkGetState { + // special fields + unknown_fields: ::protobuf::UnknownFields, + cached_size: ::protobuf::CachedSize, +} + +impl DebugLinkGetState { + pub fn new() -> DebugLinkGetState { + ::std::default::Default::default() + } +} + +impl ::protobuf::Message for DebugLinkGetState { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &::std::any::Any { + self as &::std::any::Any + } + fn as_any_mut(&mut self) -> &mut ::std::any::Any { + self as &mut ::std::any::Any + } + fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> DebugLinkGetState { + DebugLinkGetState::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let fields = ::std::vec::Vec::new(); + ::protobuf::reflect::MessageDescriptor::new::( + "DebugLinkGetState", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static DebugLinkGetState { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const DebugLinkGetState, + }; + unsafe { + instance.get(DebugLinkGetState::new) + } + } +} + +impl ::protobuf::Clear for DebugLinkGetState { + fn clear(&mut self) { + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for DebugLinkGetState { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for DebugLinkGetState { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct DebugLinkState { + // message fields + layout: ::protobuf::SingularField<::std::vec::Vec>, + pin: ::protobuf::SingularField<::std::string::String>, + matrix: ::protobuf::SingularField<::std::string::String>, + mnemonic: ::protobuf::SingularField<::std::string::String>, + node: ::protobuf::SingularPtrField, + passphrase_protection: ::std::option::Option, + reset_word: ::protobuf::SingularField<::std::string::String>, + reset_entropy: ::protobuf::SingularField<::std::vec::Vec>, + recovery_fake_word: ::protobuf::SingularField<::std::string::String>, + recovery_word_pos: ::std::option::Option, + reset_word_pos: ::std::option::Option, + // special fields + unknown_fields: ::protobuf::UnknownFields, + cached_size: ::protobuf::CachedSize, +} + +impl DebugLinkState { + pub fn new() -> DebugLinkState { + ::std::default::Default::default() + } + + // optional bytes layout = 1; + + pub fn clear_layout(&mut self) { + self.layout.clear(); + } + + pub fn has_layout(&self) -> bool { + self.layout.is_some() + } + + // Param is passed by value, moved + pub fn set_layout(&mut self, v: ::std::vec::Vec) { + self.layout = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_layout(&mut self) -> &mut ::std::vec::Vec { + if self.layout.is_none() { + self.layout.set_default(); + } + self.layout.as_mut().unwrap() + } + + // Take field + pub fn take_layout(&mut self) -> ::std::vec::Vec { + self.layout.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + pub fn get_layout(&self) -> &[u8] { + match self.layout.as_ref() { + Some(v) => &v, + None => &[], + } + } + + // optional string pin = 2; + + pub fn clear_pin(&mut self) { + self.pin.clear(); + } + + pub fn has_pin(&self) -> bool { + self.pin.is_some() + } + + // Param is passed by value, moved + pub fn set_pin(&mut self, v: ::std::string::String) { + self.pin = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_pin(&mut self) -> &mut ::std::string::String { + if self.pin.is_none() { + self.pin.set_default(); + } + self.pin.as_mut().unwrap() + } + + // Take field + pub fn take_pin(&mut self) -> ::std::string::String { + self.pin.take().unwrap_or_else(|| ::std::string::String::new()) + } + + pub fn get_pin(&self) -> &str { + match self.pin.as_ref() { + Some(v) => &v, + None => "", + } + } + + // optional string matrix = 3; + + pub fn clear_matrix(&mut self) { + self.matrix.clear(); + } + + pub fn has_matrix(&self) -> bool { + self.matrix.is_some() + } + + // Param is passed by value, moved + pub fn set_matrix(&mut self, v: ::std::string::String) { + self.matrix = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_matrix(&mut self) -> &mut ::std::string::String { + if self.matrix.is_none() { + self.matrix.set_default(); + } + self.matrix.as_mut().unwrap() + } + + // Take field + pub fn take_matrix(&mut self) -> ::std::string::String { + self.matrix.take().unwrap_or_else(|| ::std::string::String::new()) + } + + pub fn get_matrix(&self) -> &str { + match self.matrix.as_ref() { + Some(v) => &v, + None => "", + } + } + + // optional string mnemonic = 4; + + pub fn clear_mnemonic(&mut self) { + self.mnemonic.clear(); + } + + pub fn has_mnemonic(&self) -> bool { + self.mnemonic.is_some() + } + + // Param is passed by value, moved + pub fn set_mnemonic(&mut self, v: ::std::string::String) { + self.mnemonic = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_mnemonic(&mut self) -> &mut ::std::string::String { + if self.mnemonic.is_none() { + self.mnemonic.set_default(); + } + self.mnemonic.as_mut().unwrap() + } + + // Take field + pub fn take_mnemonic(&mut self) -> ::std::string::String { + self.mnemonic.take().unwrap_or_else(|| ::std::string::String::new()) + } + + pub fn get_mnemonic(&self) -> &str { + match self.mnemonic.as_ref() { + Some(v) => &v, + None => "", + } + } + + // optional .hw.trezor.messages.common.HDNodeType node = 5; + + pub fn clear_node(&mut self) { + self.node.clear(); + } + + pub fn has_node(&self) -> bool { + self.node.is_some() + } + + // Param is passed by value, moved + pub fn set_node(&mut self, v: super::messages_common::HDNodeType) { + self.node = ::protobuf::SingularPtrField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_node(&mut self) -> &mut super::messages_common::HDNodeType { + if self.node.is_none() { + self.node.set_default(); + } + self.node.as_mut().unwrap() + } + + // Take field + pub fn take_node(&mut self) -> super::messages_common::HDNodeType { + self.node.take().unwrap_or_else(|| super::messages_common::HDNodeType::new()) + } + + pub fn get_node(&self) -> &super::messages_common::HDNodeType { + self.node.as_ref().unwrap_or_else(|| super::messages_common::HDNodeType::default_instance()) + } + + // optional bool passphrase_protection = 6; + + pub fn clear_passphrase_protection(&mut self) { + self.passphrase_protection = ::std::option::Option::None; + } + + pub fn has_passphrase_protection(&self) -> bool { + self.passphrase_protection.is_some() + } + + // Param is passed by value, moved + pub fn set_passphrase_protection(&mut self, v: bool) { + self.passphrase_protection = ::std::option::Option::Some(v); + } + + pub fn get_passphrase_protection(&self) -> bool { + self.passphrase_protection.unwrap_or(false) + } + + // optional string reset_word = 7; + + pub fn clear_reset_word(&mut self) { + self.reset_word.clear(); + } + + pub fn has_reset_word(&self) -> bool { + self.reset_word.is_some() + } + + // Param is passed by value, moved + pub fn set_reset_word(&mut self, v: ::std::string::String) { + self.reset_word = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_reset_word(&mut self) -> &mut ::std::string::String { + if self.reset_word.is_none() { + self.reset_word.set_default(); + } + self.reset_word.as_mut().unwrap() + } + + // Take field + pub fn take_reset_word(&mut self) -> ::std::string::String { + self.reset_word.take().unwrap_or_else(|| ::std::string::String::new()) + } + + pub fn get_reset_word(&self) -> &str { + match self.reset_word.as_ref() { + Some(v) => &v, + None => "", + } + } + + // optional bytes reset_entropy = 8; + + pub fn clear_reset_entropy(&mut self) { + self.reset_entropy.clear(); + } + + pub fn has_reset_entropy(&self) -> bool { + self.reset_entropy.is_some() + } + + // Param is passed by value, moved + pub fn set_reset_entropy(&mut self, v: ::std::vec::Vec) { + self.reset_entropy = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_reset_entropy(&mut self) -> &mut ::std::vec::Vec { + if self.reset_entropy.is_none() { + self.reset_entropy.set_default(); + } + self.reset_entropy.as_mut().unwrap() + } + + // Take field + pub fn take_reset_entropy(&mut self) -> ::std::vec::Vec { + self.reset_entropy.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + pub fn get_reset_entropy(&self) -> &[u8] { + match self.reset_entropy.as_ref() { + Some(v) => &v, + None => &[], + } + } + + // optional string recovery_fake_word = 9; + + pub fn clear_recovery_fake_word(&mut self) { + self.recovery_fake_word.clear(); + } + + pub fn has_recovery_fake_word(&self) -> bool { + self.recovery_fake_word.is_some() + } + + // Param is passed by value, moved + pub fn set_recovery_fake_word(&mut self, v: ::std::string::String) { + self.recovery_fake_word = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_recovery_fake_word(&mut self) -> &mut ::std::string::String { + if self.recovery_fake_word.is_none() { + self.recovery_fake_word.set_default(); + } + self.recovery_fake_word.as_mut().unwrap() + } + + // Take field + pub fn take_recovery_fake_word(&mut self) -> ::std::string::String { + self.recovery_fake_word.take().unwrap_or_else(|| ::std::string::String::new()) + } + + pub fn get_recovery_fake_word(&self) -> &str { + match self.recovery_fake_word.as_ref() { + Some(v) => &v, + None => "", + } + } + + // optional uint32 recovery_word_pos = 10; + + pub fn clear_recovery_word_pos(&mut self) { + self.recovery_word_pos = ::std::option::Option::None; + } + + pub fn has_recovery_word_pos(&self) -> bool { + self.recovery_word_pos.is_some() + } + + // Param is passed by value, moved + pub fn set_recovery_word_pos(&mut self, v: u32) { + self.recovery_word_pos = ::std::option::Option::Some(v); + } + + pub fn get_recovery_word_pos(&self) -> u32 { + self.recovery_word_pos.unwrap_or(0) + } + + // optional uint32 reset_word_pos = 11; + + pub fn clear_reset_word_pos(&mut self) { + self.reset_word_pos = ::std::option::Option::None; + } + + pub fn has_reset_word_pos(&self) -> bool { + self.reset_word_pos.is_some() + } + + // Param is passed by value, moved + pub fn set_reset_word_pos(&mut self, v: u32) { + self.reset_word_pos = ::std::option::Option::Some(v); + } + + pub fn get_reset_word_pos(&self) -> u32 { + self.reset_word_pos.unwrap_or(0) + } +} + +impl ::protobuf::Message for DebugLinkState { + fn is_initialized(&self) -> bool { + for v in &self.node { + if !v.is_initialized() { + return false; + } + }; + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.layout)?; + }, + 2 => { + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.pin)?; + }, + 3 => { + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.matrix)?; + }, + 4 => { + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.mnemonic)?; + }, + 5 => { + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.node)?; + }, + 6 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_bool()?; + self.passphrase_protection = ::std::option::Option::Some(tmp); + }, + 7 => { + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.reset_word)?; + }, + 8 => { + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.reset_entropy)?; + }, + 9 => { + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.recovery_fake_word)?; + }, + 10 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_uint32()?; + self.recovery_word_pos = ::std::option::Option::Some(tmp); + }, + 11 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_uint32()?; + self.reset_word_pos = ::std::option::Option::Some(tmp); + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if let Some(ref v) = self.layout.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &v); + } + if let Some(ref v) = self.pin.as_ref() { + my_size += ::protobuf::rt::string_size(2, &v); + } + if let Some(ref v) = self.matrix.as_ref() { + my_size += ::protobuf::rt::string_size(3, &v); + } + if let Some(ref v) = self.mnemonic.as_ref() { + my_size += ::protobuf::rt::string_size(4, &v); + } + if let Some(ref v) = self.node.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + } + if let Some(v) = self.passphrase_protection { + my_size += 2; + } + if let Some(ref v) = self.reset_word.as_ref() { + my_size += ::protobuf::rt::string_size(7, &v); + } + if let Some(ref v) = self.reset_entropy.as_ref() { + my_size += ::protobuf::rt::bytes_size(8, &v); + } + if let Some(ref v) = self.recovery_fake_word.as_ref() { + my_size += ::protobuf::rt::string_size(9, &v); + } + if let Some(v) = self.recovery_word_pos { + my_size += ::protobuf::rt::value_size(10, v, ::protobuf::wire_format::WireTypeVarint); + } + if let Some(v) = self.reset_word_pos { + my_size += ::protobuf::rt::value_size(11, v, ::protobuf::wire_format::WireTypeVarint); + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + if let Some(ref v) = self.layout.as_ref() { + os.write_bytes(1, &v)?; + } + if let Some(ref v) = self.pin.as_ref() { + os.write_string(2, &v)?; + } + if let Some(ref v) = self.matrix.as_ref() { + os.write_string(3, &v)?; + } + if let Some(ref v) = self.mnemonic.as_ref() { + os.write_string(4, &v)?; + } + if let Some(ref v) = self.node.as_ref() { + os.write_tag(5, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + } + if let Some(v) = self.passphrase_protection { + os.write_bool(6, v)?; + } + if let Some(ref v) = self.reset_word.as_ref() { + os.write_string(7, &v)?; + } + if let Some(ref v) = self.reset_entropy.as_ref() { + os.write_bytes(8, &v)?; + } + if let Some(ref v) = self.recovery_fake_word.as_ref() { + os.write_string(9, &v)?; + } + if let Some(v) = self.recovery_word_pos { + os.write_uint32(10, v)?; + } + if let Some(v) = self.reset_word_pos { + os.write_uint32(11, v)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &::std::any::Any { + self as &::std::any::Any + } + fn as_any_mut(&mut self) -> &mut ::std::any::Any { + self as &mut ::std::any::Any + } + fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> DebugLinkState { + DebugLinkState::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "layout", + |m: &DebugLinkState| { &m.layout }, + |m: &mut DebugLinkState| { &mut m.layout }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "pin", + |m: &DebugLinkState| { &m.pin }, + |m: &mut DebugLinkState| { &mut m.pin }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "matrix", + |m: &DebugLinkState| { &m.matrix }, + |m: &mut DebugLinkState| { &mut m.matrix }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "mnemonic", + |m: &DebugLinkState| { &m.mnemonic }, + |m: &mut DebugLinkState| { &mut m.mnemonic }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "node", + |m: &DebugLinkState| { &m.node }, + |m: &mut DebugLinkState| { &mut m.node }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "passphrase_protection", + |m: &DebugLinkState| { &m.passphrase_protection }, + |m: &mut DebugLinkState| { &mut m.passphrase_protection }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "reset_word", + |m: &DebugLinkState| { &m.reset_word }, + |m: &mut DebugLinkState| { &mut m.reset_word }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "reset_entropy", + |m: &DebugLinkState| { &m.reset_entropy }, + |m: &mut DebugLinkState| { &mut m.reset_entropy }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "recovery_fake_word", + |m: &DebugLinkState| { &m.recovery_fake_word }, + |m: &mut DebugLinkState| { &mut m.recovery_fake_word }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( + "recovery_word_pos", + |m: &DebugLinkState| { &m.recovery_word_pos }, + |m: &mut DebugLinkState| { &mut m.recovery_word_pos }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( + "reset_word_pos", + |m: &DebugLinkState| { &m.reset_word_pos }, + |m: &mut DebugLinkState| { &mut m.reset_word_pos }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "DebugLinkState", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static DebugLinkState { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const DebugLinkState, + }; + unsafe { + instance.get(DebugLinkState::new) + } + } +} + +impl ::protobuf::Clear for DebugLinkState { + fn clear(&mut self) { + self.clear_layout(); + self.clear_pin(); + self.clear_matrix(); + self.clear_mnemonic(); + self.clear_node(); + self.clear_passphrase_protection(); + self.clear_reset_word(); + self.clear_reset_entropy(); + self.clear_recovery_fake_word(); + self.clear_recovery_word_pos(); + self.clear_reset_word_pos(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for DebugLinkState { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for DebugLinkState { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct DebugLinkStop { + // special fields + unknown_fields: ::protobuf::UnknownFields, + cached_size: ::protobuf::CachedSize, +} + +impl DebugLinkStop { + pub fn new() -> DebugLinkStop { + ::std::default::Default::default() + } +} + +impl ::protobuf::Message for DebugLinkStop { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &::std::any::Any { + self as &::std::any::Any + } + fn as_any_mut(&mut self) -> &mut ::std::any::Any { + self as &mut ::std::any::Any + } + fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> DebugLinkStop { + DebugLinkStop::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let fields = ::std::vec::Vec::new(); + ::protobuf::reflect::MessageDescriptor::new::( + "DebugLinkStop", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static DebugLinkStop { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const DebugLinkStop, + }; + unsafe { + instance.get(DebugLinkStop::new) + } + } +} + +impl ::protobuf::Clear for DebugLinkStop { + fn clear(&mut self) { + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for DebugLinkStop { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for DebugLinkStop { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct DebugLinkLog { + // message fields + level: ::std::option::Option, + bucket: ::protobuf::SingularField<::std::string::String>, + text: ::protobuf::SingularField<::std::string::String>, + // special fields + unknown_fields: ::protobuf::UnknownFields, + cached_size: ::protobuf::CachedSize, +} + +impl DebugLinkLog { + pub fn new() -> DebugLinkLog { + ::std::default::Default::default() + } + + // optional uint32 level = 1; + + pub fn clear_level(&mut self) { + self.level = ::std::option::Option::None; + } + + pub fn has_level(&self) -> bool { + self.level.is_some() + } + + // Param is passed by value, moved + pub fn set_level(&mut self, v: u32) { + self.level = ::std::option::Option::Some(v); + } + + pub fn get_level(&self) -> u32 { + self.level.unwrap_or(0) + } + + // optional string bucket = 2; + + pub fn clear_bucket(&mut self) { + self.bucket.clear(); + } + + pub fn has_bucket(&self) -> bool { + self.bucket.is_some() + } + + // Param is passed by value, moved + pub fn set_bucket(&mut self, v: ::std::string::String) { + self.bucket = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_bucket(&mut self) -> &mut ::std::string::String { + if self.bucket.is_none() { + self.bucket.set_default(); + } + self.bucket.as_mut().unwrap() + } + + // Take field + pub fn take_bucket(&mut self) -> ::std::string::String { + self.bucket.take().unwrap_or_else(|| ::std::string::String::new()) + } + + pub fn get_bucket(&self) -> &str { + match self.bucket.as_ref() { + Some(v) => &v, + None => "", + } + } + + // optional string text = 3; + + pub fn clear_text(&mut self) { + self.text.clear(); + } + + pub fn has_text(&self) -> bool { + self.text.is_some() + } + + // Param is passed by value, moved + pub fn set_text(&mut self, v: ::std::string::String) { + self.text = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_text(&mut self) -> &mut ::std::string::String { + if self.text.is_none() { + self.text.set_default(); + } + self.text.as_mut().unwrap() + } + + // Take field + pub fn take_text(&mut self) -> ::std::string::String { + self.text.take().unwrap_or_else(|| ::std::string::String::new()) + } + + pub fn get_text(&self) -> &str { + match self.text.as_ref() { + Some(v) => &v, + None => "", + } + } +} + +impl ::protobuf::Message for DebugLinkLog { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_uint32()?; + self.level = ::std::option::Option::Some(tmp); + }, + 2 => { + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.bucket)?; + }, + 3 => { + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.text)?; + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if let Some(v) = self.level { + my_size += ::protobuf::rt::value_size(1, v, ::protobuf::wire_format::WireTypeVarint); + } + if let Some(ref v) = self.bucket.as_ref() { + my_size += ::protobuf::rt::string_size(2, &v); + } + if let Some(ref v) = self.text.as_ref() { + my_size += ::protobuf::rt::string_size(3, &v); + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + if let Some(v) = self.level { + os.write_uint32(1, v)?; + } + if let Some(ref v) = self.bucket.as_ref() { + os.write_string(2, &v)?; + } + if let Some(ref v) = self.text.as_ref() { + os.write_string(3, &v)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &::std::any::Any { + self as &::std::any::Any + } + fn as_any_mut(&mut self) -> &mut ::std::any::Any { + self as &mut ::std::any::Any + } + fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> DebugLinkLog { + DebugLinkLog::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( + "level", + |m: &DebugLinkLog| { &m.level }, + |m: &mut DebugLinkLog| { &mut m.level }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "bucket", + |m: &DebugLinkLog| { &m.bucket }, + |m: &mut DebugLinkLog| { &mut m.bucket }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "text", + |m: &DebugLinkLog| { &m.text }, + |m: &mut DebugLinkLog| { &mut m.text }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "DebugLinkLog", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static DebugLinkLog { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const DebugLinkLog, + }; + unsafe { + instance.get(DebugLinkLog::new) + } + } +} + +impl ::protobuf::Clear for DebugLinkLog { + fn clear(&mut self) { + self.clear_level(); + self.clear_bucket(); + self.clear_text(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for DebugLinkLog { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for DebugLinkLog { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct DebugLinkMemoryRead { + // message fields + address: ::std::option::Option, + length: ::std::option::Option, + // special fields + unknown_fields: ::protobuf::UnknownFields, + cached_size: ::protobuf::CachedSize, +} + +impl DebugLinkMemoryRead { + pub fn new() -> DebugLinkMemoryRead { + ::std::default::Default::default() + } + + // optional uint32 address = 1; + + pub fn clear_address(&mut self) { + self.address = ::std::option::Option::None; + } + + pub fn has_address(&self) -> bool { + self.address.is_some() + } + + // Param is passed by value, moved + pub fn set_address(&mut self, v: u32) { + self.address = ::std::option::Option::Some(v); + } + + pub fn get_address(&self) -> u32 { + self.address.unwrap_or(0) + } + + // optional uint32 length = 2; + + pub fn clear_length(&mut self) { + self.length = ::std::option::Option::None; + } + + pub fn has_length(&self) -> bool { + self.length.is_some() + } + + // Param is passed by value, moved + pub fn set_length(&mut self, v: u32) { + self.length = ::std::option::Option::Some(v); + } + + pub fn get_length(&self) -> u32 { + self.length.unwrap_or(0) + } +} + +impl ::protobuf::Message for DebugLinkMemoryRead { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_uint32()?; + self.address = ::std::option::Option::Some(tmp); + }, + 2 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_uint32()?; + self.length = ::std::option::Option::Some(tmp); + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if let Some(v) = self.address { + my_size += ::protobuf::rt::value_size(1, v, ::protobuf::wire_format::WireTypeVarint); + } + if let Some(v) = self.length { + my_size += ::protobuf::rt::value_size(2, v, ::protobuf::wire_format::WireTypeVarint); + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + if let Some(v) = self.address { + os.write_uint32(1, v)?; + } + if let Some(v) = self.length { + os.write_uint32(2, v)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &::std::any::Any { + self as &::std::any::Any + } + fn as_any_mut(&mut self) -> &mut ::std::any::Any { + self as &mut ::std::any::Any + } + fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> DebugLinkMemoryRead { + DebugLinkMemoryRead::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( + "address", + |m: &DebugLinkMemoryRead| { &m.address }, + |m: &mut DebugLinkMemoryRead| { &mut m.address }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( + "length", + |m: &DebugLinkMemoryRead| { &m.length }, + |m: &mut DebugLinkMemoryRead| { &mut m.length }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "DebugLinkMemoryRead", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static DebugLinkMemoryRead { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const DebugLinkMemoryRead, + }; + unsafe { + instance.get(DebugLinkMemoryRead::new) + } + } +} + +impl ::protobuf::Clear for DebugLinkMemoryRead { + fn clear(&mut self) { + self.clear_address(); + self.clear_length(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for DebugLinkMemoryRead { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for DebugLinkMemoryRead { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct DebugLinkMemory { + // message fields + memory: ::protobuf::SingularField<::std::vec::Vec>, + // special fields + unknown_fields: ::protobuf::UnknownFields, + cached_size: ::protobuf::CachedSize, +} + +impl DebugLinkMemory { + pub fn new() -> DebugLinkMemory { + ::std::default::Default::default() + } + + // optional bytes memory = 1; + + pub fn clear_memory(&mut self) { + self.memory.clear(); + } + + pub fn has_memory(&self) -> bool { + self.memory.is_some() + } + + // Param is passed by value, moved + pub fn set_memory(&mut self, v: ::std::vec::Vec) { + self.memory = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_memory(&mut self) -> &mut ::std::vec::Vec { + if self.memory.is_none() { + self.memory.set_default(); + } + self.memory.as_mut().unwrap() + } + + // Take field + pub fn take_memory(&mut self) -> ::std::vec::Vec { + self.memory.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + pub fn get_memory(&self) -> &[u8] { + match self.memory.as_ref() { + Some(v) => &v, + None => &[], + } + } +} + +impl ::protobuf::Message for DebugLinkMemory { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.memory)?; + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if let Some(ref v) = self.memory.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &v); + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + if let Some(ref v) = self.memory.as_ref() { + os.write_bytes(1, &v)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &::std::any::Any { + self as &::std::any::Any + } + fn as_any_mut(&mut self) -> &mut ::std::any::Any { + self as &mut ::std::any::Any + } + fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> DebugLinkMemory { + DebugLinkMemory::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "memory", + |m: &DebugLinkMemory| { &m.memory }, + |m: &mut DebugLinkMemory| { &mut m.memory }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "DebugLinkMemory", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static DebugLinkMemory { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const DebugLinkMemory, + }; + unsafe { + instance.get(DebugLinkMemory::new) + } + } +} + +impl ::protobuf::Clear for DebugLinkMemory { + fn clear(&mut self) { + self.clear_memory(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for DebugLinkMemory { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for DebugLinkMemory { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct DebugLinkMemoryWrite { + // message fields + address: ::std::option::Option, + memory: ::protobuf::SingularField<::std::vec::Vec>, + flash: ::std::option::Option, + // special fields + unknown_fields: ::protobuf::UnknownFields, + cached_size: ::protobuf::CachedSize, +} + +impl DebugLinkMemoryWrite { + pub fn new() -> DebugLinkMemoryWrite { + ::std::default::Default::default() + } + + // optional uint32 address = 1; + + pub fn clear_address(&mut self) { + self.address = ::std::option::Option::None; + } + + pub fn has_address(&self) -> bool { + self.address.is_some() + } + + // Param is passed by value, moved + pub fn set_address(&mut self, v: u32) { + self.address = ::std::option::Option::Some(v); + } + + pub fn get_address(&self) -> u32 { + self.address.unwrap_or(0) + } + + // optional bytes memory = 2; + + pub fn clear_memory(&mut self) { + self.memory.clear(); + } + + pub fn has_memory(&self) -> bool { + self.memory.is_some() + } + + // Param is passed by value, moved + pub fn set_memory(&mut self, v: ::std::vec::Vec) { + self.memory = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_memory(&mut self) -> &mut ::std::vec::Vec { + if self.memory.is_none() { + self.memory.set_default(); + } + self.memory.as_mut().unwrap() + } + + // Take field + pub fn take_memory(&mut self) -> ::std::vec::Vec { + self.memory.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + pub fn get_memory(&self) -> &[u8] { + match self.memory.as_ref() { + Some(v) => &v, + None => &[], + } + } + + // optional bool flash = 3; + + pub fn clear_flash(&mut self) { + self.flash = ::std::option::Option::None; + } + + pub fn has_flash(&self) -> bool { + self.flash.is_some() + } + + // Param is passed by value, moved + pub fn set_flash(&mut self, v: bool) { + self.flash = ::std::option::Option::Some(v); + } + + pub fn get_flash(&self) -> bool { + self.flash.unwrap_or(false) + } +} + +impl ::protobuf::Message for DebugLinkMemoryWrite { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_uint32()?; + self.address = ::std::option::Option::Some(tmp); + }, + 2 => { + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.memory)?; + }, + 3 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_bool()?; + self.flash = ::std::option::Option::Some(tmp); + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if let Some(v) = self.address { + my_size += ::protobuf::rt::value_size(1, v, ::protobuf::wire_format::WireTypeVarint); + } + if let Some(ref v) = self.memory.as_ref() { + my_size += ::protobuf::rt::bytes_size(2, &v); + } + if let Some(v) = self.flash { + my_size += 2; + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + if let Some(v) = self.address { + os.write_uint32(1, v)?; + } + if let Some(ref v) = self.memory.as_ref() { + os.write_bytes(2, &v)?; + } + if let Some(v) = self.flash { + os.write_bool(3, v)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &::std::any::Any { + self as &::std::any::Any + } + fn as_any_mut(&mut self) -> &mut ::std::any::Any { + self as &mut ::std::any::Any + } + fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> DebugLinkMemoryWrite { + DebugLinkMemoryWrite::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( + "address", + |m: &DebugLinkMemoryWrite| { &m.address }, + |m: &mut DebugLinkMemoryWrite| { &mut m.address }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "memory", + |m: &DebugLinkMemoryWrite| { &m.memory }, + |m: &mut DebugLinkMemoryWrite| { &mut m.memory }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "flash", + |m: &DebugLinkMemoryWrite| { &m.flash }, + |m: &mut DebugLinkMemoryWrite| { &mut m.flash }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "DebugLinkMemoryWrite", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static DebugLinkMemoryWrite { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const DebugLinkMemoryWrite, + }; + unsafe { + instance.get(DebugLinkMemoryWrite::new) + } + } +} + +impl ::protobuf::Clear for DebugLinkMemoryWrite { + fn clear(&mut self) { + self.clear_address(); + self.clear_memory(); + self.clear_flash(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for DebugLinkMemoryWrite { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for DebugLinkMemoryWrite { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct DebugLinkFlashErase { + // message fields + sector: ::std::option::Option, + // special fields + unknown_fields: ::protobuf::UnknownFields, + cached_size: ::protobuf::CachedSize, +} + +impl DebugLinkFlashErase { + pub fn new() -> DebugLinkFlashErase { + ::std::default::Default::default() + } + + // optional uint32 sector = 1; + + pub fn clear_sector(&mut self) { + self.sector = ::std::option::Option::None; + } + + pub fn has_sector(&self) -> bool { + self.sector.is_some() + } + + // Param is passed by value, moved + pub fn set_sector(&mut self, v: u32) { + self.sector = ::std::option::Option::Some(v); + } + + pub fn get_sector(&self) -> u32 { + self.sector.unwrap_or(0) + } +} + +impl ::protobuf::Message for DebugLinkFlashErase { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_uint32()?; + self.sector = ::std::option::Option::Some(tmp); + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if let Some(v) = self.sector { + my_size += ::protobuf::rt::value_size(1, v, ::protobuf::wire_format::WireTypeVarint); + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + if let Some(v) = self.sector { + os.write_uint32(1, v)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &::std::any::Any { + self as &::std::any::Any + } + fn as_any_mut(&mut self) -> &mut ::std::any::Any { + self as &mut ::std::any::Any + } + fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> DebugLinkFlashErase { + DebugLinkFlashErase::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( + "sector", + |m: &DebugLinkFlashErase| { &m.sector }, + |m: &mut DebugLinkFlashErase| { &mut m.sector }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "DebugLinkFlashErase", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static DebugLinkFlashErase { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const DebugLinkFlashErase, + }; + unsafe { + instance.get(DebugLinkFlashErase::new) + } + } +} + +impl ::protobuf::Clear for DebugLinkFlashErase { + fn clear(&mut self) { + self.clear_sector(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for DebugLinkFlashErase { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for DebugLinkFlashErase { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +static file_descriptor_proto_data: &'static [u8] = b"\ + \n\x14messages-debug.proto\x12\x18hw.trezor.messages.debug\x1a\x15messag\ + es-common.proto\"Y\n\x11DebugLinkDecision\x12\x15\n\x06yes_no\x18\x01\ + \x20\x01(\x08R\x05yesNo\x12\x17\n\x07up_down\x18\x02\x20\x01(\x08R\x06up\ + Down\x12\x14\n\x05input\x18\x03\x20\x01(\tR\x05input\"\x13\n\x11DebugLin\ + kGetState\"\xa2\x03\n\x0eDebugLinkState\x12\x16\n\x06layout\x18\x01\x20\ + \x01(\x0cR\x06layout\x12\x10\n\x03pin\x18\x02\x20\x01(\tR\x03pin\x12\x16\ + \n\x06matrix\x18\x03\x20\x01(\tR\x06matrix\x12\x1a\n\x08mnemonic\x18\x04\ + \x20\x01(\tR\x08mnemonic\x129\n\x04node\x18\x05\x20\x01(\x0b2%.hw.trezor\ + .messages.common.HDNodeTypeR\x04node\x123\n\x15passphrase_protection\x18\ + \x06\x20\x01(\x08R\x14passphraseProtection\x12\x1d\n\nreset_word\x18\x07\ + \x20\x01(\tR\tresetWord\x12#\n\rreset_entropy\x18\x08\x20\x01(\x0cR\x0cr\ + esetEntropy\x12,\n\x12recovery_fake_word\x18\t\x20\x01(\tR\x10recoveryFa\ + keWord\x12*\n\x11recovery_word_pos\x18\n\x20\x01(\rR\x0frecoveryWordPos\ + \x12$\n\x0ereset_word_pos\x18\x0b\x20\x01(\rR\x0cresetWordPos\"\x0f\n\rD\ + ebugLinkStop\"P\n\x0cDebugLinkLog\x12\x14\n\x05level\x18\x01\x20\x01(\rR\ + \x05level\x12\x16\n\x06bucket\x18\x02\x20\x01(\tR\x06bucket\x12\x12\n\ + \x04text\x18\x03\x20\x01(\tR\x04text\"G\n\x13DebugLinkMemoryRead\x12\x18\ + \n\x07address\x18\x01\x20\x01(\rR\x07address\x12\x16\n\x06length\x18\x02\ + \x20\x01(\rR\x06length\")\n\x0fDebugLinkMemory\x12\x16\n\x06memory\x18\ + \x01\x20\x01(\x0cR\x06memory\"^\n\x14DebugLinkMemoryWrite\x12\x18\n\x07a\ + ddress\x18\x01\x20\x01(\rR\x07address\x12\x16\n\x06memory\x18\x02\x20\ + \x01(\x0cR\x06memory\x12\x14\n\x05flash\x18\x03\x20\x01(\x08R\x05flash\"\ + -\n\x13DebugLinkFlashErase\x12\x16\n\x06sector\x18\x01\x20\x01(\rR\x06se\ + ctorB9\n#com.satoshilabs.trezor.lib.protobufB\x12TrezorMessageDebugJ\xf5\ + \x19\n\x06\x12\x04\0\0g\x01\n\x08\n\x01\x0c\x12\x03\0\0\x12\n\x08\n\x01\ + \x02\x12\x03\x01\x08\x20\n\x08\n\x01\x08\x12\x03\x04\0<\n.\n\x02\x08\x01\ + \x12\x03\x04\0<\x1a#\x20Sugar\x20for\x20easier\x20handling\x20in\x20Java\ + \n\n\x08\n\x01\x08\x12\x03\x05\03\n\t\n\x02\x08\x08\x12\x03\x05\03\n\t\n\ + \x02\x03\0\x12\x03\x07\x07\x1e\nP\n\x02\x04\0\x12\x04\x0e\0\x12\x01\x1aD\ + *\n\x20Request:\x20\"Press\"\x20the\x20button\x20on\x20the\x20device\n\ + \x20@start\n\x20@next\x20Success\n\n\n\n\x03\x04\0\x01\x12\x03\x0e\x08\ + \x19\n5\n\x04\x04\0\x02\0\x12\x03\x0f\x04\x1d\"(\x20true\x20for\x20\"Con\ + firm\",\x20false\x20for\x20\"Cancel\"\n\n\x0c\n\x05\x04\0\x02\0\x04\x12\ + \x03\x0f\x04\x0c\n\x0c\n\x05\x04\0\x02\0\x05\x12\x03\x0f\r\x11\n\x0c\n\ + \x05\x04\0\x02\0\x01\x12\x03\x0f\x12\x18\n\x0c\n\x05\x04\0\x02\0\x03\x12\ + \x03\x0f\x1b\x1c\n8\n\x04\x04\0\x02\x01\x12\x03\x10\x04\x1e\"+\x20true\ + \x20for\x20scroll\x20up,\x20false\x20for\x20scroll\x20down\n\n\x0c\n\x05\ + \x04\0\x02\x01\x04\x12\x03\x10\x04\x0c\n\x0c\n\x05\x04\0\x02\x01\x05\x12\ + \x03\x10\r\x11\n\x0c\n\x05\x04\0\x02\x01\x01\x12\x03\x10\x12\x19\n\x0c\n\ + \x05\x04\0\x02\x01\x03\x12\x03\x10\x1c\x1d\n\x1d\n\x04\x04\0\x02\x02\x12\ + \x03\x11\x04\x1e\"\x10\x20keyboard\x20input\n\n\x0c\n\x05\x04\0\x02\x02\ + \x04\x12\x03\x11\x04\x0c\n\x0c\n\x05\x04\0\x02\x02\x05\x12\x03\x11\r\x13\ + \n\x0c\n\x05\x04\0\x02\x02\x01\x12\x03\x11\x14\x19\n\x0c\n\x05\x04\0\x02\ + \x02\x03\x12\x03\x11\x1c\x1d\nU\n\x02\x04\x01\x12\x04\x19\0\x1a\x01\x1aI\ + *\n\x20Request:\x20Computer\x20asks\x20for\x20device\x20state\n\x20@star\ + t\n\x20@next\x20DebugLinkState\n\n\n\n\x03\x04\x01\x01\x12\x03\x19\x08\ + \x19\n4\n\x02\x04\x02\x12\x04\x20\0,\x01\x1a(*\n\x20Response:\x20Device\ + \x20current\x20state\n\x20@end\n\n\n\n\x03\x04\x02\x01\x12\x03\x20\x08\ + \x16\n$\n\x04\x04\x02\x02\0\x12\x03!\x04\x1e\"\x17\x20raw\x20buffer\x20o\ + f\x20display\n\n\x0c\n\x05\x04\x02\x02\0\x04\x12\x03!\x04\x0c\n\x0c\n\ + \x05\x04\x02\x02\0\x05\x12\x03!\r\x12\n\x0c\n\x05\x04\x02\x02\0\x01\x12\ + \x03!\x13\x19\n\x0c\n\x05\x04\x02\x02\0\x03\x12\x03!\x1c\x1d\n;\n\x04\ + \x04\x02\x02\x01\x12\x03\"\x04\x1c\".\x20current\x20PIN,\x20blank\x20if\ + \x20PIN\x20is\x20not\x20set/enabled\n\n\x0c\n\x05\x04\x02\x02\x01\x04\ + \x12\x03\"\x04\x0c\n\x0c\n\x05\x04\x02\x02\x01\x05\x12\x03\"\r\x13\n\x0c\ + \n\x05\x04\x02\x02\x01\x01\x12\x03\"\x14\x17\n\x0c\n\x05\x04\x02\x02\x01\ + \x03\x12\x03\"\x1a\x1b\n!\n\x04\x04\x02\x02\x02\x12\x03#\x04\x1f\"\x14\ + \x20current\x20PIN\x20matrix\n\n\x0c\n\x05\x04\x02\x02\x02\x04\x12\x03#\ + \x04\x0c\n\x0c\n\x05\x04\x02\x02\x02\x05\x12\x03#\r\x13\n\x0c\n\x05\x04\ + \x02\x02\x02\x01\x12\x03#\x14\x1a\n\x0c\n\x05\x04\x02\x02\x02\x03\x12\ + \x03#\x1d\x1e\n&\n\x04\x04\x02\x02\x03\x12\x03$\x04!\"\x19\x20current\ + \x20BIP-39\x20mnemonic\n\n\x0c\n\x05\x04\x02\x02\x03\x04\x12\x03$\x04\ + \x0c\n\x0c\n\x05\x04\x02\x02\x03\x05\x12\x03$\r\x13\n\x0c\n\x05\x04\x02\ + \x02\x03\x01\x12\x03$\x14\x1c\n\x0c\n\x05\x04\x02\x02\x03\x03\x12\x03$\ + \x1f\x20\n\"\n\x04\x04\x02\x02\x04\x12\x03%\x04;\"\x15\x20current\x20BIP\ + -32\x20node\n\n\x0c\n\x05\x04\x02\x02\x04\x04\x12\x03%\x04\x0c\n\x0c\n\ + \x05\x04\x02\x02\x04\x06\x12\x03%\r1\n\x0c\n\x05\x04\x02\x02\x04\x01\x12\ + \x03%26\n\x0c\n\x05\x04\x02\x02\x04\x03\x12\x03%9:\n;\n\x04\x04\x02\x02\ + \x05\x12\x03&\x04,\".\x20is\x20node/mnemonic\x20encrypted\x20using\x20pa\ + ssphrase?\n\n\x0c\n\x05\x04\x02\x02\x05\x04\x12\x03&\x04\x0c\n\x0c\n\x05\ + \x04\x02\x02\x05\x05\x12\x03&\r\x11\n\x0c\n\x05\x04\x02\x02\x05\x01\x12\ + \x03&\x12'\n\x0c\n\x05\x04\x02\x02\x05\x03\x12\x03&*+\nA\n\x04\x04\x02\ + \x02\x06\x12\x03'\x04#\"4\x20word\x20on\x20device\x20display\x20during\ + \x20ResetDevice\x20workflow\n\n\x0c\n\x05\x04\x02\x02\x06\x04\x12\x03'\ + \x04\x0c\n\x0c\n\x05\x04\x02\x02\x06\x05\x12\x03'\r\x13\n\x0c\n\x05\x04\ + \x02\x02\x06\x01\x12\x03'\x14\x1e\n\x0c\n\x05\x04\x02\x02\x06\x03\x12\ + \x03'!\"\n:\n\x04\x04\x02\x02\x07\x12\x03(\x04%\"-\x20current\x20entropy\ + \x20during\x20ResetDevice\x20workflow\n\n\x0c\n\x05\x04\x02\x02\x07\x04\ + \x12\x03(\x04\x0c\n\x0c\n\x05\x04\x02\x02\x07\x05\x12\x03(\r\x12\n\x0c\n\ + \x05\x04\x02\x02\x07\x01\x12\x03(\x13\x20\n\x0c\n\x05\x04\x02\x02\x07\ + \x03\x12\x03(#$\nD\n\x04\x04\x02\x02\x08\x12\x03)\x04+\"7\x20(fake)\x20w\ + ord\x20on\x20display\x20during\x20RecoveryDevice\x20workflow\n\n\x0c\n\ + \x05\x04\x02\x02\x08\x04\x12\x03)\x04\x0c\n\x0c\n\x05\x04\x02\x02\x08\ + \x05\x12\x03)\r\x13\n\x0c\n\x05\x04\x02\x02\x08\x01\x12\x03)\x14&\n\x0c\ + \n\x05\x04\x02\x02\x08\x03\x12\x03))*\n\\\n\x04\x04\x02\x02\t\x12\x03*\ + \x04+\"O\x20index\x20of\x20mnemonic\x20word\x20the\x20device\x20is\x20ex\ + pecting\x20during\x20RecoveryDevice\x20workflow\n\n\x0c\n\x05\x04\x02\ + \x02\t\x04\x12\x03*\x04\x0c\n\x0c\n\x05\x04\x02\x02\t\x05\x12\x03*\r\x13\ + \n\x0c\n\x05\x04\x02\x02\t\x01\x12\x03*\x14%\n\x0c\n\x05\x04\x02\x02\t\ + \x03\x12\x03*(*\nY\n\x04\x04\x02\x02\n\x12\x03+\x04(\"L\x20index\x20of\ + \x20mnemonic\x20word\x20the\x20device\x20is\x20expecting\x20during\x20Re\ + setDevice\x20workflow\n\n\x0c\n\x05\x04\x02\x02\n\x04\x12\x03+\x04\x0c\n\ + \x0c\n\x05\x04\x02\x02\n\x05\x12\x03+\r\x13\n\x0c\n\x05\x04\x02\x02\n\ + \x01\x12\x03+\x14\"\n\x0c\n\x05\x04\x02\x02\n\x03\x12\x03+%'\n6\n\x02\ + \x04\x03\x12\x042\03\x01\x1a**\n\x20Request:\x20Ask\x20device\x20to\x20r\ + estart\n\x20@start\n\n\n\n\x03\x04\x03\x01\x12\x032\x08\x15\nA\n\x02\x04\ + \x04\x12\x049\0=\x01\x1a5*\n\x20Response:\x20Device\x20wants\x20host\x20\ + to\x20log\x20event\n\x20@ignore\n\n\n\n\x03\x04\x04\x01\x12\x039\x08\x14\ + \n\x0b\n\x04\x04\x04\x02\0\x12\x03:\x04\x1e\n\x0c\n\x05\x04\x04\x02\0\ + \x04\x12\x03:\x04\x0c\n\x0c\n\x05\x04\x04\x02\0\x05\x12\x03:\r\x13\n\x0c\ + \n\x05\x04\x04\x02\0\x01\x12\x03:\x14\x19\n\x0c\n\x05\x04\x04\x02\0\x03\ + \x12\x03:\x1c\x1d\n\x0b\n\x04\x04\x04\x02\x01\x12\x03;\x04\x1f\n\x0c\n\ + \x05\x04\x04\x02\x01\x04\x12\x03;\x04\x0c\n\x0c\n\x05\x04\x04\x02\x01\ + \x05\x12\x03;\r\x13\n\x0c\n\x05\x04\x04\x02\x01\x01\x12\x03;\x14\x1a\n\ + \x0c\n\x05\x04\x04\x02\x01\x03\x12\x03;\x1d\x1e\n\x0b\n\x04\x04\x04\x02\ + \x02\x12\x03<\x04\x1d\n\x0c\n\x05\x04\x04\x02\x02\x04\x12\x03<\x04\x0c\n\ + \x0c\n\x05\x04\x04\x02\x02\x05\x12\x03<\r\x13\n\x0c\n\x05\x04\x04\x02\ + \x02\x01\x12\x03<\x14\x18\n\x0c\n\x05\x04\x04\x02\x02\x03\x12\x03<\x1b\ + \x1c\nO\n\x02\x04\x05\x12\x04D\0G\x01\x1aC*\n\x20Request:\x20Read\x20mem\ + ory\x20from\x20device\n\x20@start\n\x20@next\x20DebugLinkMemory\n\n\n\n\ + \x03\x04\x05\x01\x12\x03D\x08\x1b\n\x0b\n\x04\x04\x05\x02\0\x12\x03E\x04\ + \x20\n\x0c\n\x05\x04\x05\x02\0\x04\x12\x03E\x04\x0c\n\x0c\n\x05\x04\x05\ + \x02\0\x05\x12\x03E\r\x13\n\x0c\n\x05\x04\x05\x02\0\x01\x12\x03E\x14\x1b\ + \n\x0c\n\x05\x04\x05\x02\0\x03\x12\x03E\x1e\x1f\n\x0b\n\x04\x04\x05\x02\ + \x01\x12\x03F\x04\x1f\n\x0c\n\x05\x04\x05\x02\x01\x04\x12\x03F\x04\x0c\n\ + \x0c\n\x05\x04\x05\x02\x01\x05\x12\x03F\r\x13\n\x0c\n\x05\x04\x05\x02\ + \x01\x01\x12\x03F\x14\x1a\n\x0c\n\x05\x04\x05\x02\x01\x03\x12\x03F\x1d\ + \x1e\n8\n\x02\x04\x06\x12\x04M\0O\x01\x1a,*\n\x20Response:\x20Device\x20\ + sends\x20memory\x20back\n\x20@end\n\n\n\n\x03\x04\x06\x01\x12\x03M\x08\ + \x17\n\x0b\n\x04\x04\x06\x02\0\x12\x03N\x04\x1e\n\x0c\n\x05\x04\x06\x02\ + \0\x04\x12\x03N\x04\x0c\n\x0c\n\x05\x04\x06\x02\0\x05\x12\x03N\r\x12\n\ + \x0c\n\x05\x04\x06\x02\0\x01\x12\x03N\x13\x19\n\x0c\n\x05\x04\x06\x02\0\ + \x03\x12\x03N\x1c\x1d\n\xa1\x01\n\x02\x04\x07\x12\x04X\0\\\x01\x1a\x94\ + \x01*\n\x20Request:\x20Write\x20memory\x20to\x20device.\n\x20WARNING:\ + \x20Writing\x20to\x20the\x20wrong\x20location\x20can\x20irreparably\x20b\ + reak\x20the\x20device.\n\x20@start\n\x20@next\x20Success\n\x20@next\x20F\ + ailure\n\n\n\n\x03\x04\x07\x01\x12\x03X\x08\x1c\n\x0b\n\x04\x04\x07\x02\ + \0\x12\x03Y\x04\x20\n\x0c\n\x05\x04\x07\x02\0\x04\x12\x03Y\x04\x0c\n\x0c\ + \n\x05\x04\x07\x02\0\x05\x12\x03Y\r\x13\n\x0c\n\x05\x04\x07\x02\0\x01\ + \x12\x03Y\x14\x1b\n\x0c\n\x05\x04\x07\x02\0\x03\x12\x03Y\x1e\x1f\n\x0b\n\ + \x04\x04\x07\x02\x01\x12\x03Z\x04\x1e\n\x0c\n\x05\x04\x07\x02\x01\x04\ + \x12\x03Z\x04\x0c\n\x0c\n\x05\x04\x07\x02\x01\x05\x12\x03Z\r\x12\n\x0c\n\ + \x05\x04\x07\x02\x01\x01\x12\x03Z\x13\x19\n\x0c\n\x05\x04\x07\x02\x01\ + \x03\x12\x03Z\x1c\x1d\n\x0b\n\x04\x04\x07\x02\x02\x12\x03[\x04\x1c\n\x0c\ + \n\x05\x04\x07\x02\x02\x04\x12\x03[\x04\x0c\n\x0c\n\x05\x04\x07\x02\x02\ + \x05\x12\x03[\r\x11\n\x0c\n\x05\x04\x07\x02\x02\x01\x12\x03[\x12\x17\n\ + \x0c\n\x05\x04\x07\x02\x02\x03\x12\x03[\x1a\x1b\n\xa8\x01\n\x02\x04\x08\ + \x12\x04e\0g\x01\x1a\x9b\x01*\n\x20Request:\x20Erase\x20block\x20of\x20f\ + lash\x20on\x20device\n\x20WARNING:\x20Writing\x20to\x20the\x20wrong\x20l\ + ocation\x20can\x20irreparably\x20break\x20the\x20device.\n\x20@start\n\ + \x20@next\x20Success\n\x20@next\x20Failure\n\n\n\n\x03\x04\x08\x01\x12\ + \x03e\x08\x1b\n\x0b\n\x04\x04\x08\x02\0\x12\x03f\x04\x1f\n\x0c\n\x05\x04\ + \x08\x02\0\x04\x12\x03f\x04\x0c\n\x0c\n\x05\x04\x08\x02\0\x05\x12\x03f\r\ + \x13\n\x0c\n\x05\x04\x08\x02\0\x01\x12\x03f\x14\x1a\n\x0c\n\x05\x04\x08\ + \x02\0\x03\x12\x03f\x1d\x1e\ +"; + +static mut file_descriptor_proto_lazy: ::protobuf::lazy::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::descriptor::FileDescriptorProto, +}; + +fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto { + ::protobuf::parse_from_bytes(file_descriptor_proto_data).unwrap() +} + +pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { + unsafe { + file_descriptor_proto_lazy.get(|| { + parse_descriptor_proto() + }) + } +} diff --git a/src/protos/messages_management.rs b/src/protos/messages_management.rs new file mode 100644 index 0000000..eeae23b --- /dev/null +++ b/src/protos/messages_management.rs @@ -0,0 +1,6406 @@ +// This file is generated by rust-protobuf 2.0.4. Do not edit +// @generated + +// https://github.com/Manishearth/rust-clippy/issues/702 +#![allow(unknown_lints)] +#![allow(clippy)] + +#![cfg_attr(rustfmt, rustfmt_skip)] + +#![allow(box_pointers)] +#![allow(dead_code)] +#![allow(missing_docs)] +#![allow(non_camel_case_types)] +#![allow(non_snake_case)] +#![allow(non_upper_case_globals)] +#![allow(trivial_casts)] +#![allow(unsafe_code)] +#![allow(unused_imports)] +#![allow(unused_results)] + +use protobuf::Message as Message_imported_for_functions; +use protobuf::ProtobufEnum as ProtobufEnum_imported_for_functions; + +#[derive(PartialEq,Clone,Default)] +pub struct Initialize { + // message fields + state: ::protobuf::SingularField<::std::vec::Vec>, + skip_passphrase: ::std::option::Option, + // special fields + unknown_fields: ::protobuf::UnknownFields, + cached_size: ::protobuf::CachedSize, +} + +impl Initialize { + pub fn new() -> Initialize { + ::std::default::Default::default() + } + + // optional bytes state = 1; + + pub fn clear_state(&mut self) { + self.state.clear(); + } + + pub fn has_state(&self) -> bool { + self.state.is_some() + } + + // Param is passed by value, moved + pub fn set_state(&mut self, v: ::std::vec::Vec) { + self.state = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_state(&mut self) -> &mut ::std::vec::Vec { + if self.state.is_none() { + self.state.set_default(); + } + self.state.as_mut().unwrap() + } + + // Take field + pub fn take_state(&mut self) -> ::std::vec::Vec { + self.state.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + pub fn get_state(&self) -> &[u8] { + match self.state.as_ref() { + Some(v) => &v, + None => &[], + } + } + + // optional bool skip_passphrase = 2; + + pub fn clear_skip_passphrase(&mut self) { + self.skip_passphrase = ::std::option::Option::None; + } + + pub fn has_skip_passphrase(&self) -> bool { + self.skip_passphrase.is_some() + } + + // Param is passed by value, moved + pub fn set_skip_passphrase(&mut self, v: bool) { + self.skip_passphrase = ::std::option::Option::Some(v); + } + + pub fn get_skip_passphrase(&self) -> bool { + self.skip_passphrase.unwrap_or(false) + } +} + +impl ::protobuf::Message for Initialize { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.state)?; + }, + 2 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_bool()?; + self.skip_passphrase = ::std::option::Option::Some(tmp); + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if let Some(ref v) = self.state.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &v); + } + if let Some(v) = self.skip_passphrase { + my_size += 2; + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + if let Some(ref v) = self.state.as_ref() { + os.write_bytes(1, &v)?; + } + if let Some(v) = self.skip_passphrase { + os.write_bool(2, v)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &::std::any::Any { + self as &::std::any::Any + } + fn as_any_mut(&mut self) -> &mut ::std::any::Any { + self as &mut ::std::any::Any + } + fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> Initialize { + Initialize::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "state", + |m: &Initialize| { &m.state }, + |m: &mut Initialize| { &mut m.state }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "skip_passphrase", + |m: &Initialize| { &m.skip_passphrase }, + |m: &mut Initialize| { &mut m.skip_passphrase }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "Initialize", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static Initialize { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const Initialize, + }; + unsafe { + instance.get(Initialize::new) + } + } +} + +impl ::protobuf::Clear for Initialize { + fn clear(&mut self) { + self.clear_state(); + self.clear_skip_passphrase(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for Initialize { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for Initialize { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct GetFeatures { + // special fields + unknown_fields: ::protobuf::UnknownFields, + cached_size: ::protobuf::CachedSize, +} + +impl GetFeatures { + pub fn new() -> GetFeatures { + ::std::default::Default::default() + } +} + +impl ::protobuf::Message for GetFeatures { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &::std::any::Any { + self as &::std::any::Any + } + fn as_any_mut(&mut self) -> &mut ::std::any::Any { + self as &mut ::std::any::Any + } + fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> GetFeatures { + GetFeatures::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let fields = ::std::vec::Vec::new(); + ::protobuf::reflect::MessageDescriptor::new::( + "GetFeatures", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static GetFeatures { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const GetFeatures, + }; + unsafe { + instance.get(GetFeatures::new) + } + } +} + +impl ::protobuf::Clear for GetFeatures { + fn clear(&mut self) { + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for GetFeatures { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for GetFeatures { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct Features { + // message fields + vendor: ::protobuf::SingularField<::std::string::String>, + major_version: ::std::option::Option, + minor_version: ::std::option::Option, + patch_version: ::std::option::Option, + bootloader_mode: ::std::option::Option, + device_id: ::protobuf::SingularField<::std::string::String>, + pin_protection: ::std::option::Option, + passphrase_protection: ::std::option::Option, + language: ::protobuf::SingularField<::std::string::String>, + label: ::protobuf::SingularField<::std::string::String>, + initialized: ::std::option::Option, + revision: ::protobuf::SingularField<::std::vec::Vec>, + bootloader_hash: ::protobuf::SingularField<::std::vec::Vec>, + imported: ::std::option::Option, + pin_cached: ::std::option::Option, + passphrase_cached: ::std::option::Option, + firmware_present: ::std::option::Option, + needs_backup: ::std::option::Option, + flags: ::std::option::Option, + model: ::protobuf::SingularField<::std::string::String>, + fw_major: ::std::option::Option, + fw_minor: ::std::option::Option, + fw_patch: ::std::option::Option, + fw_vendor: ::protobuf::SingularField<::std::string::String>, + fw_vendor_keys: ::protobuf::SingularField<::std::vec::Vec>, + unfinished_backup: ::std::option::Option, + no_backup: ::std::option::Option, + // special fields + unknown_fields: ::protobuf::UnknownFields, + cached_size: ::protobuf::CachedSize, +} + +impl Features { + pub fn new() -> Features { + ::std::default::Default::default() + } + + // optional string vendor = 1; + + pub fn clear_vendor(&mut self) { + self.vendor.clear(); + } + + pub fn has_vendor(&self) -> bool { + self.vendor.is_some() + } + + // Param is passed by value, moved + pub fn set_vendor(&mut self, v: ::std::string::String) { + self.vendor = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_vendor(&mut self) -> &mut ::std::string::String { + if self.vendor.is_none() { + self.vendor.set_default(); + } + self.vendor.as_mut().unwrap() + } + + // Take field + pub fn take_vendor(&mut self) -> ::std::string::String { + self.vendor.take().unwrap_or_else(|| ::std::string::String::new()) + } + + pub fn get_vendor(&self) -> &str { + match self.vendor.as_ref() { + Some(v) => &v, + None => "", + } + } + + // optional uint32 major_version = 2; + + pub fn clear_major_version(&mut self) { + self.major_version = ::std::option::Option::None; + } + + pub fn has_major_version(&self) -> bool { + self.major_version.is_some() + } + + // Param is passed by value, moved + pub fn set_major_version(&mut self, v: u32) { + self.major_version = ::std::option::Option::Some(v); + } + + pub fn get_major_version(&self) -> u32 { + self.major_version.unwrap_or(0) + } + + // optional uint32 minor_version = 3; + + pub fn clear_minor_version(&mut self) { + self.minor_version = ::std::option::Option::None; + } + + pub fn has_minor_version(&self) -> bool { + self.minor_version.is_some() + } + + // Param is passed by value, moved + pub fn set_minor_version(&mut self, v: u32) { + self.minor_version = ::std::option::Option::Some(v); + } + + pub fn get_minor_version(&self) -> u32 { + self.minor_version.unwrap_or(0) + } + + // optional uint32 patch_version = 4; + + pub fn clear_patch_version(&mut self) { + self.patch_version = ::std::option::Option::None; + } + + pub fn has_patch_version(&self) -> bool { + self.patch_version.is_some() + } + + // Param is passed by value, moved + pub fn set_patch_version(&mut self, v: u32) { + self.patch_version = ::std::option::Option::Some(v); + } + + pub fn get_patch_version(&self) -> u32 { + self.patch_version.unwrap_or(0) + } + + // optional bool bootloader_mode = 5; + + pub fn clear_bootloader_mode(&mut self) { + self.bootloader_mode = ::std::option::Option::None; + } + + pub fn has_bootloader_mode(&self) -> bool { + self.bootloader_mode.is_some() + } + + // Param is passed by value, moved + pub fn set_bootloader_mode(&mut self, v: bool) { + self.bootloader_mode = ::std::option::Option::Some(v); + } + + pub fn get_bootloader_mode(&self) -> bool { + self.bootloader_mode.unwrap_or(false) + } + + // optional string device_id = 6; + + pub fn clear_device_id(&mut self) { + self.device_id.clear(); + } + + pub fn has_device_id(&self) -> bool { + self.device_id.is_some() + } + + // Param is passed by value, moved + pub fn set_device_id(&mut self, v: ::std::string::String) { + self.device_id = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_device_id(&mut self) -> &mut ::std::string::String { + if self.device_id.is_none() { + self.device_id.set_default(); + } + self.device_id.as_mut().unwrap() + } + + // Take field + pub fn take_device_id(&mut self) -> ::std::string::String { + self.device_id.take().unwrap_or_else(|| ::std::string::String::new()) + } + + pub fn get_device_id(&self) -> &str { + match self.device_id.as_ref() { + Some(v) => &v, + None => "", + } + } + + // optional bool pin_protection = 7; + + pub fn clear_pin_protection(&mut self) { + self.pin_protection = ::std::option::Option::None; + } + + pub fn has_pin_protection(&self) -> bool { + self.pin_protection.is_some() + } + + // Param is passed by value, moved + pub fn set_pin_protection(&mut self, v: bool) { + self.pin_protection = ::std::option::Option::Some(v); + } + + pub fn get_pin_protection(&self) -> bool { + self.pin_protection.unwrap_or(false) + } + + // optional bool passphrase_protection = 8; + + pub fn clear_passphrase_protection(&mut self) { + self.passphrase_protection = ::std::option::Option::None; + } + + pub fn has_passphrase_protection(&self) -> bool { + self.passphrase_protection.is_some() + } + + // Param is passed by value, moved + pub fn set_passphrase_protection(&mut self, v: bool) { + self.passphrase_protection = ::std::option::Option::Some(v); + } + + pub fn get_passphrase_protection(&self) -> bool { + self.passphrase_protection.unwrap_or(false) + } + + // optional string language = 9; + + pub fn clear_language(&mut self) { + self.language.clear(); + } + + pub fn has_language(&self) -> bool { + self.language.is_some() + } + + // Param is passed by value, moved + pub fn set_language(&mut self, v: ::std::string::String) { + self.language = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_language(&mut self) -> &mut ::std::string::String { + if self.language.is_none() { + self.language.set_default(); + } + self.language.as_mut().unwrap() + } + + // Take field + pub fn take_language(&mut self) -> ::std::string::String { + self.language.take().unwrap_or_else(|| ::std::string::String::new()) + } + + pub fn get_language(&self) -> &str { + match self.language.as_ref() { + Some(v) => &v, + None => "", + } + } + + // optional string label = 10; + + pub fn clear_label(&mut self) { + self.label.clear(); + } + + pub fn has_label(&self) -> bool { + self.label.is_some() + } + + // Param is passed by value, moved + pub fn set_label(&mut self, v: ::std::string::String) { + self.label = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_label(&mut self) -> &mut ::std::string::String { + if self.label.is_none() { + self.label.set_default(); + } + self.label.as_mut().unwrap() + } + + // Take field + pub fn take_label(&mut self) -> ::std::string::String { + self.label.take().unwrap_or_else(|| ::std::string::String::new()) + } + + pub fn get_label(&self) -> &str { + match self.label.as_ref() { + Some(v) => &v, + None => "", + } + } + + // optional bool initialized = 12; + + pub fn clear_initialized(&mut self) { + self.initialized = ::std::option::Option::None; + } + + pub fn has_initialized(&self) -> bool { + self.initialized.is_some() + } + + // Param is passed by value, moved + pub fn set_initialized(&mut self, v: bool) { + self.initialized = ::std::option::Option::Some(v); + } + + pub fn get_initialized(&self) -> bool { + self.initialized.unwrap_or(false) + } + + // optional bytes revision = 13; + + pub fn clear_revision(&mut self) { + self.revision.clear(); + } + + pub fn has_revision(&self) -> bool { + self.revision.is_some() + } + + // Param is passed by value, moved + pub fn set_revision(&mut self, v: ::std::vec::Vec) { + self.revision = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_revision(&mut self) -> &mut ::std::vec::Vec { + if self.revision.is_none() { + self.revision.set_default(); + } + self.revision.as_mut().unwrap() + } + + // Take field + pub fn take_revision(&mut self) -> ::std::vec::Vec { + self.revision.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + pub fn get_revision(&self) -> &[u8] { + match self.revision.as_ref() { + Some(v) => &v, + None => &[], + } + } + + // optional bytes bootloader_hash = 14; + + pub fn clear_bootloader_hash(&mut self) { + self.bootloader_hash.clear(); + } + + pub fn has_bootloader_hash(&self) -> bool { + self.bootloader_hash.is_some() + } + + // Param is passed by value, moved + pub fn set_bootloader_hash(&mut self, v: ::std::vec::Vec) { + self.bootloader_hash = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_bootloader_hash(&mut self) -> &mut ::std::vec::Vec { + if self.bootloader_hash.is_none() { + self.bootloader_hash.set_default(); + } + self.bootloader_hash.as_mut().unwrap() + } + + // Take field + pub fn take_bootloader_hash(&mut self) -> ::std::vec::Vec { + self.bootloader_hash.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + pub fn get_bootloader_hash(&self) -> &[u8] { + match self.bootloader_hash.as_ref() { + Some(v) => &v, + None => &[], + } + } + + // optional bool imported = 15; + + pub fn clear_imported(&mut self) { + self.imported = ::std::option::Option::None; + } + + pub fn has_imported(&self) -> bool { + self.imported.is_some() + } + + // Param is passed by value, moved + pub fn set_imported(&mut self, v: bool) { + self.imported = ::std::option::Option::Some(v); + } + + pub fn get_imported(&self) -> bool { + self.imported.unwrap_or(false) + } + + // optional bool pin_cached = 16; + + pub fn clear_pin_cached(&mut self) { + self.pin_cached = ::std::option::Option::None; + } + + pub fn has_pin_cached(&self) -> bool { + self.pin_cached.is_some() + } + + // Param is passed by value, moved + pub fn set_pin_cached(&mut self, v: bool) { + self.pin_cached = ::std::option::Option::Some(v); + } + + pub fn get_pin_cached(&self) -> bool { + self.pin_cached.unwrap_or(false) + } + + // optional bool passphrase_cached = 17; + + pub fn clear_passphrase_cached(&mut self) { + self.passphrase_cached = ::std::option::Option::None; + } + + pub fn has_passphrase_cached(&self) -> bool { + self.passphrase_cached.is_some() + } + + // Param is passed by value, moved + pub fn set_passphrase_cached(&mut self, v: bool) { + self.passphrase_cached = ::std::option::Option::Some(v); + } + + pub fn get_passphrase_cached(&self) -> bool { + self.passphrase_cached.unwrap_or(false) + } + + // optional bool firmware_present = 18; + + pub fn clear_firmware_present(&mut self) { + self.firmware_present = ::std::option::Option::None; + } + + pub fn has_firmware_present(&self) -> bool { + self.firmware_present.is_some() + } + + // Param is passed by value, moved + pub fn set_firmware_present(&mut self, v: bool) { + self.firmware_present = ::std::option::Option::Some(v); + } + + pub fn get_firmware_present(&self) -> bool { + self.firmware_present.unwrap_or(false) + } + + // optional bool needs_backup = 19; + + pub fn clear_needs_backup(&mut self) { + self.needs_backup = ::std::option::Option::None; + } + + pub fn has_needs_backup(&self) -> bool { + self.needs_backup.is_some() + } + + // Param is passed by value, moved + pub fn set_needs_backup(&mut self, v: bool) { + self.needs_backup = ::std::option::Option::Some(v); + } + + pub fn get_needs_backup(&self) -> bool { + self.needs_backup.unwrap_or(false) + } + + // optional uint32 flags = 20; + + pub fn clear_flags(&mut self) { + self.flags = ::std::option::Option::None; + } + + pub fn has_flags(&self) -> bool { + self.flags.is_some() + } + + // Param is passed by value, moved + pub fn set_flags(&mut self, v: u32) { + self.flags = ::std::option::Option::Some(v); + } + + pub fn get_flags(&self) -> u32 { + self.flags.unwrap_or(0) + } + + // optional string model = 21; + + pub fn clear_model(&mut self) { + self.model.clear(); + } + + pub fn has_model(&self) -> bool { + self.model.is_some() + } + + // Param is passed by value, moved + pub fn set_model(&mut self, v: ::std::string::String) { + self.model = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_model(&mut self) -> &mut ::std::string::String { + if self.model.is_none() { + self.model.set_default(); + } + self.model.as_mut().unwrap() + } + + // Take field + pub fn take_model(&mut self) -> ::std::string::String { + self.model.take().unwrap_or_else(|| ::std::string::String::new()) + } + + pub fn get_model(&self) -> &str { + match self.model.as_ref() { + Some(v) => &v, + None => "", + } + } + + // optional uint32 fw_major = 22; + + pub fn clear_fw_major(&mut self) { + self.fw_major = ::std::option::Option::None; + } + + pub fn has_fw_major(&self) -> bool { + self.fw_major.is_some() + } + + // Param is passed by value, moved + pub fn set_fw_major(&mut self, v: u32) { + self.fw_major = ::std::option::Option::Some(v); + } + + pub fn get_fw_major(&self) -> u32 { + self.fw_major.unwrap_or(0) + } + + // optional uint32 fw_minor = 23; + + pub fn clear_fw_minor(&mut self) { + self.fw_minor = ::std::option::Option::None; + } + + pub fn has_fw_minor(&self) -> bool { + self.fw_minor.is_some() + } + + // Param is passed by value, moved + pub fn set_fw_minor(&mut self, v: u32) { + self.fw_minor = ::std::option::Option::Some(v); + } + + pub fn get_fw_minor(&self) -> u32 { + self.fw_minor.unwrap_or(0) + } + + // optional uint32 fw_patch = 24; + + pub fn clear_fw_patch(&mut self) { + self.fw_patch = ::std::option::Option::None; + } + + pub fn has_fw_patch(&self) -> bool { + self.fw_patch.is_some() + } + + // Param is passed by value, moved + pub fn set_fw_patch(&mut self, v: u32) { + self.fw_patch = ::std::option::Option::Some(v); + } + + pub fn get_fw_patch(&self) -> u32 { + self.fw_patch.unwrap_or(0) + } + + // optional string fw_vendor = 25; + + pub fn clear_fw_vendor(&mut self) { + self.fw_vendor.clear(); + } + + pub fn has_fw_vendor(&self) -> bool { + self.fw_vendor.is_some() + } + + // Param is passed by value, moved + pub fn set_fw_vendor(&mut self, v: ::std::string::String) { + self.fw_vendor = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_fw_vendor(&mut self) -> &mut ::std::string::String { + if self.fw_vendor.is_none() { + self.fw_vendor.set_default(); + } + self.fw_vendor.as_mut().unwrap() + } + + // Take field + pub fn take_fw_vendor(&mut self) -> ::std::string::String { + self.fw_vendor.take().unwrap_or_else(|| ::std::string::String::new()) + } + + pub fn get_fw_vendor(&self) -> &str { + match self.fw_vendor.as_ref() { + Some(v) => &v, + None => "", + } + } + + // optional bytes fw_vendor_keys = 26; + + pub fn clear_fw_vendor_keys(&mut self) { + self.fw_vendor_keys.clear(); + } + + pub fn has_fw_vendor_keys(&self) -> bool { + self.fw_vendor_keys.is_some() + } + + // Param is passed by value, moved + pub fn set_fw_vendor_keys(&mut self, v: ::std::vec::Vec) { + self.fw_vendor_keys = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_fw_vendor_keys(&mut self) -> &mut ::std::vec::Vec { + if self.fw_vendor_keys.is_none() { + self.fw_vendor_keys.set_default(); + } + self.fw_vendor_keys.as_mut().unwrap() + } + + // Take field + pub fn take_fw_vendor_keys(&mut self) -> ::std::vec::Vec { + self.fw_vendor_keys.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + pub fn get_fw_vendor_keys(&self) -> &[u8] { + match self.fw_vendor_keys.as_ref() { + Some(v) => &v, + None => &[], + } + } + + // optional bool unfinished_backup = 27; + + pub fn clear_unfinished_backup(&mut self) { + self.unfinished_backup = ::std::option::Option::None; + } + + pub fn has_unfinished_backup(&self) -> bool { + self.unfinished_backup.is_some() + } + + // Param is passed by value, moved + pub fn set_unfinished_backup(&mut self, v: bool) { + self.unfinished_backup = ::std::option::Option::Some(v); + } + + pub fn get_unfinished_backup(&self) -> bool { + self.unfinished_backup.unwrap_or(false) + } + + // optional bool no_backup = 28; + + pub fn clear_no_backup(&mut self) { + self.no_backup = ::std::option::Option::None; + } + + pub fn has_no_backup(&self) -> bool { + self.no_backup.is_some() + } + + // Param is passed by value, moved + pub fn set_no_backup(&mut self, v: bool) { + self.no_backup = ::std::option::Option::Some(v); + } + + pub fn get_no_backup(&self) -> bool { + self.no_backup.unwrap_or(false) + } +} + +impl ::protobuf::Message for Features { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.vendor)?; + }, + 2 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_uint32()?; + self.major_version = ::std::option::Option::Some(tmp); + }, + 3 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_uint32()?; + self.minor_version = ::std::option::Option::Some(tmp); + }, + 4 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_uint32()?; + self.patch_version = ::std::option::Option::Some(tmp); + }, + 5 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_bool()?; + self.bootloader_mode = ::std::option::Option::Some(tmp); + }, + 6 => { + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.device_id)?; + }, + 7 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_bool()?; + self.pin_protection = ::std::option::Option::Some(tmp); + }, + 8 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_bool()?; + self.passphrase_protection = ::std::option::Option::Some(tmp); + }, + 9 => { + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.language)?; + }, + 10 => { + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.label)?; + }, + 12 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_bool()?; + self.initialized = ::std::option::Option::Some(tmp); + }, + 13 => { + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.revision)?; + }, + 14 => { + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.bootloader_hash)?; + }, + 15 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_bool()?; + self.imported = ::std::option::Option::Some(tmp); + }, + 16 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_bool()?; + self.pin_cached = ::std::option::Option::Some(tmp); + }, + 17 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_bool()?; + self.passphrase_cached = ::std::option::Option::Some(tmp); + }, + 18 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_bool()?; + self.firmware_present = ::std::option::Option::Some(tmp); + }, + 19 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_bool()?; + self.needs_backup = ::std::option::Option::Some(tmp); + }, + 20 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_uint32()?; + self.flags = ::std::option::Option::Some(tmp); + }, + 21 => { + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.model)?; + }, + 22 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_uint32()?; + self.fw_major = ::std::option::Option::Some(tmp); + }, + 23 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_uint32()?; + self.fw_minor = ::std::option::Option::Some(tmp); + }, + 24 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_uint32()?; + self.fw_patch = ::std::option::Option::Some(tmp); + }, + 25 => { + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.fw_vendor)?; + }, + 26 => { + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.fw_vendor_keys)?; + }, + 27 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_bool()?; + self.unfinished_backup = ::std::option::Option::Some(tmp); + }, + 28 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_bool()?; + self.no_backup = ::std::option::Option::Some(tmp); + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if let Some(ref v) = self.vendor.as_ref() { + my_size += ::protobuf::rt::string_size(1, &v); + } + if let Some(v) = self.major_version { + my_size += ::protobuf::rt::value_size(2, v, ::protobuf::wire_format::WireTypeVarint); + } + if let Some(v) = self.minor_version { + my_size += ::protobuf::rt::value_size(3, v, ::protobuf::wire_format::WireTypeVarint); + } + if let Some(v) = self.patch_version { + my_size += ::protobuf::rt::value_size(4, v, ::protobuf::wire_format::WireTypeVarint); + } + if let Some(v) = self.bootloader_mode { + my_size += 2; + } + if let Some(ref v) = self.device_id.as_ref() { + my_size += ::protobuf::rt::string_size(6, &v); + } + if let Some(v) = self.pin_protection { + my_size += 2; + } + if let Some(v) = self.passphrase_protection { + my_size += 2; + } + if let Some(ref v) = self.language.as_ref() { + my_size += ::protobuf::rt::string_size(9, &v); + } + if let Some(ref v) = self.label.as_ref() { + my_size += ::protobuf::rt::string_size(10, &v); + } + if let Some(v) = self.initialized { + my_size += 2; + } + if let Some(ref v) = self.revision.as_ref() { + my_size += ::protobuf::rt::bytes_size(13, &v); + } + if let Some(ref v) = self.bootloader_hash.as_ref() { + my_size += ::protobuf::rt::bytes_size(14, &v); + } + if let Some(v) = self.imported { + my_size += 2; + } + if let Some(v) = self.pin_cached { + my_size += 3; + } + if let Some(v) = self.passphrase_cached { + my_size += 3; + } + if let Some(v) = self.firmware_present { + my_size += 3; + } + if let Some(v) = self.needs_backup { + my_size += 3; + } + if let Some(v) = self.flags { + my_size += ::protobuf::rt::value_size(20, v, ::protobuf::wire_format::WireTypeVarint); + } + if let Some(ref v) = self.model.as_ref() { + my_size += ::protobuf::rt::string_size(21, &v); + } + if let Some(v) = self.fw_major { + my_size += ::protobuf::rt::value_size(22, v, ::protobuf::wire_format::WireTypeVarint); + } + if let Some(v) = self.fw_minor { + my_size += ::protobuf::rt::value_size(23, v, ::protobuf::wire_format::WireTypeVarint); + } + if let Some(v) = self.fw_patch { + my_size += ::protobuf::rt::value_size(24, v, ::protobuf::wire_format::WireTypeVarint); + } + if let Some(ref v) = self.fw_vendor.as_ref() { + my_size += ::protobuf::rt::string_size(25, &v); + } + if let Some(ref v) = self.fw_vendor_keys.as_ref() { + my_size += ::protobuf::rt::bytes_size(26, &v); + } + if let Some(v) = self.unfinished_backup { + my_size += 3; + } + if let Some(v) = self.no_backup { + my_size += 3; + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + if let Some(ref v) = self.vendor.as_ref() { + os.write_string(1, &v)?; + } + if let Some(v) = self.major_version { + os.write_uint32(2, v)?; + } + if let Some(v) = self.minor_version { + os.write_uint32(3, v)?; + } + if let Some(v) = self.patch_version { + os.write_uint32(4, v)?; + } + if let Some(v) = self.bootloader_mode { + os.write_bool(5, v)?; + } + if let Some(ref v) = self.device_id.as_ref() { + os.write_string(6, &v)?; + } + if let Some(v) = self.pin_protection { + os.write_bool(7, v)?; + } + if let Some(v) = self.passphrase_protection { + os.write_bool(8, v)?; + } + if let Some(ref v) = self.language.as_ref() { + os.write_string(9, &v)?; + } + if let Some(ref v) = self.label.as_ref() { + os.write_string(10, &v)?; + } + if let Some(v) = self.initialized { + os.write_bool(12, v)?; + } + if let Some(ref v) = self.revision.as_ref() { + os.write_bytes(13, &v)?; + } + if let Some(ref v) = self.bootloader_hash.as_ref() { + os.write_bytes(14, &v)?; + } + if let Some(v) = self.imported { + os.write_bool(15, v)?; + } + if let Some(v) = self.pin_cached { + os.write_bool(16, v)?; + } + if let Some(v) = self.passphrase_cached { + os.write_bool(17, v)?; + } + if let Some(v) = self.firmware_present { + os.write_bool(18, v)?; + } + if let Some(v) = self.needs_backup { + os.write_bool(19, v)?; + } + if let Some(v) = self.flags { + os.write_uint32(20, v)?; + } + if let Some(ref v) = self.model.as_ref() { + os.write_string(21, &v)?; + } + if let Some(v) = self.fw_major { + os.write_uint32(22, v)?; + } + if let Some(v) = self.fw_minor { + os.write_uint32(23, v)?; + } + if let Some(v) = self.fw_patch { + os.write_uint32(24, v)?; + } + if let Some(ref v) = self.fw_vendor.as_ref() { + os.write_string(25, &v)?; + } + if let Some(ref v) = self.fw_vendor_keys.as_ref() { + os.write_bytes(26, &v)?; + } + if let Some(v) = self.unfinished_backup { + os.write_bool(27, v)?; + } + if let Some(v) = self.no_backup { + os.write_bool(28, v)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &::std::any::Any { + self as &::std::any::Any + } + fn as_any_mut(&mut self) -> &mut ::std::any::Any { + self as &mut ::std::any::Any + } + fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> Features { + Features::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "vendor", + |m: &Features| { &m.vendor }, + |m: &mut Features| { &mut m.vendor }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( + "major_version", + |m: &Features| { &m.major_version }, + |m: &mut Features| { &mut m.major_version }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( + "minor_version", + |m: &Features| { &m.minor_version }, + |m: &mut Features| { &mut m.minor_version }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( + "patch_version", + |m: &Features| { &m.patch_version }, + |m: &mut Features| { &mut m.patch_version }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "bootloader_mode", + |m: &Features| { &m.bootloader_mode }, + |m: &mut Features| { &mut m.bootloader_mode }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "device_id", + |m: &Features| { &m.device_id }, + |m: &mut Features| { &mut m.device_id }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "pin_protection", + |m: &Features| { &m.pin_protection }, + |m: &mut Features| { &mut m.pin_protection }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "passphrase_protection", + |m: &Features| { &m.passphrase_protection }, + |m: &mut Features| { &mut m.passphrase_protection }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "language", + |m: &Features| { &m.language }, + |m: &mut Features| { &mut m.language }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "label", + |m: &Features| { &m.label }, + |m: &mut Features| { &mut m.label }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "initialized", + |m: &Features| { &m.initialized }, + |m: &mut Features| { &mut m.initialized }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "revision", + |m: &Features| { &m.revision }, + |m: &mut Features| { &mut m.revision }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "bootloader_hash", + |m: &Features| { &m.bootloader_hash }, + |m: &mut Features| { &mut m.bootloader_hash }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "imported", + |m: &Features| { &m.imported }, + |m: &mut Features| { &mut m.imported }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "pin_cached", + |m: &Features| { &m.pin_cached }, + |m: &mut Features| { &mut m.pin_cached }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "passphrase_cached", + |m: &Features| { &m.passphrase_cached }, + |m: &mut Features| { &mut m.passphrase_cached }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "firmware_present", + |m: &Features| { &m.firmware_present }, + |m: &mut Features| { &mut m.firmware_present }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "needs_backup", + |m: &Features| { &m.needs_backup }, + |m: &mut Features| { &mut m.needs_backup }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( + "flags", + |m: &Features| { &m.flags }, + |m: &mut Features| { &mut m.flags }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "model", + |m: &Features| { &m.model }, + |m: &mut Features| { &mut m.model }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( + "fw_major", + |m: &Features| { &m.fw_major }, + |m: &mut Features| { &mut m.fw_major }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( + "fw_minor", + |m: &Features| { &m.fw_minor }, + |m: &mut Features| { &mut m.fw_minor }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( + "fw_patch", + |m: &Features| { &m.fw_patch }, + |m: &mut Features| { &mut m.fw_patch }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "fw_vendor", + |m: &Features| { &m.fw_vendor }, + |m: &mut Features| { &mut m.fw_vendor }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "fw_vendor_keys", + |m: &Features| { &m.fw_vendor_keys }, + |m: &mut Features| { &mut m.fw_vendor_keys }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "unfinished_backup", + |m: &Features| { &m.unfinished_backup }, + |m: &mut Features| { &mut m.unfinished_backup }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "no_backup", + |m: &Features| { &m.no_backup }, + |m: &mut Features| { &mut m.no_backup }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "Features", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static Features { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const Features, + }; + unsafe { + instance.get(Features::new) + } + } +} + +impl ::protobuf::Clear for Features { + fn clear(&mut self) { + self.clear_vendor(); + self.clear_major_version(); + self.clear_minor_version(); + self.clear_patch_version(); + self.clear_bootloader_mode(); + self.clear_device_id(); + self.clear_pin_protection(); + self.clear_passphrase_protection(); + self.clear_language(); + self.clear_label(); + self.clear_initialized(); + self.clear_revision(); + self.clear_bootloader_hash(); + self.clear_imported(); + self.clear_pin_cached(); + self.clear_passphrase_cached(); + self.clear_firmware_present(); + self.clear_needs_backup(); + self.clear_flags(); + self.clear_model(); + self.clear_fw_major(); + self.clear_fw_minor(); + self.clear_fw_patch(); + self.clear_fw_vendor(); + self.clear_fw_vendor_keys(); + self.clear_unfinished_backup(); + self.clear_no_backup(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for Features { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for Features { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct ClearSession { + // special fields + unknown_fields: ::protobuf::UnknownFields, + cached_size: ::protobuf::CachedSize, +} + +impl ClearSession { + pub fn new() -> ClearSession { + ::std::default::Default::default() + } +} + +impl ::protobuf::Message for ClearSession { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &::std::any::Any { + self as &::std::any::Any + } + fn as_any_mut(&mut self) -> &mut ::std::any::Any { + self as &mut ::std::any::Any + } + fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> ClearSession { + ClearSession::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let fields = ::std::vec::Vec::new(); + ::protobuf::reflect::MessageDescriptor::new::( + "ClearSession", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static ClearSession { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ClearSession, + }; + unsafe { + instance.get(ClearSession::new) + } + } +} + +impl ::protobuf::Clear for ClearSession { + fn clear(&mut self) { + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for ClearSession { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for ClearSession { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct ApplySettings { + // message fields + language: ::protobuf::SingularField<::std::string::String>, + label: ::protobuf::SingularField<::std::string::String>, + use_passphrase: ::std::option::Option, + homescreen: ::protobuf::SingularField<::std::vec::Vec>, + passphrase_source: ::std::option::Option, + auto_lock_delay_ms: ::std::option::Option, + // special fields + unknown_fields: ::protobuf::UnknownFields, + cached_size: ::protobuf::CachedSize, +} + +impl ApplySettings { + pub fn new() -> ApplySettings { + ::std::default::Default::default() + } + + // optional string language = 1; + + pub fn clear_language(&mut self) { + self.language.clear(); + } + + pub fn has_language(&self) -> bool { + self.language.is_some() + } + + // Param is passed by value, moved + pub fn set_language(&mut self, v: ::std::string::String) { + self.language = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_language(&mut self) -> &mut ::std::string::String { + if self.language.is_none() { + self.language.set_default(); + } + self.language.as_mut().unwrap() + } + + // Take field + pub fn take_language(&mut self) -> ::std::string::String { + self.language.take().unwrap_or_else(|| ::std::string::String::new()) + } + + pub fn get_language(&self) -> &str { + match self.language.as_ref() { + Some(v) => &v, + None => "", + } + } + + // optional string label = 2; + + pub fn clear_label(&mut self) { + self.label.clear(); + } + + pub fn has_label(&self) -> bool { + self.label.is_some() + } + + // Param is passed by value, moved + pub fn set_label(&mut self, v: ::std::string::String) { + self.label = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_label(&mut self) -> &mut ::std::string::String { + if self.label.is_none() { + self.label.set_default(); + } + self.label.as_mut().unwrap() + } + + // Take field + pub fn take_label(&mut self) -> ::std::string::String { + self.label.take().unwrap_or_else(|| ::std::string::String::new()) + } + + pub fn get_label(&self) -> &str { + match self.label.as_ref() { + Some(v) => &v, + None => "", + } + } + + // optional bool use_passphrase = 3; + + pub fn clear_use_passphrase(&mut self) { + self.use_passphrase = ::std::option::Option::None; + } + + pub fn has_use_passphrase(&self) -> bool { + self.use_passphrase.is_some() + } + + // Param is passed by value, moved + pub fn set_use_passphrase(&mut self, v: bool) { + self.use_passphrase = ::std::option::Option::Some(v); + } + + pub fn get_use_passphrase(&self) -> bool { + self.use_passphrase.unwrap_or(false) + } + + // optional bytes homescreen = 4; + + pub fn clear_homescreen(&mut self) { + self.homescreen.clear(); + } + + pub fn has_homescreen(&self) -> bool { + self.homescreen.is_some() + } + + // Param is passed by value, moved + pub fn set_homescreen(&mut self, v: ::std::vec::Vec) { + self.homescreen = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_homescreen(&mut self) -> &mut ::std::vec::Vec { + if self.homescreen.is_none() { + self.homescreen.set_default(); + } + self.homescreen.as_mut().unwrap() + } + + // Take field + pub fn take_homescreen(&mut self) -> ::std::vec::Vec { + self.homescreen.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + pub fn get_homescreen(&self) -> &[u8] { + match self.homescreen.as_ref() { + Some(v) => &v, + None => &[], + } + } + + // optional .hw.trezor.messages.management.ApplySettings.PassphraseSourceType passphrase_source = 5; + + pub fn clear_passphrase_source(&mut self) { + self.passphrase_source = ::std::option::Option::None; + } + + pub fn has_passphrase_source(&self) -> bool { + self.passphrase_source.is_some() + } + + // Param is passed by value, moved + pub fn set_passphrase_source(&mut self, v: ApplySettings_PassphraseSourceType) { + self.passphrase_source = ::std::option::Option::Some(v); + } + + pub fn get_passphrase_source(&self) -> ApplySettings_PassphraseSourceType { + self.passphrase_source.unwrap_or(ApplySettings_PassphraseSourceType::ASK) + } + + // optional uint32 auto_lock_delay_ms = 6; + + pub fn clear_auto_lock_delay_ms(&mut self) { + self.auto_lock_delay_ms = ::std::option::Option::None; + } + + pub fn has_auto_lock_delay_ms(&self) -> bool { + self.auto_lock_delay_ms.is_some() + } + + // Param is passed by value, moved + pub fn set_auto_lock_delay_ms(&mut self, v: u32) { + self.auto_lock_delay_ms = ::std::option::Option::Some(v); + } + + pub fn get_auto_lock_delay_ms(&self) -> u32 { + self.auto_lock_delay_ms.unwrap_or(0) + } +} + +impl ::protobuf::Message for ApplySettings { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.language)?; + }, + 2 => { + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.label)?; + }, + 3 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_bool()?; + self.use_passphrase = ::std::option::Option::Some(tmp); + }, + 4 => { + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.homescreen)?; + }, + 5 => { + ::protobuf::rt::read_proto2_enum_with_unknown_fields_into(wire_type, is, &mut self.passphrase_source, 5, &mut self.unknown_fields)? + }, + 6 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_uint32()?; + self.auto_lock_delay_ms = ::std::option::Option::Some(tmp); + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if let Some(ref v) = self.language.as_ref() { + my_size += ::protobuf::rt::string_size(1, &v); + } + if let Some(ref v) = self.label.as_ref() { + my_size += ::protobuf::rt::string_size(2, &v); + } + if let Some(v) = self.use_passphrase { + my_size += 2; + } + if let Some(ref v) = self.homescreen.as_ref() { + my_size += ::protobuf::rt::bytes_size(4, &v); + } + if let Some(v) = self.passphrase_source { + my_size += ::protobuf::rt::enum_size(5, v); + } + if let Some(v) = self.auto_lock_delay_ms { + my_size += ::protobuf::rt::value_size(6, v, ::protobuf::wire_format::WireTypeVarint); + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + if let Some(ref v) = self.language.as_ref() { + os.write_string(1, &v)?; + } + if let Some(ref v) = self.label.as_ref() { + os.write_string(2, &v)?; + } + if let Some(v) = self.use_passphrase { + os.write_bool(3, v)?; + } + if let Some(ref v) = self.homescreen.as_ref() { + os.write_bytes(4, &v)?; + } + if let Some(v) = self.passphrase_source { + os.write_enum(5, v.value())?; + } + if let Some(v) = self.auto_lock_delay_ms { + os.write_uint32(6, v)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &::std::any::Any { + self as &::std::any::Any + } + fn as_any_mut(&mut self) -> &mut ::std::any::Any { + self as &mut ::std::any::Any + } + fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> ApplySettings { + ApplySettings::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "language", + |m: &ApplySettings| { &m.language }, + |m: &mut ApplySettings| { &mut m.language }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "label", + |m: &ApplySettings| { &m.label }, + |m: &mut ApplySettings| { &mut m.label }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "use_passphrase", + |m: &ApplySettings| { &m.use_passphrase }, + |m: &mut ApplySettings| { &mut m.use_passphrase }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "homescreen", + |m: &ApplySettings| { &m.homescreen }, + |m: &mut ApplySettings| { &mut m.homescreen }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( + "passphrase_source", + |m: &ApplySettings| { &m.passphrase_source }, + |m: &mut ApplySettings| { &mut m.passphrase_source }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( + "auto_lock_delay_ms", + |m: &ApplySettings| { &m.auto_lock_delay_ms }, + |m: &mut ApplySettings| { &mut m.auto_lock_delay_ms }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "ApplySettings", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static ApplySettings { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ApplySettings, + }; + unsafe { + instance.get(ApplySettings::new) + } + } +} + +impl ::protobuf::Clear for ApplySettings { + fn clear(&mut self) { + self.clear_language(); + self.clear_label(); + self.clear_use_passphrase(); + self.clear_homescreen(); + self.clear_passphrase_source(); + self.clear_auto_lock_delay_ms(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for ApplySettings { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for ApplySettings { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(Clone,PartialEq,Eq,Debug,Hash)] +pub enum ApplySettings_PassphraseSourceType { + ASK = 0, + DEVICE = 1, + HOST = 2, +} + +impl ::protobuf::ProtobufEnum for ApplySettings_PassphraseSourceType { + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 0 => ::std::option::Option::Some(ApplySettings_PassphraseSourceType::ASK), + 1 => ::std::option::Option::Some(ApplySettings_PassphraseSourceType::DEVICE), + 2 => ::std::option::Option::Some(ApplySettings_PassphraseSourceType::HOST), + _ => ::std::option::Option::None + } + } + + fn values() -> &'static [Self] { + static values: &'static [ApplySettings_PassphraseSourceType] = &[ + ApplySettings_PassphraseSourceType::ASK, + ApplySettings_PassphraseSourceType::DEVICE, + ApplySettings_PassphraseSourceType::HOST, + ]; + values + } + + fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::EnumDescriptor, + }; + unsafe { + descriptor.get(|| { + ::protobuf::reflect::EnumDescriptor::new("ApplySettings_PassphraseSourceType", file_descriptor_proto()) + }) + } + } +} + +impl ::std::marker::Copy for ApplySettings_PassphraseSourceType { +} + +impl ::protobuf::reflect::ProtobufValue for ApplySettings_PassphraseSourceType { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct ApplyFlags { + // message fields + flags: ::std::option::Option, + // special fields + unknown_fields: ::protobuf::UnknownFields, + cached_size: ::protobuf::CachedSize, +} + +impl ApplyFlags { + pub fn new() -> ApplyFlags { + ::std::default::Default::default() + } + + // optional uint32 flags = 1; + + pub fn clear_flags(&mut self) { + self.flags = ::std::option::Option::None; + } + + pub fn has_flags(&self) -> bool { + self.flags.is_some() + } + + // Param is passed by value, moved + pub fn set_flags(&mut self, v: u32) { + self.flags = ::std::option::Option::Some(v); + } + + pub fn get_flags(&self) -> u32 { + self.flags.unwrap_or(0) + } +} + +impl ::protobuf::Message for ApplyFlags { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_uint32()?; + self.flags = ::std::option::Option::Some(tmp); + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if let Some(v) = self.flags { + my_size += ::protobuf::rt::value_size(1, v, ::protobuf::wire_format::WireTypeVarint); + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + if let Some(v) = self.flags { + os.write_uint32(1, v)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &::std::any::Any { + self as &::std::any::Any + } + fn as_any_mut(&mut self) -> &mut ::std::any::Any { + self as &mut ::std::any::Any + } + fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> ApplyFlags { + ApplyFlags::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( + "flags", + |m: &ApplyFlags| { &m.flags }, + |m: &mut ApplyFlags| { &mut m.flags }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "ApplyFlags", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static ApplyFlags { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ApplyFlags, + }; + unsafe { + instance.get(ApplyFlags::new) + } + } +} + +impl ::protobuf::Clear for ApplyFlags { + fn clear(&mut self) { + self.clear_flags(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for ApplyFlags { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for ApplyFlags { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct ChangePin { + // message fields + remove: ::std::option::Option, + // special fields + unknown_fields: ::protobuf::UnknownFields, + cached_size: ::protobuf::CachedSize, +} + +impl ChangePin { + pub fn new() -> ChangePin { + ::std::default::Default::default() + } + + // optional bool remove = 1; + + pub fn clear_remove(&mut self) { + self.remove = ::std::option::Option::None; + } + + pub fn has_remove(&self) -> bool { + self.remove.is_some() + } + + // Param is passed by value, moved + pub fn set_remove(&mut self, v: bool) { + self.remove = ::std::option::Option::Some(v); + } + + pub fn get_remove(&self) -> bool { + self.remove.unwrap_or(false) + } +} + +impl ::protobuf::Message for ChangePin { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_bool()?; + self.remove = ::std::option::Option::Some(tmp); + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if let Some(v) = self.remove { + my_size += 2; + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + if let Some(v) = self.remove { + os.write_bool(1, v)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &::std::any::Any { + self as &::std::any::Any + } + fn as_any_mut(&mut self) -> &mut ::std::any::Any { + self as &mut ::std::any::Any + } + fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> ChangePin { + ChangePin::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "remove", + |m: &ChangePin| { &m.remove }, + |m: &mut ChangePin| { &mut m.remove }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "ChangePin", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static ChangePin { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ChangePin, + }; + unsafe { + instance.get(ChangePin::new) + } + } +} + +impl ::protobuf::Clear for ChangePin { + fn clear(&mut self) { + self.clear_remove(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for ChangePin { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for ChangePin { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct Ping { + // message fields + message: ::protobuf::SingularField<::std::string::String>, + button_protection: ::std::option::Option, + pin_protection: ::std::option::Option, + passphrase_protection: ::std::option::Option, + // special fields + unknown_fields: ::protobuf::UnknownFields, + cached_size: ::protobuf::CachedSize, +} + +impl Ping { + pub fn new() -> Ping { + ::std::default::Default::default() + } + + // optional string message = 1; + + pub fn clear_message(&mut self) { + self.message.clear(); + } + + pub fn has_message(&self) -> bool { + self.message.is_some() + } + + // Param is passed by value, moved + pub fn set_message(&mut self, v: ::std::string::String) { + self.message = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_message(&mut self) -> &mut ::std::string::String { + if self.message.is_none() { + self.message.set_default(); + } + self.message.as_mut().unwrap() + } + + // Take field + pub fn take_message(&mut self) -> ::std::string::String { + self.message.take().unwrap_or_else(|| ::std::string::String::new()) + } + + pub fn get_message(&self) -> &str { + match self.message.as_ref() { + Some(v) => &v, + None => "", + } + } + + // optional bool button_protection = 2; + + pub fn clear_button_protection(&mut self) { + self.button_protection = ::std::option::Option::None; + } + + pub fn has_button_protection(&self) -> bool { + self.button_protection.is_some() + } + + // Param is passed by value, moved + pub fn set_button_protection(&mut self, v: bool) { + self.button_protection = ::std::option::Option::Some(v); + } + + pub fn get_button_protection(&self) -> bool { + self.button_protection.unwrap_or(false) + } + + // optional bool pin_protection = 3; + + pub fn clear_pin_protection(&mut self) { + self.pin_protection = ::std::option::Option::None; + } + + pub fn has_pin_protection(&self) -> bool { + self.pin_protection.is_some() + } + + // Param is passed by value, moved + pub fn set_pin_protection(&mut self, v: bool) { + self.pin_protection = ::std::option::Option::Some(v); + } + + pub fn get_pin_protection(&self) -> bool { + self.pin_protection.unwrap_or(false) + } + + // optional bool passphrase_protection = 4; + + pub fn clear_passphrase_protection(&mut self) { + self.passphrase_protection = ::std::option::Option::None; + } + + pub fn has_passphrase_protection(&self) -> bool { + self.passphrase_protection.is_some() + } + + // Param is passed by value, moved + pub fn set_passphrase_protection(&mut self, v: bool) { + self.passphrase_protection = ::std::option::Option::Some(v); + } + + pub fn get_passphrase_protection(&self) -> bool { + self.passphrase_protection.unwrap_or(false) + } +} + +impl ::protobuf::Message for Ping { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.message)?; + }, + 2 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_bool()?; + self.button_protection = ::std::option::Option::Some(tmp); + }, + 3 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_bool()?; + self.pin_protection = ::std::option::Option::Some(tmp); + }, + 4 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_bool()?; + self.passphrase_protection = ::std::option::Option::Some(tmp); + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if let Some(ref v) = self.message.as_ref() { + my_size += ::protobuf::rt::string_size(1, &v); + } + if let Some(v) = self.button_protection { + my_size += 2; + } + if let Some(v) = self.pin_protection { + my_size += 2; + } + if let Some(v) = self.passphrase_protection { + my_size += 2; + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + if let Some(ref v) = self.message.as_ref() { + os.write_string(1, &v)?; + } + if let Some(v) = self.button_protection { + os.write_bool(2, v)?; + } + if let Some(v) = self.pin_protection { + os.write_bool(3, v)?; + } + if let Some(v) = self.passphrase_protection { + os.write_bool(4, v)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &::std::any::Any { + self as &::std::any::Any + } + fn as_any_mut(&mut self) -> &mut ::std::any::Any { + self as &mut ::std::any::Any + } + fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> Ping { + Ping::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "message", + |m: &Ping| { &m.message }, + |m: &mut Ping| { &mut m.message }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "button_protection", + |m: &Ping| { &m.button_protection }, + |m: &mut Ping| { &mut m.button_protection }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "pin_protection", + |m: &Ping| { &m.pin_protection }, + |m: &mut Ping| { &mut m.pin_protection }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "passphrase_protection", + |m: &Ping| { &m.passphrase_protection }, + |m: &mut Ping| { &mut m.passphrase_protection }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "Ping", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static Ping { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const Ping, + }; + unsafe { + instance.get(Ping::new) + } + } +} + +impl ::protobuf::Clear for Ping { + fn clear(&mut self) { + self.clear_message(); + self.clear_button_protection(); + self.clear_pin_protection(); + self.clear_passphrase_protection(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for Ping { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for Ping { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct Cancel { + // special fields + unknown_fields: ::protobuf::UnknownFields, + cached_size: ::protobuf::CachedSize, +} + +impl Cancel { + pub fn new() -> Cancel { + ::std::default::Default::default() + } +} + +impl ::protobuf::Message for Cancel { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &::std::any::Any { + self as &::std::any::Any + } + fn as_any_mut(&mut self) -> &mut ::std::any::Any { + self as &mut ::std::any::Any + } + fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> Cancel { + Cancel::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let fields = ::std::vec::Vec::new(); + ::protobuf::reflect::MessageDescriptor::new::( + "Cancel", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static Cancel { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const Cancel, + }; + unsafe { + instance.get(Cancel::new) + } + } +} + +impl ::protobuf::Clear for Cancel { + fn clear(&mut self) { + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for Cancel { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for Cancel { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct GetEntropy { + // message fields + size: ::std::option::Option, + // special fields + unknown_fields: ::protobuf::UnknownFields, + cached_size: ::protobuf::CachedSize, +} + +impl GetEntropy { + pub fn new() -> GetEntropy { + ::std::default::Default::default() + } + + // required uint32 size = 1; + + pub fn clear_size(&mut self) { + self.size = ::std::option::Option::None; + } + + pub fn has_size(&self) -> bool { + self.size.is_some() + } + + // Param is passed by value, moved + pub fn set_size(&mut self, v: u32) { + self.size = ::std::option::Option::Some(v); + } + + pub fn get_size(&self) -> u32 { + self.size.unwrap_or(0) + } +} + +impl ::protobuf::Message for GetEntropy { + fn is_initialized(&self) -> bool { + if self.size.is_none() { + return false; + } + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_uint32()?; + self.size = ::std::option::Option::Some(tmp); + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if let Some(v) = self.size { + my_size += ::protobuf::rt::value_size(1, v, ::protobuf::wire_format::WireTypeVarint); + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + if let Some(v) = self.size { + os.write_uint32(1, v)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &::std::any::Any { + self as &::std::any::Any + } + fn as_any_mut(&mut self) -> &mut ::std::any::Any { + self as &mut ::std::any::Any + } + fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> GetEntropy { + GetEntropy::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( + "size", + |m: &GetEntropy| { &m.size }, + |m: &mut GetEntropy| { &mut m.size }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "GetEntropy", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static GetEntropy { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const GetEntropy, + }; + unsafe { + instance.get(GetEntropy::new) + } + } +} + +impl ::protobuf::Clear for GetEntropy { + fn clear(&mut self) { + self.clear_size(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for GetEntropy { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for GetEntropy { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct Entropy { + // message fields + entropy: ::protobuf::SingularField<::std::vec::Vec>, + // special fields + unknown_fields: ::protobuf::UnknownFields, + cached_size: ::protobuf::CachedSize, +} + +impl Entropy { + pub fn new() -> Entropy { + ::std::default::Default::default() + } + + // required bytes entropy = 1; + + pub fn clear_entropy(&mut self) { + self.entropy.clear(); + } + + pub fn has_entropy(&self) -> bool { + self.entropy.is_some() + } + + // Param is passed by value, moved + pub fn set_entropy(&mut self, v: ::std::vec::Vec) { + self.entropy = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_entropy(&mut self) -> &mut ::std::vec::Vec { + if self.entropy.is_none() { + self.entropy.set_default(); + } + self.entropy.as_mut().unwrap() + } + + // Take field + pub fn take_entropy(&mut self) -> ::std::vec::Vec { + self.entropy.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + pub fn get_entropy(&self) -> &[u8] { + match self.entropy.as_ref() { + Some(v) => &v, + None => &[], + } + } +} + +impl ::protobuf::Message for Entropy { + fn is_initialized(&self) -> bool { + if self.entropy.is_none() { + return false; + } + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.entropy)?; + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if let Some(ref v) = self.entropy.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &v); + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + if let Some(ref v) = self.entropy.as_ref() { + os.write_bytes(1, &v)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &::std::any::Any { + self as &::std::any::Any + } + fn as_any_mut(&mut self) -> &mut ::std::any::Any { + self as &mut ::std::any::Any + } + fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> Entropy { + Entropy::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "entropy", + |m: &Entropy| { &m.entropy }, + |m: &mut Entropy| { &mut m.entropy }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "Entropy", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static Entropy { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const Entropy, + }; + unsafe { + instance.get(Entropy::new) + } + } +} + +impl ::protobuf::Clear for Entropy { + fn clear(&mut self) { + self.clear_entropy(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for Entropy { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for Entropy { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct WipeDevice { + // special fields + unknown_fields: ::protobuf::UnknownFields, + cached_size: ::protobuf::CachedSize, +} + +impl WipeDevice { + pub fn new() -> WipeDevice { + ::std::default::Default::default() + } +} + +impl ::protobuf::Message for WipeDevice { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &::std::any::Any { + self as &::std::any::Any + } + fn as_any_mut(&mut self) -> &mut ::std::any::Any { + self as &mut ::std::any::Any + } + fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> WipeDevice { + WipeDevice::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let fields = ::std::vec::Vec::new(); + ::protobuf::reflect::MessageDescriptor::new::( + "WipeDevice", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static WipeDevice { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const WipeDevice, + }; + unsafe { + instance.get(WipeDevice::new) + } + } +} + +impl ::protobuf::Clear for WipeDevice { + fn clear(&mut self) { + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for WipeDevice { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for WipeDevice { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct LoadDevice { + // message fields + mnemonic: ::protobuf::SingularField<::std::string::String>, + node: ::protobuf::SingularPtrField, + pin: ::protobuf::SingularField<::std::string::String>, + passphrase_protection: ::std::option::Option, + language: ::protobuf::SingularField<::std::string::String>, + label: ::protobuf::SingularField<::std::string::String>, + skip_checksum: ::std::option::Option, + u2f_counter: ::std::option::Option, + // special fields + unknown_fields: ::protobuf::UnknownFields, + cached_size: ::protobuf::CachedSize, +} + +impl LoadDevice { + pub fn new() -> LoadDevice { + ::std::default::Default::default() + } + + // optional string mnemonic = 1; + + pub fn clear_mnemonic(&mut self) { + self.mnemonic.clear(); + } + + pub fn has_mnemonic(&self) -> bool { + self.mnemonic.is_some() + } + + // Param is passed by value, moved + pub fn set_mnemonic(&mut self, v: ::std::string::String) { + self.mnemonic = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_mnemonic(&mut self) -> &mut ::std::string::String { + if self.mnemonic.is_none() { + self.mnemonic.set_default(); + } + self.mnemonic.as_mut().unwrap() + } + + // Take field + pub fn take_mnemonic(&mut self) -> ::std::string::String { + self.mnemonic.take().unwrap_or_else(|| ::std::string::String::new()) + } + + pub fn get_mnemonic(&self) -> &str { + match self.mnemonic.as_ref() { + Some(v) => &v, + None => "", + } + } + + // optional .hw.trezor.messages.common.HDNodeType node = 2; + + pub fn clear_node(&mut self) { + self.node.clear(); + } + + pub fn has_node(&self) -> bool { + self.node.is_some() + } + + // Param is passed by value, moved + pub fn set_node(&mut self, v: super::messages_common::HDNodeType) { + self.node = ::protobuf::SingularPtrField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_node(&mut self) -> &mut super::messages_common::HDNodeType { + if self.node.is_none() { + self.node.set_default(); + } + self.node.as_mut().unwrap() + } + + // Take field + pub fn take_node(&mut self) -> super::messages_common::HDNodeType { + self.node.take().unwrap_or_else(|| super::messages_common::HDNodeType::new()) + } + + pub fn get_node(&self) -> &super::messages_common::HDNodeType { + self.node.as_ref().unwrap_or_else(|| super::messages_common::HDNodeType::default_instance()) + } + + // optional string pin = 3; + + pub fn clear_pin(&mut self) { + self.pin.clear(); + } + + pub fn has_pin(&self) -> bool { + self.pin.is_some() + } + + // Param is passed by value, moved + pub fn set_pin(&mut self, v: ::std::string::String) { + self.pin = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_pin(&mut self) -> &mut ::std::string::String { + if self.pin.is_none() { + self.pin.set_default(); + } + self.pin.as_mut().unwrap() + } + + // Take field + pub fn take_pin(&mut self) -> ::std::string::String { + self.pin.take().unwrap_or_else(|| ::std::string::String::new()) + } + + pub fn get_pin(&self) -> &str { + match self.pin.as_ref() { + Some(v) => &v, + None => "", + } + } + + // optional bool passphrase_protection = 4; + + pub fn clear_passphrase_protection(&mut self) { + self.passphrase_protection = ::std::option::Option::None; + } + + pub fn has_passphrase_protection(&self) -> bool { + self.passphrase_protection.is_some() + } + + // Param is passed by value, moved + pub fn set_passphrase_protection(&mut self, v: bool) { + self.passphrase_protection = ::std::option::Option::Some(v); + } + + pub fn get_passphrase_protection(&self) -> bool { + self.passphrase_protection.unwrap_or(false) + } + + // optional string language = 5; + + pub fn clear_language(&mut self) { + self.language.clear(); + } + + pub fn has_language(&self) -> bool { + self.language.is_some() + } + + // Param is passed by value, moved + pub fn set_language(&mut self, v: ::std::string::String) { + self.language = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_language(&mut self) -> &mut ::std::string::String { + if self.language.is_none() { + self.language.set_default(); + } + self.language.as_mut().unwrap() + } + + // Take field + pub fn take_language(&mut self) -> ::std::string::String { + self.language.take().unwrap_or_else(|| ::std::string::String::new()) + } + + pub fn get_language(&self) -> &str { + match self.language.as_ref() { + Some(v) => &v, + None => "english", + } + } + + // optional string label = 6; + + pub fn clear_label(&mut self) { + self.label.clear(); + } + + pub fn has_label(&self) -> bool { + self.label.is_some() + } + + // Param is passed by value, moved + pub fn set_label(&mut self, v: ::std::string::String) { + self.label = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_label(&mut self) -> &mut ::std::string::String { + if self.label.is_none() { + self.label.set_default(); + } + self.label.as_mut().unwrap() + } + + // Take field + pub fn take_label(&mut self) -> ::std::string::String { + self.label.take().unwrap_or_else(|| ::std::string::String::new()) + } + + pub fn get_label(&self) -> &str { + match self.label.as_ref() { + Some(v) => &v, + None => "", + } + } + + // optional bool skip_checksum = 7; + + pub fn clear_skip_checksum(&mut self) { + self.skip_checksum = ::std::option::Option::None; + } + + pub fn has_skip_checksum(&self) -> bool { + self.skip_checksum.is_some() + } + + // Param is passed by value, moved + pub fn set_skip_checksum(&mut self, v: bool) { + self.skip_checksum = ::std::option::Option::Some(v); + } + + pub fn get_skip_checksum(&self) -> bool { + self.skip_checksum.unwrap_or(false) + } + + // optional uint32 u2f_counter = 8; + + pub fn clear_u2f_counter(&mut self) { + self.u2f_counter = ::std::option::Option::None; + } + + pub fn has_u2f_counter(&self) -> bool { + self.u2f_counter.is_some() + } + + // Param is passed by value, moved + pub fn set_u2f_counter(&mut self, v: u32) { + self.u2f_counter = ::std::option::Option::Some(v); + } + + pub fn get_u2f_counter(&self) -> u32 { + self.u2f_counter.unwrap_or(0) + } +} + +impl ::protobuf::Message for LoadDevice { + fn is_initialized(&self) -> bool { + for v in &self.node { + if !v.is_initialized() { + return false; + } + }; + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.mnemonic)?; + }, + 2 => { + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.node)?; + }, + 3 => { + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.pin)?; + }, + 4 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_bool()?; + self.passphrase_protection = ::std::option::Option::Some(tmp); + }, + 5 => { + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.language)?; + }, + 6 => { + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.label)?; + }, + 7 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_bool()?; + self.skip_checksum = ::std::option::Option::Some(tmp); + }, + 8 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_uint32()?; + self.u2f_counter = ::std::option::Option::Some(tmp); + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if let Some(ref v) = self.mnemonic.as_ref() { + my_size += ::protobuf::rt::string_size(1, &v); + } + if let Some(ref v) = self.node.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + } + if let Some(ref v) = self.pin.as_ref() { + my_size += ::protobuf::rt::string_size(3, &v); + } + if let Some(v) = self.passphrase_protection { + my_size += 2; + } + if let Some(ref v) = self.language.as_ref() { + my_size += ::protobuf::rt::string_size(5, &v); + } + if let Some(ref v) = self.label.as_ref() { + my_size += ::protobuf::rt::string_size(6, &v); + } + if let Some(v) = self.skip_checksum { + my_size += 2; + } + if let Some(v) = self.u2f_counter { + my_size += ::protobuf::rt::value_size(8, v, ::protobuf::wire_format::WireTypeVarint); + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + if let Some(ref v) = self.mnemonic.as_ref() { + os.write_string(1, &v)?; + } + if let Some(ref v) = self.node.as_ref() { + os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + } + if let Some(ref v) = self.pin.as_ref() { + os.write_string(3, &v)?; + } + if let Some(v) = self.passphrase_protection { + os.write_bool(4, v)?; + } + if let Some(ref v) = self.language.as_ref() { + os.write_string(5, &v)?; + } + if let Some(ref v) = self.label.as_ref() { + os.write_string(6, &v)?; + } + if let Some(v) = self.skip_checksum { + os.write_bool(7, v)?; + } + if let Some(v) = self.u2f_counter { + os.write_uint32(8, v)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &::std::any::Any { + self as &::std::any::Any + } + fn as_any_mut(&mut self) -> &mut ::std::any::Any { + self as &mut ::std::any::Any + } + fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> LoadDevice { + LoadDevice::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "mnemonic", + |m: &LoadDevice| { &m.mnemonic }, + |m: &mut LoadDevice| { &mut m.mnemonic }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "node", + |m: &LoadDevice| { &m.node }, + |m: &mut LoadDevice| { &mut m.node }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "pin", + |m: &LoadDevice| { &m.pin }, + |m: &mut LoadDevice| { &mut m.pin }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "passphrase_protection", + |m: &LoadDevice| { &m.passphrase_protection }, + |m: &mut LoadDevice| { &mut m.passphrase_protection }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "language", + |m: &LoadDevice| { &m.language }, + |m: &mut LoadDevice| { &mut m.language }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "label", + |m: &LoadDevice| { &m.label }, + |m: &mut LoadDevice| { &mut m.label }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "skip_checksum", + |m: &LoadDevice| { &m.skip_checksum }, + |m: &mut LoadDevice| { &mut m.skip_checksum }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( + "u2f_counter", + |m: &LoadDevice| { &m.u2f_counter }, + |m: &mut LoadDevice| { &mut m.u2f_counter }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "LoadDevice", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static LoadDevice { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const LoadDevice, + }; + unsafe { + instance.get(LoadDevice::new) + } + } +} + +impl ::protobuf::Clear for LoadDevice { + fn clear(&mut self) { + self.clear_mnemonic(); + self.clear_node(); + self.clear_pin(); + self.clear_passphrase_protection(); + self.clear_language(); + self.clear_label(); + self.clear_skip_checksum(); + self.clear_u2f_counter(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for LoadDevice { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for LoadDevice { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct ResetDevice { + // message fields + display_random: ::std::option::Option, + strength: ::std::option::Option, + passphrase_protection: ::std::option::Option, + pin_protection: ::std::option::Option, + language: ::protobuf::SingularField<::std::string::String>, + label: ::protobuf::SingularField<::std::string::String>, + u2f_counter: ::std::option::Option, + skip_backup: ::std::option::Option, + no_backup: ::std::option::Option, + // special fields + unknown_fields: ::protobuf::UnknownFields, + cached_size: ::protobuf::CachedSize, +} + +impl ResetDevice { + pub fn new() -> ResetDevice { + ::std::default::Default::default() + } + + // optional bool display_random = 1; + + pub fn clear_display_random(&mut self) { + self.display_random = ::std::option::Option::None; + } + + pub fn has_display_random(&self) -> bool { + self.display_random.is_some() + } + + // Param is passed by value, moved + pub fn set_display_random(&mut self, v: bool) { + self.display_random = ::std::option::Option::Some(v); + } + + pub fn get_display_random(&self) -> bool { + self.display_random.unwrap_or(false) + } + + // optional uint32 strength = 2; + + pub fn clear_strength(&mut self) { + self.strength = ::std::option::Option::None; + } + + pub fn has_strength(&self) -> bool { + self.strength.is_some() + } + + // Param is passed by value, moved + pub fn set_strength(&mut self, v: u32) { + self.strength = ::std::option::Option::Some(v); + } + + pub fn get_strength(&self) -> u32 { + self.strength.unwrap_or(256u32) + } + + // optional bool passphrase_protection = 3; + + pub fn clear_passphrase_protection(&mut self) { + self.passphrase_protection = ::std::option::Option::None; + } + + pub fn has_passphrase_protection(&self) -> bool { + self.passphrase_protection.is_some() + } + + // Param is passed by value, moved + pub fn set_passphrase_protection(&mut self, v: bool) { + self.passphrase_protection = ::std::option::Option::Some(v); + } + + pub fn get_passphrase_protection(&self) -> bool { + self.passphrase_protection.unwrap_or(false) + } + + // optional bool pin_protection = 4; + + pub fn clear_pin_protection(&mut self) { + self.pin_protection = ::std::option::Option::None; + } + + pub fn has_pin_protection(&self) -> bool { + self.pin_protection.is_some() + } + + // Param is passed by value, moved + pub fn set_pin_protection(&mut self, v: bool) { + self.pin_protection = ::std::option::Option::Some(v); + } + + pub fn get_pin_protection(&self) -> bool { + self.pin_protection.unwrap_or(false) + } + + // optional string language = 5; + + pub fn clear_language(&mut self) { + self.language.clear(); + } + + pub fn has_language(&self) -> bool { + self.language.is_some() + } + + // Param is passed by value, moved + pub fn set_language(&mut self, v: ::std::string::String) { + self.language = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_language(&mut self) -> &mut ::std::string::String { + if self.language.is_none() { + self.language.set_default(); + } + self.language.as_mut().unwrap() + } + + // Take field + pub fn take_language(&mut self) -> ::std::string::String { + self.language.take().unwrap_or_else(|| ::std::string::String::new()) + } + + pub fn get_language(&self) -> &str { + match self.language.as_ref() { + Some(v) => &v, + None => "english", + } + } + + // optional string label = 6; + + pub fn clear_label(&mut self) { + self.label.clear(); + } + + pub fn has_label(&self) -> bool { + self.label.is_some() + } + + // Param is passed by value, moved + pub fn set_label(&mut self, v: ::std::string::String) { + self.label = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_label(&mut self) -> &mut ::std::string::String { + if self.label.is_none() { + self.label.set_default(); + } + self.label.as_mut().unwrap() + } + + // Take field + pub fn take_label(&mut self) -> ::std::string::String { + self.label.take().unwrap_or_else(|| ::std::string::String::new()) + } + + pub fn get_label(&self) -> &str { + match self.label.as_ref() { + Some(v) => &v, + None => "", + } + } + + // optional uint32 u2f_counter = 7; + + pub fn clear_u2f_counter(&mut self) { + self.u2f_counter = ::std::option::Option::None; + } + + pub fn has_u2f_counter(&self) -> bool { + self.u2f_counter.is_some() + } + + // Param is passed by value, moved + pub fn set_u2f_counter(&mut self, v: u32) { + self.u2f_counter = ::std::option::Option::Some(v); + } + + pub fn get_u2f_counter(&self) -> u32 { + self.u2f_counter.unwrap_or(0) + } + + // optional bool skip_backup = 8; + + pub fn clear_skip_backup(&mut self) { + self.skip_backup = ::std::option::Option::None; + } + + pub fn has_skip_backup(&self) -> bool { + self.skip_backup.is_some() + } + + // Param is passed by value, moved + pub fn set_skip_backup(&mut self, v: bool) { + self.skip_backup = ::std::option::Option::Some(v); + } + + pub fn get_skip_backup(&self) -> bool { + self.skip_backup.unwrap_or(false) + } + + // optional bool no_backup = 9; + + pub fn clear_no_backup(&mut self) { + self.no_backup = ::std::option::Option::None; + } + + pub fn has_no_backup(&self) -> bool { + self.no_backup.is_some() + } + + // Param is passed by value, moved + pub fn set_no_backup(&mut self, v: bool) { + self.no_backup = ::std::option::Option::Some(v); + } + + pub fn get_no_backup(&self) -> bool { + self.no_backup.unwrap_or(false) + } +} + +impl ::protobuf::Message for ResetDevice { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_bool()?; + self.display_random = ::std::option::Option::Some(tmp); + }, + 2 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_uint32()?; + self.strength = ::std::option::Option::Some(tmp); + }, + 3 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_bool()?; + self.passphrase_protection = ::std::option::Option::Some(tmp); + }, + 4 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_bool()?; + self.pin_protection = ::std::option::Option::Some(tmp); + }, + 5 => { + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.language)?; + }, + 6 => { + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.label)?; + }, + 7 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_uint32()?; + self.u2f_counter = ::std::option::Option::Some(tmp); + }, + 8 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_bool()?; + self.skip_backup = ::std::option::Option::Some(tmp); + }, + 9 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_bool()?; + self.no_backup = ::std::option::Option::Some(tmp); + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if let Some(v) = self.display_random { + my_size += 2; + } + if let Some(v) = self.strength { + my_size += ::protobuf::rt::value_size(2, v, ::protobuf::wire_format::WireTypeVarint); + } + if let Some(v) = self.passphrase_protection { + my_size += 2; + } + if let Some(v) = self.pin_protection { + my_size += 2; + } + if let Some(ref v) = self.language.as_ref() { + my_size += ::protobuf::rt::string_size(5, &v); + } + if let Some(ref v) = self.label.as_ref() { + my_size += ::protobuf::rt::string_size(6, &v); + } + if let Some(v) = self.u2f_counter { + my_size += ::protobuf::rt::value_size(7, v, ::protobuf::wire_format::WireTypeVarint); + } + if let Some(v) = self.skip_backup { + my_size += 2; + } + if let Some(v) = self.no_backup { + my_size += 2; + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + if let Some(v) = self.display_random { + os.write_bool(1, v)?; + } + if let Some(v) = self.strength { + os.write_uint32(2, v)?; + } + if let Some(v) = self.passphrase_protection { + os.write_bool(3, v)?; + } + if let Some(v) = self.pin_protection { + os.write_bool(4, v)?; + } + if let Some(ref v) = self.language.as_ref() { + os.write_string(5, &v)?; + } + if let Some(ref v) = self.label.as_ref() { + os.write_string(6, &v)?; + } + if let Some(v) = self.u2f_counter { + os.write_uint32(7, v)?; + } + if let Some(v) = self.skip_backup { + os.write_bool(8, v)?; + } + if let Some(v) = self.no_backup { + os.write_bool(9, v)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &::std::any::Any { + self as &::std::any::Any + } + fn as_any_mut(&mut self) -> &mut ::std::any::Any { + self as &mut ::std::any::Any + } + fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> ResetDevice { + ResetDevice::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "display_random", + |m: &ResetDevice| { &m.display_random }, + |m: &mut ResetDevice| { &mut m.display_random }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( + "strength", + |m: &ResetDevice| { &m.strength }, + |m: &mut ResetDevice| { &mut m.strength }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "passphrase_protection", + |m: &ResetDevice| { &m.passphrase_protection }, + |m: &mut ResetDevice| { &mut m.passphrase_protection }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "pin_protection", + |m: &ResetDevice| { &m.pin_protection }, + |m: &mut ResetDevice| { &mut m.pin_protection }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "language", + |m: &ResetDevice| { &m.language }, + |m: &mut ResetDevice| { &mut m.language }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "label", + |m: &ResetDevice| { &m.label }, + |m: &mut ResetDevice| { &mut m.label }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( + "u2f_counter", + |m: &ResetDevice| { &m.u2f_counter }, + |m: &mut ResetDevice| { &mut m.u2f_counter }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "skip_backup", + |m: &ResetDevice| { &m.skip_backup }, + |m: &mut ResetDevice| { &mut m.skip_backup }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "no_backup", + |m: &ResetDevice| { &m.no_backup }, + |m: &mut ResetDevice| { &mut m.no_backup }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "ResetDevice", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static ResetDevice { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ResetDevice, + }; + unsafe { + instance.get(ResetDevice::new) + } + } +} + +impl ::protobuf::Clear for ResetDevice { + fn clear(&mut self) { + self.clear_display_random(); + self.clear_strength(); + self.clear_passphrase_protection(); + self.clear_pin_protection(); + self.clear_language(); + self.clear_label(); + self.clear_u2f_counter(); + self.clear_skip_backup(); + self.clear_no_backup(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for ResetDevice { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for ResetDevice { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct BackupDevice { + // special fields + unknown_fields: ::protobuf::UnknownFields, + cached_size: ::protobuf::CachedSize, +} + +impl BackupDevice { + pub fn new() -> BackupDevice { + ::std::default::Default::default() + } +} + +impl ::protobuf::Message for BackupDevice { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &::std::any::Any { + self as &::std::any::Any + } + fn as_any_mut(&mut self) -> &mut ::std::any::Any { + self as &mut ::std::any::Any + } + fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> BackupDevice { + BackupDevice::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let fields = ::std::vec::Vec::new(); + ::protobuf::reflect::MessageDescriptor::new::( + "BackupDevice", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static BackupDevice { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const BackupDevice, + }; + unsafe { + instance.get(BackupDevice::new) + } + } +} + +impl ::protobuf::Clear for BackupDevice { + fn clear(&mut self) { + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for BackupDevice { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for BackupDevice { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct EntropyRequest { + // special fields + unknown_fields: ::protobuf::UnknownFields, + cached_size: ::protobuf::CachedSize, +} + +impl EntropyRequest { + pub fn new() -> EntropyRequest { + ::std::default::Default::default() + } +} + +impl ::protobuf::Message for EntropyRequest { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &::std::any::Any { + self as &::std::any::Any + } + fn as_any_mut(&mut self) -> &mut ::std::any::Any { + self as &mut ::std::any::Any + } + fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> EntropyRequest { + EntropyRequest::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let fields = ::std::vec::Vec::new(); + ::protobuf::reflect::MessageDescriptor::new::( + "EntropyRequest", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static EntropyRequest { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const EntropyRequest, + }; + unsafe { + instance.get(EntropyRequest::new) + } + } +} + +impl ::protobuf::Clear for EntropyRequest { + fn clear(&mut self) { + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for EntropyRequest { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for EntropyRequest { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct EntropyAck { + // message fields + entropy: ::protobuf::SingularField<::std::vec::Vec>, + // special fields + unknown_fields: ::protobuf::UnknownFields, + cached_size: ::protobuf::CachedSize, +} + +impl EntropyAck { + pub fn new() -> EntropyAck { + ::std::default::Default::default() + } + + // optional bytes entropy = 1; + + pub fn clear_entropy(&mut self) { + self.entropy.clear(); + } + + pub fn has_entropy(&self) -> bool { + self.entropy.is_some() + } + + // Param is passed by value, moved + pub fn set_entropy(&mut self, v: ::std::vec::Vec) { + self.entropy = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_entropy(&mut self) -> &mut ::std::vec::Vec { + if self.entropy.is_none() { + self.entropy.set_default(); + } + self.entropy.as_mut().unwrap() + } + + // Take field + pub fn take_entropy(&mut self) -> ::std::vec::Vec { + self.entropy.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + pub fn get_entropy(&self) -> &[u8] { + match self.entropy.as_ref() { + Some(v) => &v, + None => &[], + } + } +} + +impl ::protobuf::Message for EntropyAck { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.entropy)?; + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if let Some(ref v) = self.entropy.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &v); + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + if let Some(ref v) = self.entropy.as_ref() { + os.write_bytes(1, &v)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &::std::any::Any { + self as &::std::any::Any + } + fn as_any_mut(&mut self) -> &mut ::std::any::Any { + self as &mut ::std::any::Any + } + fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> EntropyAck { + EntropyAck::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "entropy", + |m: &EntropyAck| { &m.entropy }, + |m: &mut EntropyAck| { &mut m.entropy }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "EntropyAck", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static EntropyAck { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const EntropyAck, + }; + unsafe { + instance.get(EntropyAck::new) + } + } +} + +impl ::protobuf::Clear for EntropyAck { + fn clear(&mut self) { + self.clear_entropy(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for EntropyAck { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for EntropyAck { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct RecoveryDevice { + // message fields + word_count: ::std::option::Option, + passphrase_protection: ::std::option::Option, + pin_protection: ::std::option::Option, + language: ::protobuf::SingularField<::std::string::String>, + label: ::protobuf::SingularField<::std::string::String>, + enforce_wordlist: ::std::option::Option, + field_type: ::std::option::Option, + u2f_counter: ::std::option::Option, + dry_run: ::std::option::Option, + // special fields + unknown_fields: ::protobuf::UnknownFields, + cached_size: ::protobuf::CachedSize, +} + +impl RecoveryDevice { + pub fn new() -> RecoveryDevice { + ::std::default::Default::default() + } + + // optional uint32 word_count = 1; + + pub fn clear_word_count(&mut self) { + self.word_count = ::std::option::Option::None; + } + + pub fn has_word_count(&self) -> bool { + self.word_count.is_some() + } + + // Param is passed by value, moved + pub fn set_word_count(&mut self, v: u32) { + self.word_count = ::std::option::Option::Some(v); + } + + pub fn get_word_count(&self) -> u32 { + self.word_count.unwrap_or(0) + } + + // optional bool passphrase_protection = 2; + + pub fn clear_passphrase_protection(&mut self) { + self.passphrase_protection = ::std::option::Option::None; + } + + pub fn has_passphrase_protection(&self) -> bool { + self.passphrase_protection.is_some() + } + + // Param is passed by value, moved + pub fn set_passphrase_protection(&mut self, v: bool) { + self.passphrase_protection = ::std::option::Option::Some(v); + } + + pub fn get_passphrase_protection(&self) -> bool { + self.passphrase_protection.unwrap_or(false) + } + + // optional bool pin_protection = 3; + + pub fn clear_pin_protection(&mut self) { + self.pin_protection = ::std::option::Option::None; + } + + pub fn has_pin_protection(&self) -> bool { + self.pin_protection.is_some() + } + + // Param is passed by value, moved + pub fn set_pin_protection(&mut self, v: bool) { + self.pin_protection = ::std::option::Option::Some(v); + } + + pub fn get_pin_protection(&self) -> bool { + self.pin_protection.unwrap_or(false) + } + + // optional string language = 4; + + pub fn clear_language(&mut self) { + self.language.clear(); + } + + pub fn has_language(&self) -> bool { + self.language.is_some() + } + + // Param is passed by value, moved + pub fn set_language(&mut self, v: ::std::string::String) { + self.language = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_language(&mut self) -> &mut ::std::string::String { + if self.language.is_none() { + self.language.set_default(); + } + self.language.as_mut().unwrap() + } + + // Take field + pub fn take_language(&mut self) -> ::std::string::String { + self.language.take().unwrap_or_else(|| ::std::string::String::new()) + } + + pub fn get_language(&self) -> &str { + match self.language.as_ref() { + Some(v) => &v, + None => "english", + } + } + + // optional string label = 5; + + pub fn clear_label(&mut self) { + self.label.clear(); + } + + pub fn has_label(&self) -> bool { + self.label.is_some() + } + + // Param is passed by value, moved + pub fn set_label(&mut self, v: ::std::string::String) { + self.label = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_label(&mut self) -> &mut ::std::string::String { + if self.label.is_none() { + self.label.set_default(); + } + self.label.as_mut().unwrap() + } + + // Take field + pub fn take_label(&mut self) -> ::std::string::String { + self.label.take().unwrap_or_else(|| ::std::string::String::new()) + } + + pub fn get_label(&self) -> &str { + match self.label.as_ref() { + Some(v) => &v, + None => "", + } + } + + // optional bool enforce_wordlist = 6; + + pub fn clear_enforce_wordlist(&mut self) { + self.enforce_wordlist = ::std::option::Option::None; + } + + pub fn has_enforce_wordlist(&self) -> bool { + self.enforce_wordlist.is_some() + } + + // Param is passed by value, moved + pub fn set_enforce_wordlist(&mut self, v: bool) { + self.enforce_wordlist = ::std::option::Option::Some(v); + } + + pub fn get_enforce_wordlist(&self) -> bool { + self.enforce_wordlist.unwrap_or(false) + } + + // optional .hw.trezor.messages.management.RecoveryDevice.RecoveryDeviceType type = 8; + + pub fn clear_field_type(&mut self) { + self.field_type = ::std::option::Option::None; + } + + pub fn has_field_type(&self) -> bool { + self.field_type.is_some() + } + + // Param is passed by value, moved + pub fn set_field_type(&mut self, v: RecoveryDevice_RecoveryDeviceType) { + self.field_type = ::std::option::Option::Some(v); + } + + pub fn get_field_type(&self) -> RecoveryDevice_RecoveryDeviceType { + self.field_type.unwrap_or(RecoveryDevice_RecoveryDeviceType::RecoveryDeviceType_ScrambledWords) + } + + // optional uint32 u2f_counter = 9; + + pub fn clear_u2f_counter(&mut self) { + self.u2f_counter = ::std::option::Option::None; + } + + pub fn has_u2f_counter(&self) -> bool { + self.u2f_counter.is_some() + } + + // Param is passed by value, moved + pub fn set_u2f_counter(&mut self, v: u32) { + self.u2f_counter = ::std::option::Option::Some(v); + } + + pub fn get_u2f_counter(&self) -> u32 { + self.u2f_counter.unwrap_or(0) + } + + // optional bool dry_run = 10; + + pub fn clear_dry_run(&mut self) { + self.dry_run = ::std::option::Option::None; + } + + pub fn has_dry_run(&self) -> bool { + self.dry_run.is_some() + } + + // Param is passed by value, moved + pub fn set_dry_run(&mut self, v: bool) { + self.dry_run = ::std::option::Option::Some(v); + } + + pub fn get_dry_run(&self) -> bool { + self.dry_run.unwrap_or(false) + } +} + +impl ::protobuf::Message for RecoveryDevice { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_uint32()?; + self.word_count = ::std::option::Option::Some(tmp); + }, + 2 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_bool()?; + self.passphrase_protection = ::std::option::Option::Some(tmp); + }, + 3 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_bool()?; + self.pin_protection = ::std::option::Option::Some(tmp); + }, + 4 => { + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.language)?; + }, + 5 => { + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.label)?; + }, + 6 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_bool()?; + self.enforce_wordlist = ::std::option::Option::Some(tmp); + }, + 8 => { + ::protobuf::rt::read_proto2_enum_with_unknown_fields_into(wire_type, is, &mut self.field_type, 8, &mut self.unknown_fields)? + }, + 9 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_uint32()?; + self.u2f_counter = ::std::option::Option::Some(tmp); + }, + 10 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_bool()?; + self.dry_run = ::std::option::Option::Some(tmp); + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if let Some(v) = self.word_count { + my_size += ::protobuf::rt::value_size(1, v, ::protobuf::wire_format::WireTypeVarint); + } + if let Some(v) = self.passphrase_protection { + my_size += 2; + } + if let Some(v) = self.pin_protection { + my_size += 2; + } + if let Some(ref v) = self.language.as_ref() { + my_size += ::protobuf::rt::string_size(4, &v); + } + if let Some(ref v) = self.label.as_ref() { + my_size += ::protobuf::rt::string_size(5, &v); + } + if let Some(v) = self.enforce_wordlist { + my_size += 2; + } + if let Some(v) = self.field_type { + my_size += ::protobuf::rt::enum_size(8, v); + } + if let Some(v) = self.u2f_counter { + my_size += ::protobuf::rt::value_size(9, v, ::protobuf::wire_format::WireTypeVarint); + } + if let Some(v) = self.dry_run { + my_size += 2; + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + if let Some(v) = self.word_count { + os.write_uint32(1, v)?; + } + if let Some(v) = self.passphrase_protection { + os.write_bool(2, v)?; + } + if let Some(v) = self.pin_protection { + os.write_bool(3, v)?; + } + if let Some(ref v) = self.language.as_ref() { + os.write_string(4, &v)?; + } + if let Some(ref v) = self.label.as_ref() { + os.write_string(5, &v)?; + } + if let Some(v) = self.enforce_wordlist { + os.write_bool(6, v)?; + } + if let Some(v) = self.field_type { + os.write_enum(8, v.value())?; + } + if let Some(v) = self.u2f_counter { + os.write_uint32(9, v)?; + } + if let Some(v) = self.dry_run { + os.write_bool(10, v)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &::std::any::Any { + self as &::std::any::Any + } + fn as_any_mut(&mut self) -> &mut ::std::any::Any { + self as &mut ::std::any::Any + } + fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> RecoveryDevice { + RecoveryDevice::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( + "word_count", + |m: &RecoveryDevice| { &m.word_count }, + |m: &mut RecoveryDevice| { &mut m.word_count }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "passphrase_protection", + |m: &RecoveryDevice| { &m.passphrase_protection }, + |m: &mut RecoveryDevice| { &mut m.passphrase_protection }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "pin_protection", + |m: &RecoveryDevice| { &m.pin_protection }, + |m: &mut RecoveryDevice| { &mut m.pin_protection }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "language", + |m: &RecoveryDevice| { &m.language }, + |m: &mut RecoveryDevice| { &mut m.language }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "label", + |m: &RecoveryDevice| { &m.label }, + |m: &mut RecoveryDevice| { &mut m.label }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "enforce_wordlist", + |m: &RecoveryDevice| { &m.enforce_wordlist }, + |m: &mut RecoveryDevice| { &mut m.enforce_wordlist }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( + "type", + |m: &RecoveryDevice| { &m.field_type }, + |m: &mut RecoveryDevice| { &mut m.field_type }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( + "u2f_counter", + |m: &RecoveryDevice| { &m.u2f_counter }, + |m: &mut RecoveryDevice| { &mut m.u2f_counter }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "dry_run", + |m: &RecoveryDevice| { &m.dry_run }, + |m: &mut RecoveryDevice| { &mut m.dry_run }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "RecoveryDevice", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static RecoveryDevice { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const RecoveryDevice, + }; + unsafe { + instance.get(RecoveryDevice::new) + } + } +} + +impl ::protobuf::Clear for RecoveryDevice { + fn clear(&mut self) { + self.clear_word_count(); + self.clear_passphrase_protection(); + self.clear_pin_protection(); + self.clear_language(); + self.clear_label(); + self.clear_enforce_wordlist(); + self.clear_field_type(); + self.clear_u2f_counter(); + self.clear_dry_run(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for RecoveryDevice { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for RecoveryDevice { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(Clone,PartialEq,Eq,Debug,Hash)] +pub enum RecoveryDevice_RecoveryDeviceType { + RecoveryDeviceType_ScrambledWords = 0, + RecoveryDeviceType_Matrix = 1, +} + +impl ::protobuf::ProtobufEnum for RecoveryDevice_RecoveryDeviceType { + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 0 => ::std::option::Option::Some(RecoveryDevice_RecoveryDeviceType::RecoveryDeviceType_ScrambledWords), + 1 => ::std::option::Option::Some(RecoveryDevice_RecoveryDeviceType::RecoveryDeviceType_Matrix), + _ => ::std::option::Option::None + } + } + + fn values() -> &'static [Self] { + static values: &'static [RecoveryDevice_RecoveryDeviceType] = &[ + RecoveryDevice_RecoveryDeviceType::RecoveryDeviceType_ScrambledWords, + RecoveryDevice_RecoveryDeviceType::RecoveryDeviceType_Matrix, + ]; + values + } + + fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::EnumDescriptor, + }; + unsafe { + descriptor.get(|| { + ::protobuf::reflect::EnumDescriptor::new("RecoveryDevice_RecoveryDeviceType", file_descriptor_proto()) + }) + } + } +} + +impl ::std::marker::Copy for RecoveryDevice_RecoveryDeviceType { +} + +impl ::protobuf::reflect::ProtobufValue for RecoveryDevice_RecoveryDeviceType { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct WordRequest { + // message fields + field_type: ::std::option::Option, + // special fields + unknown_fields: ::protobuf::UnknownFields, + cached_size: ::protobuf::CachedSize, +} + +impl WordRequest { + pub fn new() -> WordRequest { + ::std::default::Default::default() + } + + // optional .hw.trezor.messages.management.WordRequest.WordRequestType type = 1; + + pub fn clear_field_type(&mut self) { + self.field_type = ::std::option::Option::None; + } + + pub fn has_field_type(&self) -> bool { + self.field_type.is_some() + } + + // Param is passed by value, moved + pub fn set_field_type(&mut self, v: WordRequest_WordRequestType) { + self.field_type = ::std::option::Option::Some(v); + } + + pub fn get_field_type(&self) -> WordRequest_WordRequestType { + self.field_type.unwrap_or(WordRequest_WordRequestType::WordRequestType_Plain) + } +} + +impl ::protobuf::Message for WordRequest { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_proto2_enum_with_unknown_fields_into(wire_type, is, &mut self.field_type, 1, &mut self.unknown_fields)? + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if let Some(v) = self.field_type { + my_size += ::protobuf::rt::enum_size(1, v); + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + if let Some(v) = self.field_type { + os.write_enum(1, v.value())?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &::std::any::Any { + self as &::std::any::Any + } + fn as_any_mut(&mut self) -> &mut ::std::any::Any { + self as &mut ::std::any::Any + } + fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> WordRequest { + WordRequest::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( + "type", + |m: &WordRequest| { &m.field_type }, + |m: &mut WordRequest| { &mut m.field_type }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "WordRequest", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static WordRequest { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const WordRequest, + }; + unsafe { + instance.get(WordRequest::new) + } + } +} + +impl ::protobuf::Clear for WordRequest { + fn clear(&mut self) { + self.clear_field_type(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for WordRequest { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for WordRequest { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(Clone,PartialEq,Eq,Debug,Hash)] +pub enum WordRequest_WordRequestType { + WordRequestType_Plain = 0, + WordRequestType_Matrix9 = 1, + WordRequestType_Matrix6 = 2, +} + +impl ::protobuf::ProtobufEnum for WordRequest_WordRequestType { + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 0 => ::std::option::Option::Some(WordRequest_WordRequestType::WordRequestType_Plain), + 1 => ::std::option::Option::Some(WordRequest_WordRequestType::WordRequestType_Matrix9), + 2 => ::std::option::Option::Some(WordRequest_WordRequestType::WordRequestType_Matrix6), + _ => ::std::option::Option::None + } + } + + fn values() -> &'static [Self] { + static values: &'static [WordRequest_WordRequestType] = &[ + WordRequest_WordRequestType::WordRequestType_Plain, + WordRequest_WordRequestType::WordRequestType_Matrix9, + WordRequest_WordRequestType::WordRequestType_Matrix6, + ]; + values + } + + fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::EnumDescriptor, + }; + unsafe { + descriptor.get(|| { + ::protobuf::reflect::EnumDescriptor::new("WordRequest_WordRequestType", file_descriptor_proto()) + }) + } + } +} + +impl ::std::marker::Copy for WordRequest_WordRequestType { +} + +impl ::protobuf::reflect::ProtobufValue for WordRequest_WordRequestType { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct WordAck { + // message fields + word: ::protobuf::SingularField<::std::string::String>, + // special fields + unknown_fields: ::protobuf::UnknownFields, + cached_size: ::protobuf::CachedSize, +} + +impl WordAck { + pub fn new() -> WordAck { + ::std::default::Default::default() + } + + // required string word = 1; + + pub fn clear_word(&mut self) { + self.word.clear(); + } + + pub fn has_word(&self) -> bool { + self.word.is_some() + } + + // Param is passed by value, moved + pub fn set_word(&mut self, v: ::std::string::String) { + self.word = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_word(&mut self) -> &mut ::std::string::String { + if self.word.is_none() { + self.word.set_default(); + } + self.word.as_mut().unwrap() + } + + // Take field + pub fn take_word(&mut self) -> ::std::string::String { + self.word.take().unwrap_or_else(|| ::std::string::String::new()) + } + + pub fn get_word(&self) -> &str { + match self.word.as_ref() { + Some(v) => &v, + None => "", + } + } +} + +impl ::protobuf::Message for WordAck { + fn is_initialized(&self) -> bool { + if self.word.is_none() { + return false; + } + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.word)?; + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if let Some(ref v) = self.word.as_ref() { + my_size += ::protobuf::rt::string_size(1, &v); + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + if let Some(ref v) = self.word.as_ref() { + os.write_string(1, &v)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &::std::any::Any { + self as &::std::any::Any + } + fn as_any_mut(&mut self) -> &mut ::std::any::Any { + self as &mut ::std::any::Any + } + fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> WordAck { + WordAck::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "word", + |m: &WordAck| { &m.word }, + |m: &mut WordAck| { &mut m.word }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "WordAck", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static WordAck { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const WordAck, + }; + unsafe { + instance.get(WordAck::new) + } + } +} + +impl ::protobuf::Clear for WordAck { + fn clear(&mut self) { + self.clear_word(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for WordAck { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for WordAck { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct SetU2FCounter { + // message fields + u2f_counter: ::std::option::Option, + // special fields + unknown_fields: ::protobuf::UnknownFields, + cached_size: ::protobuf::CachedSize, +} + +impl SetU2FCounter { + pub fn new() -> SetU2FCounter { + ::std::default::Default::default() + } + + // optional uint32 u2f_counter = 1; + + pub fn clear_u2f_counter(&mut self) { + self.u2f_counter = ::std::option::Option::None; + } + + pub fn has_u2f_counter(&self) -> bool { + self.u2f_counter.is_some() + } + + // Param is passed by value, moved + pub fn set_u2f_counter(&mut self, v: u32) { + self.u2f_counter = ::std::option::Option::Some(v); + } + + pub fn get_u2f_counter(&self) -> u32 { + self.u2f_counter.unwrap_or(0) + } +} + +impl ::protobuf::Message for SetU2FCounter { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_uint32()?; + self.u2f_counter = ::std::option::Option::Some(tmp); + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if let Some(v) = self.u2f_counter { + my_size += ::protobuf::rt::value_size(1, v, ::protobuf::wire_format::WireTypeVarint); + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + if let Some(v) = self.u2f_counter { + os.write_uint32(1, v)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &::std::any::Any { + self as &::std::any::Any + } + fn as_any_mut(&mut self) -> &mut ::std::any::Any { + self as &mut ::std::any::Any + } + fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> SetU2FCounter { + SetU2FCounter::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( + "u2f_counter", + |m: &SetU2FCounter| { &m.u2f_counter }, + |m: &mut SetU2FCounter| { &mut m.u2f_counter }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "SetU2FCounter", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static SetU2FCounter { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const SetU2FCounter, + }; + unsafe { + instance.get(SetU2FCounter::new) + } + } +} + +impl ::protobuf::Clear for SetU2FCounter { + fn clear(&mut self) { + self.clear_u2f_counter(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for SetU2FCounter { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for SetU2FCounter { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +static file_descriptor_proto_data: &'static [u8] = b"\ + \n\x19messages-management.proto\x12\x1dhw.trezor.messages.management\x1a\ + \x15messages-common.proto\"K\n\nInitialize\x12\x14\n\x05state\x18\x01\ + \x20\x01(\x0cR\x05state\x12'\n\x0fskip_passphrase\x18\x02\x20\x01(\x08R\ + \x0eskipPassphrase\"\r\n\x0bGetFeatures\"\x8c\x07\n\x08Features\x12\x16\ + \n\x06vendor\x18\x01\x20\x01(\tR\x06vendor\x12#\n\rmajor_version\x18\x02\ + \x20\x01(\rR\x0cmajorVersion\x12#\n\rminor_version\x18\x03\x20\x01(\rR\ + \x0cminorVersion\x12#\n\rpatch_version\x18\x04\x20\x01(\rR\x0cpatchVersi\ + on\x12'\n\x0fbootloader_mode\x18\x05\x20\x01(\x08R\x0ebootloaderMode\x12\ + \x1b\n\tdevice_id\x18\x06\x20\x01(\tR\x08deviceId\x12%\n\x0epin_protecti\ + on\x18\x07\x20\x01(\x08R\rpinProtection\x123\n\x15passphrase_protection\ + \x18\x08\x20\x01(\x08R\x14passphraseProtection\x12\x1a\n\x08language\x18\ + \t\x20\x01(\tR\x08language\x12\x14\n\x05label\x18\n\x20\x01(\tR\x05label\ + \x12\x20\n\x0binitialized\x18\x0c\x20\x01(\x08R\x0binitialized\x12\x1a\n\ + \x08revision\x18\r\x20\x01(\x0cR\x08revision\x12'\n\x0fbootloader_hash\ + \x18\x0e\x20\x01(\x0cR\x0ebootloaderHash\x12\x1a\n\x08imported\x18\x0f\ + \x20\x01(\x08R\x08imported\x12\x1d\n\npin_cached\x18\x10\x20\x01(\x08R\t\ + pinCached\x12+\n\x11passphrase_cached\x18\x11\x20\x01(\x08R\x10passphras\ + eCached\x12)\n\x10firmware_present\x18\x12\x20\x01(\x08R\x0ffirmwarePres\ + ent\x12!\n\x0cneeds_backup\x18\x13\x20\x01(\x08R\x0bneedsBackup\x12\x14\ + \n\x05flags\x18\x14\x20\x01(\rR\x05flags\x12\x14\n\x05model\x18\x15\x20\ + \x01(\tR\x05model\x12\x19\n\x08fw_major\x18\x16\x20\x01(\rR\x07fwMajor\ + \x12\x19\n\x08fw_minor\x18\x17\x20\x01(\rR\x07fwMinor\x12\x19\n\x08fw_pa\ + tch\x18\x18\x20\x01(\rR\x07fwPatch\x12\x1b\n\tfw_vendor\x18\x19\x20\x01(\ + \tR\x08fwVendor\x12$\n\x0efw_vendor_keys\x18\x1a\x20\x01(\x0cR\x0cfwVend\ + orKeys\x12+\n\x11unfinished_backup\x18\x1b\x20\x01(\x08R\x10unfinishedBa\ + ckup\x12\x1b\n\tno_backup\x18\x1c\x20\x01(\x08R\x08noBackup\"\x0e\n\x0cC\ + learSession\"\xdc\x02\n\rApplySettings\x12\x1a\n\x08language\x18\x01\x20\ + \x01(\tR\x08language\x12\x14\n\x05label\x18\x02\x20\x01(\tR\x05label\x12\ + %\n\x0euse_passphrase\x18\x03\x20\x01(\x08R\rusePassphrase\x12\x1e\n\nho\ + mescreen\x18\x04\x20\x01(\x0cR\nhomescreen\x12n\n\x11passphrase_source\ + \x18\x05\x20\x01(\x0e2A.hw.trezor.messages.management.ApplySettings.Pass\ + phraseSourceTypeR\x10passphraseSource\x12+\n\x12auto_lock_delay_ms\x18\ + \x06\x20\x01(\rR\x0fautoLockDelayMs\"5\n\x14PassphraseSourceType\x12\x07\ + \n\x03ASK\x10\0\x12\n\n\x06DEVICE\x10\x01\x12\x08\n\x04HOST\x10\x02\"\"\ + \n\nApplyFlags\x12\x14\n\x05flags\x18\x01\x20\x01(\rR\x05flags\"#\n\tCha\ + ngePin\x12\x16\n\x06remove\x18\x01\x20\x01(\x08R\x06remove\"\xa9\x01\n\ + \x04Ping\x12\x18\n\x07message\x18\x01\x20\x01(\tR\x07message\x12+\n\x11b\ + utton_protection\x18\x02\x20\x01(\x08R\x10buttonProtection\x12%\n\x0epin\ + _protection\x18\x03\x20\x01(\x08R\rpinProtection\x123\n\x15passphrase_pr\ + otection\x18\x04\x20\x01(\x08R\x14passphraseProtection\"\x08\n\x06Cancel\ + \"\x20\n\nGetEntropy\x12\x12\n\x04size\x18\x01\x20\x02(\rR\x04size\"#\n\ + \x07Entropy\x12\x18\n\x07entropy\x18\x01\x20\x02(\x0cR\x07entropy\"\x0c\ + \n\nWipeDevice\"\xab\x02\n\nLoadDevice\x12\x1a\n\x08mnemonic\x18\x01\x20\ + \x01(\tR\x08mnemonic\x129\n\x04node\x18\x02\x20\x01(\x0b2%.hw.trezor.mes\ + sages.common.HDNodeTypeR\x04node\x12\x10\n\x03pin\x18\x03\x20\x01(\tR\ + \x03pin\x123\n\x15passphrase_protection\x18\x04\x20\x01(\x08R\x14passphr\ + aseProtection\x12#\n\x08language\x18\x05\x20\x01(\t:\x07englishR\x08lang\ + uage\x12\x14\n\x05label\x18\x06\x20\x01(\tR\x05label\x12#\n\rskip_checks\ + um\x18\x07\x20\x01(\x08R\x0cskipChecksum\x12\x1f\n\x0bu2f_counter\x18\ + \x08\x20\x01(\rR\nu2fCounter\"\xcb\x02\n\x0bResetDevice\x12%\n\x0edispla\ + y_random\x18\x01\x20\x01(\x08R\rdisplayRandom\x12\x1f\n\x08strength\x18\ + \x02\x20\x01(\r:\x03256R\x08strength\x123\n\x15passphrase_protection\x18\ + \x03\x20\x01(\x08R\x14passphraseProtection\x12%\n\x0epin_protection\x18\ + \x04\x20\x01(\x08R\rpinProtection\x12#\n\x08language\x18\x05\x20\x01(\t:\ + \x07englishR\x08language\x12\x14\n\x05label\x18\x06\x20\x01(\tR\x05label\ + \x12\x1f\n\x0bu2f_counter\x18\x07\x20\x01(\rR\nu2fCounter\x12\x1f\n\x0bs\ + kip_backup\x18\x08\x20\x01(\x08R\nskipBackup\x12\x1b\n\tno_backup\x18\t\ + \x20\x01(\x08R\x08noBackup\"\x0e\n\x0cBackupDevice\"\x10\n\x0eEntropyReq\ + uest\"&\n\nEntropyAck\x12\x18\n\x07entropy\x18\x01\x20\x01(\x0cR\x07entr\ + opy\"\xdd\x03\n\x0eRecoveryDevice\x12\x1d\n\nword_count\x18\x01\x20\x01(\ + \rR\twordCount\x123\n\x15passphrase_protection\x18\x02\x20\x01(\x08R\x14\ + passphraseProtection\x12%\n\x0epin_protection\x18\x03\x20\x01(\x08R\rpin\ + Protection\x12#\n\x08language\x18\x04\x20\x01(\t:\x07englishR\x08languag\ + e\x12\x14\n\x05label\x18\x05\x20\x01(\tR\x05label\x12)\n\x10enforce_word\ + list\x18\x06\x20\x01(\x08R\x0fenforceWordlist\x12T\n\x04type\x18\x08\x20\ + \x01(\x0e2@.hw.trezor.messages.management.RecoveryDevice.RecoveryDeviceT\ + ypeR\x04type\x12\x1f\n\x0bu2f_counter\x18\t\x20\x01(\rR\nu2fCounter\x12\ + \x17\n\x07dry_run\x18\n\x20\x01(\x08R\x06dryRun\"Z\n\x12RecoveryDeviceTy\ + pe\x12%\n!RecoveryDeviceType_ScrambledWords\x10\0\x12\x1d\n\x19RecoveryD\ + eviceType_Matrix\x10\x01\"\xc5\x01\n\x0bWordRequest\x12N\n\x04type\x18\ + \x01\x20\x01(\x0e2:.hw.trezor.messages.management.WordRequest.WordReques\ + tTypeR\x04type\"f\n\x0fWordRequestType\x12\x19\n\x15WordRequestType_Plai\ + n\x10\0\x12\x1b\n\x17WordRequestType_Matrix9\x10\x01\x12\x1b\n\x17WordRe\ + questType_Matrix6\x10\x02\"\x1d\n\x07WordAck\x12\x12\n\x04word\x18\x01\ + \x20\x02(\tR\x04word\"0\n\rSetU2FCounter\x12\x1f\n\x0bu2f_counter\x18\ + \x01\x20\x01(\rR\nu2fCounterB>\n#com.satoshilabs.trezor.lib.protobufB\ + \x17TrezorMessageManagementJ\xc7Z\n\x07\x12\x05\0\0\x9b\x02\x01\n\x08\n\ + \x01\x0c\x12\x03\0\0\x12\n\x08\n\x01\x02\x12\x03\x01\x08%\n\x08\n\x01\ + \x08\x12\x03\x04\0<\n.\n\x02\x08\x01\x12\x03\x04\0<\x1a#\x20Sugar\x20for\ + \x20easier\x20handling\x20in\x20Java\n\n\x08\n\x01\x08\x12\x03\x05\08\n\ + \t\n\x02\x08\x08\x12\x03\x05\08\n\t\n\x02\x03\0\x12\x03\x07\x07\x1e\ni\n\ + \x02\x04\0\x12\x04\x0e\0\x11\x01\x1a]*\n\x20Request:\x20Reset\x20device\ + \x20to\x20default\x20state\x20and\x20ask\x20for\x20device\x20details\n\ + \x20@start\n\x20@next\x20Features\n\n\n\n\x03\x04\0\x01\x12\x03\x0e\x08\ + \x12\nG\n\x04\x04\0\x02\0\x12\x03\x0f\x04\x1d\":\x20assumed\x20device\ + \x20state,\x20clear\x20session\x20if\x20set\x20and\x20different\n\n\x0c\ + \n\x05\x04\0\x02\0\x04\x12\x03\x0f\x04\x0c\n\x0c\n\x05\x04\0\x02\0\x05\ + \x12\x03\x0f\r\x12\n\x0c\n\x05\x04\0\x02\0\x01\x12\x03\x0f\x13\x18\n\x0c\ + \n\x05\x04\0\x02\0\x03\x12\x03\x0f\x1b\x1c\nA\n\x04\x04\0\x02\x01\x12\ + \x03\x10\x04&\"4\x20this\x20session\x20should\x20always\x20assume\x20emp\ + ty\x20passphrase\n\n\x0c\n\x05\x04\0\x02\x01\x04\x12\x03\x10\x04\x0c\n\ + \x0c\n\x05\x04\0\x02\x01\x05\x12\x03\x10\r\x11\n\x0c\n\x05\x04\0\x02\x01\ + \x01\x12\x03\x10\x12!\n\x0c\n\x05\x04\0\x02\x01\x03\x12\x03\x10$%\nY\n\ + \x02\x04\x01\x12\x04\x18\0\x19\x01\x1aM*\n\x20Request:\x20Ask\x20for\x20\ + device\x20details\x20(no\x20device\x20reset)\n\x20@start\n\x20@next\x20F\ + eatures\n\n\n\n\x03\x04\x01\x01\x12\x03\x18\x08\x13\nL\n\x02\x04\x02\x12\ + \x04\x1f\0;\x01\x1a@*\n\x20Response:\x20Reports\x20various\x20informatio\ + n\x20about\x20the\x20device\n\x20@end\n\n\n\n\x03\x04\x02\x01\x12\x03\ + \x1f\x08\x10\n9\n\x04\x04\x02\x02\0\x12\x03\x20\x04\x1f\",\x20name\x20of\ + \x20the\x20manufacturer,\x20e.g.\x20\"trezor.io\"\n\n\x0c\n\x05\x04\x02\ + \x02\0\x04\x12\x03\x20\x04\x0c\n\x0c\n\x05\x04\x02\x02\0\x05\x12\x03\x20\ + \r\x13\n\x0c\n\x05\x04\x02\x02\0\x01\x12\x03\x20\x14\x1a\n\x0c\n\x05\x04\ + \x02\x02\0\x03\x12\x03\x20\x1d\x1e\n?\n\x04\x04\x02\x02\x01\x12\x03!\x04\ + &\"2\x20major\x20version\x20of\x20the\x20firmware/bootloader,\x20e.g.\ + \x201\n\n\x0c\n\x05\x04\x02\x02\x01\x04\x12\x03!\x04\x0c\n\x0c\n\x05\x04\ + \x02\x02\x01\x05\x12\x03!\r\x13\n\x0c\n\x05\x04\x02\x02\x01\x01\x12\x03!\ + \x14!\n\x0c\n\x05\x04\x02\x02\x01\x03\x12\x03!$%\n?\n\x04\x04\x02\x02\ + \x02\x12\x03\"\x04&\"2\x20minor\x20version\x20of\x20the\x20firmware/boot\ + loader,\x20e.g.\x200\n\n\x0c\n\x05\x04\x02\x02\x02\x04\x12\x03\"\x04\x0c\ + \n\x0c\n\x05\x04\x02\x02\x02\x05\x12\x03\"\r\x13\n\x0c\n\x05\x04\x02\x02\ + \x02\x01\x12\x03\"\x14!\n\x0c\n\x05\x04\x02\x02\x02\x03\x12\x03\"$%\n?\n\ + \x04\x04\x02\x02\x03\x12\x03#\x04&\"2\x20patch\x20version\x20of\x20the\ + \x20firmware/bootloader,\x20e.g.\x200\n\n\x0c\n\x05\x04\x02\x02\x03\x04\ + \x12\x03#\x04\x0c\n\x0c\n\x05\x04\x02\x02\x03\x05\x12\x03#\r\x13\n\x0c\n\ + \x05\x04\x02\x02\x03\x01\x12\x03#\x14!\n\x0c\n\x05\x04\x02\x02\x03\x03\ + \x12\x03#$%\n,\n\x04\x04\x02\x02\x04\x12\x03$\x04&\"\x1f\x20is\x20device\ + \x20in\x20bootloader\x20mode?\n\n\x0c\n\x05\x04\x02\x02\x04\x04\x12\x03$\ + \x04\x0c\n\x0c\n\x05\x04\x02\x02\x04\x05\x12\x03$\r\x11\n\x0c\n\x05\x04\ + \x02\x02\x04\x01\x12\x03$\x12!\n\x0c\n\x05\x04\x02\x02\x04\x03\x12\x03$$\ + %\n)\n\x04\x04\x02\x02\x05\x12\x03%\x04\"\"\x1c\x20device's\x20unique\ + \x20identifier\n\n\x0c\n\x05\x04\x02\x02\x05\x04\x12\x03%\x04\x0c\n\x0c\ + \n\x05\x04\x02\x02\x05\x05\x12\x03%\r\x13\n\x0c\n\x05\x04\x02\x02\x05\ + \x01\x12\x03%\x14\x1d\n\x0c\n\x05\x04\x02\x02\x05\x03\x12\x03%\x20!\n*\n\ + \x04\x04\x02\x02\x06\x12\x03&\x04%\"\x1d\x20is\x20device\x20protected\ + \x20by\x20PIN?\n\n\x0c\n\x05\x04\x02\x02\x06\x04\x12\x03&\x04\x0c\n\x0c\ + \n\x05\x04\x02\x02\x06\x05\x12\x03&\r\x11\n\x0c\n\x05\x04\x02\x02\x06\ + \x01\x12\x03&\x12\x20\n\x0c\n\x05\x04\x02\x02\x06\x03\x12\x03&#$\n;\n\ + \x04\x04\x02\x02\x07\x12\x03'\x04,\".\x20is\x20node/mnemonic\x20encrypte\ + d\x20using\x20passphrase?\n\n\x0c\n\x05\x04\x02\x02\x07\x04\x12\x03'\x04\ + \x0c\n\x0c\n\x05\x04\x02\x02\x07\x05\x12\x03'\r\x11\n\x0c\n\x05\x04\x02\ + \x02\x07\x01\x12\x03'\x12'\n\x0c\n\x05\x04\x02\x02\x07\x03\x12\x03'*+\n\ + \x1e\n\x04\x04\x02\x02\x08\x12\x03(\x04!\"\x11\x20device\x20language\n\n\ + \x0c\n\x05\x04\x02\x02\x08\x04\x12\x03(\x04\x0c\n\x0c\n\x05\x04\x02\x02\ + \x08\x05\x12\x03(\r\x13\n\x0c\n\x05\x04\x02\x02\x08\x01\x12\x03(\x14\x1c\ + \n\x0c\n\x05\x04\x02\x02\x08\x03\x12\x03(\x1f\x20\n'\n\x04\x04\x02\x02\t\ + \x12\x03)\x04\x1f\"\x1a\x20device\x20description\x20label\n\n\x0c\n\x05\ + \x04\x02\x02\t\x04\x12\x03)\x04\x0c\n\x0c\n\x05\x04\x02\x02\t\x05\x12\ + \x03)\r\x13\n\x0c\n\x05\x04\x02\x02\t\x01\x12\x03)\x14\x19\n\x0c\n\x05\ + \x04\x02\x02\t\x03\x12\x03)\x1c\x1e\n(\n\x04\x04\x02\x02\n\x12\x03*\x04#\ + \"\x1b\x20does\x20device\x20contain\x20seed?\n\n\x0c\n\x05\x04\x02\x02\n\ + \x04\x12\x03*\x04\x0c\n\x0c\n\x05\x04\x02\x02\n\x05\x12\x03*\r\x11\n\x0c\ + \n\x05\x04\x02\x02\n\x01\x12\x03*\x12\x1d\n\x0c\n\x05\x04\x02\x02\n\x03\ + \x12\x03*\x20\"\n'\n\x04\x04\x02\x02\x0b\x12\x03+\x04!\"\x1a\x20SCM\x20r\ + evision\x20of\x20firmware\n\n\x0c\n\x05\x04\x02\x02\x0b\x04\x12\x03+\x04\ + \x0c\n\x0c\n\x05\x04\x02\x02\x0b\x05\x12\x03+\r\x12\n\x0c\n\x05\x04\x02\ + \x02\x0b\x01\x12\x03+\x13\x1b\n\x0c\n\x05\x04\x02\x02\x0b\x03\x12\x03+\ + \x1e\x20\n%\n\x04\x04\x02\x02\x0c\x12\x03,\x04(\"\x18\x20hash\x20of\x20t\ + he\x20bootloader\n\n\x0c\n\x05\x04\x02\x02\x0c\x04\x12\x03,\x04\x0c\n\ + \x0c\n\x05\x04\x02\x02\x0c\x05\x12\x03,\r\x12\n\x0c\n\x05\x04\x02\x02\ + \x0c\x01\x12\x03,\x13\"\n\x0c\n\x05\x04\x02\x02\x0c\x03\x12\x03,%'\n<\n\ + \x04\x04\x02\x02\r\x12\x03-\x04\x20\"/\x20was\x20storage\x20imported\x20\ + from\x20an\x20external\x20source?\n\n\x0c\n\x05\x04\x02\x02\r\x04\x12\ + \x03-\x04\x0c\n\x0c\n\x05\x04\x02\x02\r\x05\x12\x03-\r\x11\n\x0c\n\x05\ + \x04\x02\x02\r\x01\x12\x03-\x12\x1a\n\x0c\n\x05\x04\x02\x02\r\x03\x12\ + \x03-\x1d\x1f\n0\n\x04\x04\x02\x02\x0e\x12\x03.\x04\"\"#\x20is\x20PIN\ + \x20already\x20cached\x20in\x20session?\n\n\x0c\n\x05\x04\x02\x02\x0e\ + \x04\x12\x03.\x04\x0c\n\x0c\n\x05\x04\x02\x02\x0e\x05\x12\x03.\r\x11\n\ + \x0c\n\x05\x04\x02\x02\x0e\x01\x12\x03.\x12\x1c\n\x0c\n\x05\x04\x02\x02\ + \x0e\x03\x12\x03.\x1f!\n7\n\x04\x04\x02\x02\x0f\x12\x03/\x04)\"*\x20is\ + \x20passphrase\x20already\x20cached\x20in\x20session?\n\n\x0c\n\x05\x04\ + \x02\x02\x0f\x04\x12\x03/\x04\x0c\n\x0c\n\x05\x04\x02\x02\x0f\x05\x12\ + \x03/\r\x11\n\x0c\n\x05\x04\x02\x02\x0f\x01\x12\x03/\x12#\n\x0c\n\x05\ + \x04\x02\x02\x0f\x03\x12\x03/&(\n(\n\x04\x04\x02\x02\x10\x12\x030\x04(\"\ + \x1b\x20is\x20valid\x20firmware\x20loaded?\n\n\x0c\n\x05\x04\x02\x02\x10\ + \x04\x12\x030\x04\x0c\n\x0c\n\x05\x04\x02\x02\x10\x05\x12\x030\r\x11\n\ + \x0c\n\x05\x04\x02\x02\x10\x01\x12\x030\x12\"\n\x0c\n\x05\x04\x02\x02\ + \x10\x03\x12\x030%'\nI\n\x04\x04\x02\x02\x11\x12\x031\x04$\"<\x20does\ + \x20storage\x20need\x20backup?\x20(equals\x20to\x20Storage.needs_backup)\ + \n\n\x0c\n\x05\x04\x02\x02\x11\x04\x12\x031\x04\x0c\n\x0c\n\x05\x04\x02\ + \x02\x11\x05\x12\x031\r\x11\n\x0c\n\x05\x04\x02\x02\x11\x01\x12\x031\x12\ + \x1e\n\x0c\n\x05\x04\x02\x02\x11\x03\x12\x031!#\n5\n\x04\x04\x02\x02\x12\ + \x12\x032\x04\x1f\"(\x20device\x20flags\x20(equals\x20to\x20Storage.flag\ + s)\n\n\x0c\n\x05\x04\x02\x02\x12\x04\x12\x032\x04\x0c\n\x0c\n\x05\x04\ + \x02\x02\x12\x05\x12\x032\r\x13\n\x0c\n\x05\x04\x02\x02\x12\x01\x12\x032\ + \x14\x19\n\x0c\n\x05\x04\x02\x02\x12\x03\x12\x032\x1c\x1e\n$\n\x04\x04\ + \x02\x02\x13\x12\x033\x04\x1f\"\x17\x20device\x20hardware\x20model\n\n\ + \x0c\n\x05\x04\x02\x02\x13\x04\x12\x033\x04\x0c\n\x0c\n\x05\x04\x02\x02\ + \x13\x05\x12\x033\r\x13\n\x0c\n\x05\x04\x02\x02\x13\x01\x12\x033\x14\x19\ + \n\x0c\n\x05\x04\x02\x02\x13\x03\x12\x033\x1c\x1e\n>\n\x04\x04\x02\x02\ + \x14\x12\x034\x04\"\"1\x20reported\x20firmware\x20version\x20if\x20in\ + \x20bootloader\x20mode\n\n\x0c\n\x05\x04\x02\x02\x14\x04\x12\x034\x04\ + \x0c\n\x0c\n\x05\x04\x02\x02\x14\x05\x12\x034\r\x13\n\x0c\n\x05\x04\x02\ + \x02\x14\x01\x12\x034\x14\x1c\n\x0c\n\x05\x04\x02\x02\x14\x03\x12\x034\ + \x1f!\n>\n\x04\x04\x02\x02\x15\x12\x035\x04\"\"1\x20reported\x20firmware\ + \x20version\x20if\x20in\x20bootloader\x20mode\n\n\x0c\n\x05\x04\x02\x02\ + \x15\x04\x12\x035\x04\x0c\n\x0c\n\x05\x04\x02\x02\x15\x05\x12\x035\r\x13\ + \n\x0c\n\x05\x04\x02\x02\x15\x01\x12\x035\x14\x1c\n\x0c\n\x05\x04\x02\ + \x02\x15\x03\x12\x035\x1f!\n>\n\x04\x04\x02\x02\x16\x12\x036\x04\"\"1\ + \x20reported\x20firmware\x20version\x20if\x20in\x20bootloader\x20mode\n\ + \n\x0c\n\x05\x04\x02\x02\x16\x04\x12\x036\x04\x0c\n\x0c\n\x05\x04\x02\ + \x02\x16\x05\x12\x036\r\x13\n\x0c\n\x05\x04\x02\x02\x16\x01\x12\x036\x14\ + \x1c\n\x0c\n\x05\x04\x02\x02\x16\x03\x12\x036\x1f!\n=\n\x04\x04\x02\x02\ + \x17\x12\x037\x04#\"0\x20reported\x20firmware\x20vendor\x20if\x20in\x20b\ + ootloader\x20mode\n\n\x0c\n\x05\x04\x02\x02\x17\x04\x12\x037\x04\x0c\n\ + \x0c\n\x05\x04\x02\x02\x17\x05\x12\x037\r\x13\n\x0c\n\x05\x04\x02\x02\ + \x17\x01\x12\x037\x14\x1d\n\x0c\n\x05\x04\x02\x02\x17\x03\x12\x037\x20\"\ + \n9\n\x04\x04\x02\x02\x18\x12\x038\x04'\",\x20reported\x20firmware\x20ve\ + ndor\x20keys\x20(their\x20hash)\n\n\x0c\n\x05\x04\x02\x02\x18\x04\x12\ + \x038\x04\x0c\n\x0c\n\x05\x04\x02\x02\x18\x05\x12\x038\r\x12\n\x0c\n\x05\ + \x04\x02\x02\x18\x01\x12\x038\x13!\n\x0c\n\x05\x04\x02\x02\x18\x03\x12\ + \x038$&\nM\n\x04\x04\x02\x02\x19\x12\x039\x04)\"@\x20report\x20unfinishe\ + d\x20backup\x20(equals\x20to\x20Storage.unfinished_backup)\n\n\x0c\n\x05\ + \x04\x02\x02\x19\x04\x12\x039\x04\x0c\n\x0c\n\x05\x04\x02\x02\x19\x05\ + \x12\x039\r\x11\n\x0c\n\x05\x04\x02\x02\x19\x01\x12\x039\x12#\n\x0c\n\ + \x05\x04\x02\x02\x19\x03\x12\x039&(\n=\n\x04\x04\x02\x02\x1a\x12\x03:\ + \x04!\"0\x20report\x20no\x20backup\x20(equals\x20to\x20Storage.no_backup\ + )\n\n\x0c\n\x05\x04\x02\x02\x1a\x04\x12\x03:\x04\x0c\n\x0c\n\x05\x04\x02\ + \x02\x1a\x05\x12\x03:\r\x11\n\x0c\n\x05\x04\x02\x02\x1a\x01\x12\x03:\x12\ + \x1b\n\x0c\n\x05\x04\x02\x02\x1a\x03\x12\x03:\x1e\x20\nd\n\x02\x04\x03\ + \x12\x04B\0C\x01\x1aX*\n\x20Request:\x20clear\x20session\x20(removes\x20\ + cached\x20PIN,\x20passphrase,\x20etc).\n\x20@start\n\x20@next\x20Success\ + \n\n\n\n\x03\x04\x03\x01\x12\x03B\x08\x14\ni\n\x02\x04\x04\x12\x04K\0Z\ + \x01\x1a]*\n\x20Request:\x20change\x20language\x20and/or\x20label\x20of\ + \x20the\x20device\n\x20@start\n\x20@next\x20Success\n\x20@next\x20Failur\ + e\n\n\n\n\x03\x04\x04\x01\x12\x03K\x08\x15\n\x0b\n\x04\x04\x04\x02\0\x12\ + \x03L\x04!\n\x0c\n\x05\x04\x04\x02\0\x04\x12\x03L\x04\x0c\n\x0c\n\x05\ + \x04\x04\x02\0\x05\x12\x03L\r\x13\n\x0c\n\x05\x04\x04\x02\0\x01\x12\x03L\ + \x14\x1c\n\x0c\n\x05\x04\x04\x02\0\x03\x12\x03L\x1f\x20\n\x0b\n\x04\x04\ + \x04\x02\x01\x12\x03M\x04\x1e\n\x0c\n\x05\x04\x04\x02\x01\x04\x12\x03M\ + \x04\x0c\n\x0c\n\x05\x04\x04\x02\x01\x05\x12\x03M\r\x13\n\x0c\n\x05\x04\ + \x04\x02\x01\x01\x12\x03M\x14\x19\n\x0c\n\x05\x04\x04\x02\x01\x03\x12\ + \x03M\x1c\x1d\n\x0b\n\x04\x04\x04\x02\x02\x12\x03N\x04%\n\x0c\n\x05\x04\ + \x04\x02\x02\x04\x12\x03N\x04\x0c\n\x0c\n\x05\x04\x04\x02\x02\x05\x12\ + \x03N\r\x11\n\x0c\n\x05\x04\x04\x02\x02\x01\x12\x03N\x12\x20\n\x0c\n\x05\ + \x04\x04\x02\x02\x03\x12\x03N#$\n\x0b\n\x04\x04\x04\x02\x03\x12\x03O\x04\ + \"\n\x0c\n\x05\x04\x04\x02\x03\x04\x12\x03O\x04\x0c\n\x0c\n\x05\x04\x04\ + \x02\x03\x05\x12\x03O\r\x12\n\x0c\n\x05\x04\x04\x02\x03\x01\x12\x03O\x13\ + \x1d\n\x0c\n\x05\x04\x04\x02\x03\x03\x12\x03O\x20!\n\x0b\n\x04\x04\x04\ + \x02\x04\x12\x03P\x048\n\x0c\n\x05\x04\x04\x02\x04\x04\x12\x03P\x04\x0c\ + \n\x0c\n\x05\x04\x04\x02\x04\x06\x12\x03P\r!\n\x0c\n\x05\x04\x04\x02\x04\ + \x01\x12\x03P\"3\n\x0c\n\x05\x04\x04\x02\x04\x03\x12\x03P67\n\x0b\n\x04\ + \x04\x04\x02\x05\x12\x03Q\x04+\n\x0c\n\x05\x04\x04\x02\x05\x04\x12\x03Q\ + \x04\x0c\n\x0c\n\x05\x04\x04\x02\x05\x05\x12\x03Q\r\x13\n\x0c\n\x05\x04\ + \x04\x02\x05\x01\x12\x03Q\x14&\n\x0c\n\x05\x04\x04\x02\x05\x03\x12\x03Q)\ + *\n:\n\x04\x04\x04\x04\0\x12\x04U\x04Y\x05\x1a,*\n\x20Structure\x20repre\ + senting\x20passphrase\x20source\n\n\x0c\n\x05\x04\x04\x04\0\x01\x12\x03U\ + \t\x1d\n\r\n\x06\x04\x04\x04\0\x02\0\x12\x03V\x08\x10\n\x0e\n\x07\x04\ + \x04\x04\0\x02\0\x01\x12\x03V\x08\x0b\n\x0e\n\x07\x04\x04\x04\0\x02\0\ + \x02\x12\x03V\x0e\x0f\n\r\n\x06\x04\x04\x04\0\x02\x01\x12\x03W\x08\x13\n\ + \x0e\n\x07\x04\x04\x04\0\x02\x01\x01\x12\x03W\x08\x0e\n\x0e\n\x07\x04\ + \x04\x04\0\x02\x01\x02\x12\x03W\x11\x12\n\r\n\x06\x04\x04\x04\0\x02\x02\ + \x12\x03X\x08\x11\n\x0e\n\x07\x04\x04\x04\0\x02\x02\x01\x12\x03X\x08\x0c\ + \n\x0e\n\x07\x04\x04\x04\0\x02\x02\x02\x12\x03X\x0f\x10\nV\n\x02\x04\x05\ + \x12\x04b\0d\x01\x1aJ*\n\x20Request:\x20set\x20flags\x20of\x20the\x20dev\ + ice\n\x20@start\n\x20@next\x20Success\n\x20@next\x20Failure\n\n\n\n\x03\ + \x04\x05\x01\x12\x03b\x08\x12\n4\n\x04\x04\x05\x02\0\x12\x03c\x04\x1e\"'\ + \x20bitmask,\x20can\x20only\x20set\x20bits,\x20not\x20unset\n\n\x0c\n\ + \x05\x04\x05\x02\0\x04\x12\x03c\x04\x0c\n\x0c\n\x05\x04\x05\x02\0\x05\ + \x12\x03c\r\x13\n\x0c\n\x05\x04\x05\x02\0\x01\x12\x03c\x14\x19\n\x0c\n\ + \x05\x04\x05\x02\0\x03\x12\x03c\x1c\x1d\nt\n\x02\x04\x06\x12\x04l\0n\x01\ + \x1ah*\n\x20Request:\x20Starts\x20workflow\x20for\x20setting/changing/re\ + moving\x20the\x20PIN\n\x20@start\n\x20@next\x20Success\n\x20@next\x20Fai\ + lure\n\n\n\n\x03\x04\x06\x01\x12\x03l\x08\x11\n(\n\x04\x04\x06\x02\0\x12\ + \x03m\x04\x1d\"\x1b\x20is\x20PIN\x20removal\x20requested?\n\n\x0c\n\x05\ + \x04\x06\x02\0\x04\x12\x03m\x04\x0c\n\x0c\n\x05\x04\x06\x02\0\x05\x12\ + \x03m\r\x11\n\x0c\n\x05\x04\x06\x02\0\x01\x12\x03m\x12\x18\n\x0c\n\x05\ + \x04\x06\x02\0\x03\x12\x03m\x1b\x1c\n~\n\x02\x04\x07\x12\x04u\0z\x01\x1a\ + r*\n\x20Request:\x20Test\x20if\x20the\x20device\x20is\x20alive,\x20devic\ + e\x20sends\x20back\x20the\x20message\x20in\x20Success\x20response\n\x20@\ + start\n\x20@next\x20Success\n\n\n\n\x03\x04\x07\x01\x12\x03u\x08\x0c\n6\ + \n\x04\x04\x07\x02\0\x12\x03v\x04\x20\")\x20message\x20to\x20send\x20bac\ + k\x20in\x20Success\x20message\n\n\x0c\n\x05\x04\x07\x02\0\x04\x12\x03v\ + \x04\x0c\n\x0c\n\x05\x04\x07\x02\0\x05\x12\x03v\r\x13\n\x0c\n\x05\x04\ + \x07\x02\0\x01\x12\x03v\x14\x1b\n\x0c\n\x05\x04\x07\x02\0\x03\x12\x03v\ + \x1e\x1f\n#\n\x04\x04\x07\x02\x01\x12\x03w\x04(\"\x16\x20ask\x20for\x20b\ + utton\x20press\n\n\x0c\n\x05\x04\x07\x02\x01\x04\x12\x03w\x04\x0c\n\x0c\ + \n\x05\x04\x07\x02\x01\x05\x12\x03w\r\x11\n\x0c\n\x05\x04\x07\x02\x01\ + \x01\x12\x03w\x12#\n\x0c\n\x05\x04\x07\x02\x01\x03\x12\x03w&'\n+\n\x04\ + \x04\x07\x02\x02\x12\x03x\x04%\"\x1e\x20ask\x20for\x20PIN\x20if\x20set\ + \x20in\x20device\n\n\x0c\n\x05\x04\x07\x02\x02\x04\x12\x03x\x04\x0c\n\ + \x0c\n\x05\x04\x07\x02\x02\x05\x12\x03x\r\x11\n\x0c\n\x05\x04\x07\x02\ + \x02\x01\x12\x03x\x12\x20\n\x0c\n\x05\x04\x07\x02\x02\x03\x12\x03x#$\n2\ + \n\x04\x04\x07\x02\x03\x12\x03y\x04,\"%\x20ask\x20for\x20passphrase\x20i\ + f\x20set\x20in\x20device\n\n\x0c\n\x05\x04\x07\x02\x03\x04\x12\x03y\x04\ + \x0c\n\x0c\n\x05\x04\x07\x02\x03\x05\x12\x03y\r\x11\n\x0c\n\x05\x04\x07\ + \x02\x03\x01\x12\x03y\x12'\n\x0c\n\x05\x04\x07\x02\x03\x03\x12\x03y*+\ne\ + \n\x02\x04\x08\x12\x06\x81\x01\0\x82\x01\x01\x1aW*\n\x20Request:\x20Abor\ + t\x20last\x20operation\x20that\x20required\x20user\x20interaction\n\x20@\ + start\n\x20@next\x20Failure\n\n\x0b\n\x03\x04\x08\x01\x12\x04\x81\x01\ + \x08\x0e\n\x95\x01\n\x02\x04\t\x12\x06\x8a\x01\0\x8c\x01\x01\x1a\x86\x01\ + *\n\x20Request:\x20Request\x20a\x20sample\x20of\x20random\x20data\x20gen\ + erated\x20by\x20hardware\x20RNG.\x20May\x20be\x20used\x20for\x20testing.\ + \n\x20@start\n\x20@next\x20Entropy\n\x20@next\x20Failure\n\n\x0b\n\x03\ + \x04\t\x01\x12\x04\x8a\x01\x08\x12\n)\n\x04\x04\t\x02\0\x12\x04\x8b\x01\ + \x04\x1d\"\x1b\x20size\x20of\x20requested\x20entropy\n\n\r\n\x05\x04\t\ + \x02\0\x04\x12\x04\x8b\x01\x04\x0c\n\r\n\x05\x04\t\x02\0\x05\x12\x04\x8b\ + \x01\r\x13\n\r\n\x05\x04\t\x02\0\x01\x12\x04\x8b\x01\x14\x18\n\r\n\x05\ + \x04\t\x02\0\x03\x12\x04\x8b\x01\x1b\x1c\nR\n\x02\x04\n\x12\x06\x92\x01\ + \0\x94\x01\x01\x1aD*\n\x20Response:\x20Reply\x20with\x20random\x20data\ + \x20generated\x20by\x20internal\x20RNG\n\x20@end\n\n\x0b\n\x03\x04\n\x01\ + \x12\x04\x92\x01\x08\x0f\n/\n\x04\x04\n\x02\0\x12\x04\x93\x01\x04\x1f\"!\ + \x20chunk\x20of\x20random\x20generated\x20bytes\n\n\r\n\x05\x04\n\x02\0\ + \x04\x12\x04\x93\x01\x04\x0c\n\r\n\x05\x04\n\x02\0\x05\x12\x04\x93\x01\r\ + \x12\n\r\n\x05\x04\n\x02\0\x01\x12\x04\x93\x01\x13\x1a\n\r\n\x05\x04\n\ + \x02\0\x03\x12\x04\x93\x01\x1d\x1e\nw\n\x02\x04\x0b\x12\x06\x9c\x01\0\ + \x9d\x01\x01\x1ai*\n\x20Request:\x20Request\x20device\x20to\x20wipe\x20a\ + ll\x20sensitive\x20data\x20and\x20settings\n\x20@start\n\x20@next\x20Suc\ + cess\n\x20@next\x20Failure\n\n\x0b\n\x03\x04\x0b\x01\x12\x04\x9c\x01\x08\ + \x12\nz\n\x02\x04\x0c\x12\x06\xa5\x01\0\xae\x01\x01\x1al*\n\x20Request:\ + \x20Load\x20seed\x20and\x20related\x20internal\x20settings\x20from\x20th\ + e\x20computer\n\x20@start\n\x20@next\x20Success\n\x20@next\x20Failure\n\ + \n\x0b\n\x03\x04\x0c\x01\x12\x04\xa5\x01\x08\x12\nD\n\x04\x04\x0c\x02\0\ + \x12\x04\xa6\x01\x04!\"6\x20seed\x20encoded\x20as\x20BIP-39\x20mnemonic\ + \x20(12,\x2018\x20or\x2024\x20words)\n\n\r\n\x05\x04\x0c\x02\0\x04\x12\ + \x04\xa6\x01\x04\x0c\n\r\n\x05\x04\x0c\x02\0\x05\x12\x04\xa6\x01\r\x13\n\ + \r\n\x05\x04\x0c\x02\0\x01\x12\x04\xa6\x01\x14\x1c\n\r\n\x05\x04\x0c\x02\ + \0\x03\x12\x04\xa6\x01\x1f\x20\n\x1b\n\x04\x04\x0c\x02\x01\x12\x04\xa7\ + \x01\x04;\"\r\x20BIP-32\x20node\n\n\r\n\x05\x04\x0c\x02\x01\x04\x12\x04\ + \xa7\x01\x04\x0c\n\r\n\x05\x04\x0c\x02\x01\x06\x12\x04\xa7\x01\r1\n\r\n\ + \x05\x04\x0c\x02\x01\x01\x12\x04\xa7\x0126\n\r\n\x05\x04\x0c\x02\x01\x03\ + \x12\x04\xa7\x019:\n\"\n\x04\x04\x0c\x02\x02\x12\x04\xa8\x01\x04\x1c\"\ + \x14\x20set\x20PIN\x20protection\n\n\r\n\x05\x04\x0c\x02\x02\x04\x12\x04\ + \xa8\x01\x04\x0c\n\r\n\x05\x04\x0c\x02\x02\x05\x12\x04\xa8\x01\r\x13\n\r\ + \n\x05\x04\x0c\x02\x02\x01\x12\x04\xa8\x01\x14\x17\n\r\n\x05\x04\x0c\x02\ + \x02\x03\x12\x04\xa8\x01\x1a\x1b\n>\n\x04\x04\x0c\x02\x03\x12\x04\xa9\ + \x01\x04,\"0\x20enable\x20master\x20node\x20encryption\x20using\x20passp\ + hrase\n\n\r\n\x05\x04\x0c\x02\x03\x04\x12\x04\xa9\x01\x04\x0c\n\r\n\x05\ + \x04\x0c\x02\x03\x05\x12\x04\xa9\x01\r\x11\n\r\n\x05\x04\x0c\x02\x03\x01\ + \x12\x04\xa9\x01\x12'\n\r\n\x05\x04\x0c\x02\x03\x03\x12\x04\xa9\x01*+\n\ + \x1f\n\x04\x04\x0c\x02\x04\x12\x04\xaa\x01\x045\"\x11\x20device\x20langu\ + age\n\n\r\n\x05\x04\x0c\x02\x04\x04\x12\x04\xaa\x01\x04\x0c\n\r\n\x05\ + \x04\x0c\x02\x04\x05\x12\x04\xaa\x01\r\x13\n\r\n\x05\x04\x0c\x02\x04\x01\ + \x12\x04\xaa\x01\x14\x1c\n\r\n\x05\x04\x0c\x02\x04\x03\x12\x04\xaa\x01\ + \x1f\x20\n\r\n\x05\x04\x0c\x02\x04\x08\x12\x04\xaa\x01!4\n\r\n\x05\x04\ + \x0c\x02\x04\x07\x12\x04\xaa\x01*3\n\x1c\n\x04\x04\x0c\x02\x05\x12\x04\ + \xab\x01\x04\x1e\"\x0e\x20device\x20label\n\n\r\n\x05\x04\x0c\x02\x05\ + \x04\x12\x04\xab\x01\x04\x0c\n\r\n\x05\x04\x0c\x02\x05\x05\x12\x04\xab\ + \x01\r\x13\n\r\n\x05\x04\x0c\x02\x05\x01\x12\x04\xab\x01\x14\x19\n\r\n\ + \x05\x04\x0c\x02\x05\x03\x12\x04\xab\x01\x1c\x1d\n>\n\x04\x04\x0c\x02\ + \x06\x12\x04\xac\x01\x04$\"0\x20do\x20not\x20test\x20mnemonic\x20for\x20\ + valid\x20BIP-39\x20checksum\n\n\r\n\x05\x04\x0c\x02\x06\x04\x12\x04\xac\ + \x01\x04\x0c\n\r\n\x05\x04\x0c\x02\x06\x05\x12\x04\xac\x01\r\x11\n\r\n\ + \x05\x04\x0c\x02\x06\x01\x12\x04\xac\x01\x12\x1f\n\r\n\x05\x04\x0c\x02\ + \x06\x03\x12\x04\xac\x01\"#\n\x1b\n\x04\x04\x0c\x02\x07\x12\x04\xad\x01\ + \x04$\"\r\x20U2F\x20counter\n\n\r\n\x05\x04\x0c\x02\x07\x04\x12\x04\xad\ + \x01\x04\x0c\n\r\n\x05\x04\x0c\x02\x07\x05\x12\x04\xad\x01\r\x13\n\r\n\ + \x05\x04\x0c\x02\x07\x01\x12\x04\xad\x01\x14\x1f\n\r\n\x05\x04\x0c\x02\ + \x07\x03\x12\x04\xad\x01\"#\n\x82\x01\n\x02\x04\r\x12\x06\xb6\x01\0\xc0\ + \x01\x01\x1at*\n\x20Request:\x20Ask\x20device\x20to\x20do\x20initializat\ + ion\x20involving\x20user\x20interaction\n\x20@start\n\x20@next\x20Entrop\ + yRequest\n\x20@next\x20Failure\n\n\x0b\n\x03\x04\r\x01\x12\x04\xb6\x01\ + \x08\x13\n\\\n\x04\x04\r\x02\0\x12\x04\xb7\x01\x04%\"N\x20display\x20ent\ + ropy\x20generated\x20by\x20the\x20device\x20before\x20asking\x20for\x20a\ + dditional\x20entropy\n\n\r\n\x05\x04\r\x02\0\x04\x12\x04\xb7\x01\x04\x0c\ + \n\r\n\x05\x04\r\x02\0\x05\x12\x04\xb7\x01\r\x11\n\r\n\x05\x04\r\x02\0\ + \x01\x12\x04\xb7\x01\x12\x20\n\r\n\x05\x04\r\x02\0\x03\x12\x04\xb7\x01#$\ + \n(\n\x04\x04\r\x02\x01\x12\x04\xb8\x01\x04/\"\x1a\x20strength\x20of\x20\ + seed\x20in\x20bits\n\n\r\n\x05\x04\r\x02\x01\x04\x12\x04\xb8\x01\x04\x0c\ + \n\r\n\x05\x04\r\x02\x01\x05\x12\x04\xb8\x01\r\x13\n\r\n\x05\x04\r\x02\ + \x01\x01\x12\x04\xb8\x01\x14\x1c\n\r\n\x05\x04\r\x02\x01\x03\x12\x04\xb8\ + \x01\x1f\x20\n\r\n\x05\x04\r\x02\x01\x08\x12\x04\xb8\x01!.\n\r\n\x05\x04\ + \r\x02\x01\x07\x12\x04\xb8\x01*-\n>\n\x04\x04\r\x02\x02\x12\x04\xb9\x01\ + \x04,\"0\x20enable\x20master\x20node\x20encryption\x20using\x20passphras\ + e\n\n\r\n\x05\x04\r\x02\x02\x04\x12\x04\xb9\x01\x04\x0c\n\r\n\x05\x04\r\ + \x02\x02\x05\x12\x04\xb9\x01\r\x11\n\r\n\x05\x04\r\x02\x02\x01\x12\x04\ + \xb9\x01\x12'\n\r\n\x05\x04\r\x02\x02\x03\x12\x04\xb9\x01*+\n%\n\x04\x04\ + \r\x02\x03\x12\x04\xba\x01\x04%\"\x17\x20enable\x20PIN\x20protection\n\n\ + \r\n\x05\x04\r\x02\x03\x04\x12\x04\xba\x01\x04\x0c\n\r\n\x05\x04\r\x02\ + \x03\x05\x12\x04\xba\x01\r\x11\n\r\n\x05\x04\r\x02\x03\x01\x12\x04\xba\ + \x01\x12\x20\n\r\n\x05\x04\r\x02\x03\x03\x12\x04\xba\x01#$\n\x1f\n\x04\ + \x04\r\x02\x04\x12\x04\xbb\x01\x045\"\x11\x20device\x20language\n\n\r\n\ + \x05\x04\r\x02\x04\x04\x12\x04\xbb\x01\x04\x0c\n\r\n\x05\x04\r\x02\x04\ + \x05\x12\x04\xbb\x01\r\x13\n\r\n\x05\x04\r\x02\x04\x01\x12\x04\xbb\x01\ + \x14\x1c\n\r\n\x05\x04\r\x02\x04\x03\x12\x04\xbb\x01\x1f\x20\n\r\n\x05\ + \x04\r\x02\x04\x08\x12\x04\xbb\x01!4\n\r\n\x05\x04\r\x02\x04\x07\x12\x04\ + \xbb\x01*3\n\x1c\n\x04\x04\r\x02\x05\x12\x04\xbc\x01\x04\x1e\"\x0e\x20de\ + vice\x20label\n\n\r\n\x05\x04\r\x02\x05\x04\x12\x04\xbc\x01\x04\x0c\n\r\ + \n\x05\x04\r\x02\x05\x05\x12\x04\xbc\x01\r\x13\n\r\n\x05\x04\r\x02\x05\ + \x01\x12\x04\xbc\x01\x14\x19\n\r\n\x05\x04\r\x02\x05\x03\x12\x04\xbc\x01\ + \x1c\x1d\n\x1b\n\x04\x04\r\x02\x06\x12\x04\xbd\x01\x04$\"\r\x20U2F\x20co\ + unter\n\n\r\n\x05\x04\r\x02\x06\x04\x12\x04\xbd\x01\x04\x0c\n\r\n\x05\ + \x04\r\x02\x06\x05\x12\x04\xbd\x01\r\x13\n\r\n\x05\x04\r\x02\x06\x01\x12\ + \x04\xbd\x01\x14\x1f\n\r\n\x05\x04\r\x02\x06\x03\x12\x04\xbd\x01\"#\n=\n\ + \x04\x04\r\x02\x07\x12\x04\xbe\x01\x04\"\"/\x20postpone\x20seed\x20backu\ + p\x20to\x20BackupDevice\x20workflow\n\n\r\n\x05\x04\r\x02\x07\x04\x12\ + \x04\xbe\x01\x04\x0c\n\r\n\x05\x04\r\x02\x07\x05\x12\x04\xbe\x01\r\x11\n\ + \r\n\x05\x04\r\x02\x07\x01\x12\x04\xbe\x01\x12\x1d\n\r\n\x05\x04\r\x02\ + \x07\x03\x12\x04\xbe\x01\x20!\n;\n\x04\x04\r\x02\x08\x12\x04\xbf\x01\x04\ + \x20\"-\x20indicate\x20that\x20no\x20backup\x20is\x20going\x20to\x20be\ + \x20made\n\n\r\n\x05\x04\r\x02\x08\x04\x12\x04\xbf\x01\x04\x0c\n\r\n\x05\ + \x04\r\x02\x08\x05\x12\x04\xbf\x01\r\x11\n\r\n\x05\x04\r\x02\x08\x01\x12\ + \x04\xbf\x01\x12\x1b\n\r\n\x05\x04\r\x02\x08\x03\x12\x04\xbf\x01\x1e\x1f\ + \nv\n\x02\x04\x0e\x12\x06\xc7\x01\0\xc8\x01\x01\x1ah*\n\x20Request:\x20P\ + erform\x20backup\x20of\x20the\x20device\x20seed\x20if\x20not\x20backed\ + \x20up\x20using\x20ResetDevice\n\x20@start\n\x20@next\x20Success\n\n\x0b\ + \n\x03\x04\x0e\x01\x12\x04\xc7\x01\x08\x14\n[\n\x02\x04\x0f\x12\x06\xce\ + \x01\0\xcf\x01\x01\x1aM*\n\x20Response:\x20Ask\x20for\x20additional\x20e\ + ntropy\x20from\x20host\x20computer\n\x20@next\x20EntropyAck\n\n\x0b\n\ + \x03\x04\x0f\x01\x12\x04\xce\x01\x08\x16\na\n\x02\x04\x10\x12\x06\xd5\ + \x01\0\xd7\x01\x01\x1aS*\n\x20Request:\x20Provide\x20additional\x20entro\ + py\x20for\x20seed\x20generation\x20function\n\x20@next\x20Success\n\n\ + \x0b\n\x03\x04\x10\x01\x12\x04\xd5\x01\x08\x12\n2\n\x04\x04\x10\x02\0\ + \x12\x04\xd6\x01\x04\x1f\"$\x20256\x20bits\x20(32\x20bytes)\x20of\x20ran\ + dom\x20data\n\n\r\n\x05\x04\x10\x02\0\x04\x12\x04\xd6\x01\x04\x0c\n\r\n\ + \x05\x04\x10\x02\0\x05\x12\x04\xd6\x01\r\x12\n\r\n\x05\x04\x10\x02\0\x01\ + \x12\x04\xd6\x01\x13\x1a\n\r\n\x05\x04\x10\x02\0\x03\x12\x04\xd6\x01\x1d\ + \x1e\n\xb5\x01\n\x02\x04\x11\x12\x06\xdf\x01\0\xf7\x01\x01\x1a\xa6\x01*\ + \n\x20Request:\x20Start\x20recovery\x20workflow\x20asking\x20user\x20for\ + \x20specific\x20words\x20of\x20mnemonic\n\x20Used\x20to\x20recovery\x20d\ + evice\x20safely\x20even\x20on\x20untrusted\x20computer.\n\x20@start\n\ + \x20@next\x20WordRequest\n\n\x0b\n\x03\x04\x11\x01\x12\x04\xdf\x01\x08\ + \x16\n2\n\x04\x04\x11\x02\0\x12\x04\xe0\x01\x04#\"$\x20number\x20of\x20w\ + ords\x20in\x20BIP-39\x20mnemonic\n\n\r\n\x05\x04\x11\x02\0\x04\x12\x04\ + \xe0\x01\x04\x0c\n\r\n\x05\x04\x11\x02\0\x05\x12\x04\xe0\x01\r\x13\n\r\n\ + \x05\x04\x11\x02\0\x01\x12\x04\xe0\x01\x14\x1e\n\r\n\x05\x04\x11\x02\0\ + \x03\x12\x04\xe0\x01!\"\n>\n\x04\x04\x11\x02\x01\x12\x04\xe1\x01\x04,\"0\ + \x20enable\x20master\x20node\x20encryption\x20using\x20passphrase\n\n\r\ + \n\x05\x04\x11\x02\x01\x04\x12\x04\xe1\x01\x04\x0c\n\r\n\x05\x04\x11\x02\ + \x01\x05\x12\x04\xe1\x01\r\x11\n\r\n\x05\x04\x11\x02\x01\x01\x12\x04\xe1\ + \x01\x12'\n\r\n\x05\x04\x11\x02\x01\x03\x12\x04\xe1\x01*+\n%\n\x04\x04\ + \x11\x02\x02\x12\x04\xe2\x01\x04%\"\x17\x20enable\x20PIN\x20protection\n\ + \n\r\n\x05\x04\x11\x02\x02\x04\x12\x04\xe2\x01\x04\x0c\n\r\n\x05\x04\x11\ + \x02\x02\x05\x12\x04\xe2\x01\r\x11\n\r\n\x05\x04\x11\x02\x02\x01\x12\x04\ + \xe2\x01\x12\x20\n\r\n\x05\x04\x11\x02\x02\x03\x12\x04\xe2\x01#$\n\x1f\n\ + \x04\x04\x11\x02\x03\x12\x04\xe3\x01\x045\"\x11\x20device\x20language\n\ + \n\r\n\x05\x04\x11\x02\x03\x04\x12\x04\xe3\x01\x04\x0c\n\r\n\x05\x04\x11\ + \x02\x03\x05\x12\x04\xe3\x01\r\x13\n\r\n\x05\x04\x11\x02\x03\x01\x12\x04\ + \xe3\x01\x14\x1c\n\r\n\x05\x04\x11\x02\x03\x03\x12\x04\xe3\x01\x1f\x20\n\ + \r\n\x05\x04\x11\x02\x03\x08\x12\x04\xe3\x01!4\n\r\n\x05\x04\x11\x02\x03\ + \x07\x12\x04\xe3\x01*3\n\x1c\n\x04\x04\x11\x02\x04\x12\x04\xe4\x01\x04\ + \x1e\"\x0e\x20device\x20label\n\n\r\n\x05\x04\x11\x02\x04\x04\x12\x04\ + \xe4\x01\x04\x0c\n\r\n\x05\x04\x11\x02\x04\x05\x12\x04\xe4\x01\r\x13\n\r\ + \n\x05\x04\x11\x02\x04\x01\x12\x04\xe4\x01\x14\x19\n\r\n\x05\x04\x11\x02\ + \x04\x03\x12\x04\xe4\x01\x1c\x1d\n:\n\x04\x04\x11\x02\x05\x12\x04\xe5\ + \x01\x04'\",\x20enforce\x20BIP-39\x20wordlist\x20during\x20the\x20proces\ + s\n\n\r\n\x05\x04\x11\x02\x05\x04\x12\x04\xe5\x01\x04\x0c\n\r\n\x05\x04\ + \x11\x02\x05\x05\x12\x04\xe5\x01\r\x11\n\r\n\x05\x04\x11\x02\x05\x01\x12\ + \x04\xe5\x01\x12\"\n\r\n\x05\x04\x11\x02\x05\x03\x12\x04\xe5\x01%&\nP\n\ + \x04\x04\x11\x02\x06\x12\x04\xe7\x01\x04)\x1a'\x207\x20reserved\x20for\ + \x20unused\x20recovery\x20method\n\"\x19\x20supported\x20recovery\x20typ\ + e\n\n\r\n\x05\x04\x11\x02\x06\x04\x12\x04\xe7\x01\x04\x0c\n\r\n\x05\x04\ + \x11\x02\x06\x06\x12\x04\xe7\x01\r\x1f\n\r\n\x05\x04\x11\x02\x06\x01\x12\ + \x04\xe7\x01\x20$\n\r\n\x05\x04\x11\x02\x06\x03\x12\x04\xe7\x01'(\n\x1b\ + \n\x04\x04\x11\x02\x07\x12\x04\xe8\x01\x04$\"\r\x20U2F\x20counter\n\n\r\ + \n\x05\x04\x11\x02\x07\x04\x12\x04\xe8\x01\x04\x0c\n\r\n\x05\x04\x11\x02\ + \x07\x05\x12\x04\xe8\x01\r\x13\n\r\n\x05\x04\x11\x02\x07\x01\x12\x04\xe8\ + \x01\x14\x1f\n\r\n\x05\x04\x11\x02\x07\x03\x12\x04\xe8\x01\"#\nP\n\x04\ + \x04\x11\x02\x08\x12\x04\xe9\x01\x04\x1f\"B\x20perform\x20dry-run\x20rec\ + overy\x20workflow\x20(for\x20safe\x20mnemonic\x20validation)\n\n\r\n\x05\ + \x04\x11\x02\x08\x04\x12\x04\xe9\x01\x04\x0c\n\r\n\x05\x04\x11\x02\x08\ + \x05\x12\x04\xe9\x01\r\x11\n\r\n\x05\x04\x11\x02\x08\x01\x12\x04\xe9\x01\ + \x12\x19\n\r\n\x05\x04\x11\x02\x08\x03\x12\x04\xe9\x01\x1c\x1e\n\xd3\x02\ + \n\x04\x04\x11\x04\0\x12\x06\xf2\x01\x04\xf6\x01\x05\x1a\xc2\x02*\n\x20T\ + ype\x20of\x20recovery\x20procedure.\x20These\x20should\x20be\x20used\x20\ + as\x20bitmask,\x20e.g.,\n\x20`RecoveryDeviceType_ScrambledWords\x20|\x20\ + RecoveryDeviceType_Matrix`\n\x20listing\x20every\x20method\x20supported\ + \x20by\x20the\x20host\x20computer.\n\n\x20Note\x20that\x20ScrambledWords\ + \x20must\x20be\x20supported\x20by\x20every\x20implementation\n\x20for\ + \x20backward\x20compatibility;\x20there\x20is\x20no\x20way\x20to\x20not\ + \x20support\x20it.\n\n\r\n\x05\x04\x11\x04\0\x01\x12\x04\xf2\x01\t\x1b\n\ + Y\n\x06\x04\x11\x04\0\x02\0\x12\x04\xf4\x01\x08.\x1a-\x20use\x20powers\ + \x20of\x20two\x20when\x20extending\x20this\x20field\n\"\x1a\x20words\x20\ + in\x20scrambled\x20order\n\n\x0f\n\x07\x04\x11\x04\0\x02\0\x01\x12\x04\ + \xf4\x01\x08)\n\x0f\n\x07\x04\x11\x04\0\x02\0\x02\x12\x04\xf4\x01,-\n&\n\ + \x06\x04\x11\x04\0\x02\x01\x12\x04\xf5\x01\x08&\"\x16\x20matrix\x20recov\ + ery\x20type\n\n\x0f\n\x07\x04\x11\x04\0\x02\x01\x01\x12\x04\xf5\x01\x08!\ + \n\x0f\n\x07\x04\x11\x04\0\x02\x01\x02\x12\x04\xf5\x01$%\n\x9e\x01\n\x02\ + \x04\x12\x12\x06\xfe\x01\0\x88\x02\x01\x1a\x8f\x01*\n\x20Response:\x20De\ + vice\x20is\x20waiting\x20for\x20user\x20to\x20enter\x20word\x20of\x20the\ + \x20mnemonic\n\x20Its\x20position\x20is\x20shown\x20only\x20on\x20device\ + 's\x20internal\x20display.\n\x20@next\x20WordAck\n\n\x0b\n\x03\x04\x12\ + \x01\x12\x04\xfe\x01\x08\x13\n\x0c\n\x04\x04\x12\x02\0\x12\x04\xff\x01\ + \x04&\n\r\n\x05\x04\x12\x02\0\x04\x12\x04\xff\x01\x04\x0c\n\r\n\x05\x04\ + \x12\x02\0\x06\x12\x04\xff\x01\r\x1c\n\r\n\x05\x04\x12\x02\0\x01\x12\x04\ + \xff\x01\x1d!\n\r\n\x05\x04\x12\x02\0\x03\x12\x04\xff\x01$%\n1\n\x04\x04\ + \x12\x04\0\x12\x06\x83\x02\x04\x87\x02\x05\x1a!*\n\x20Type\x20of\x20Reco\ + very\x20Word\x20request\n\n\r\n\x05\x04\x12\x04\0\x01\x12\x04\x83\x02\t\ + \x18\n\x0e\n\x06\x04\x12\x04\0\x02\0\x12\x04\x84\x02\x08\"\n\x0f\n\x07\ + \x04\x12\x04\0\x02\0\x01\x12\x04\x84\x02\x08\x1d\n\x0f\n\x07\x04\x12\x04\ + \0\x02\0\x02\x12\x04\x84\x02\x20!\n\x0e\n\x06\x04\x12\x04\0\x02\x01\x12\ + \x04\x85\x02\x08$\n\x0f\n\x07\x04\x12\x04\0\x02\x01\x01\x12\x04\x85\x02\ + \x08\x1f\n\x0f\n\x07\x04\x12\x04\0\x02\x01\x02\x12\x04\x85\x02\"#\n\x0e\ + \n\x06\x04\x12\x04\0\x02\x02\x12\x04\x86\x02\x08$\n\x0f\n\x07\x04\x12\ + \x04\0\x02\x02\x01\x12\x04\x86\x02\x08\x1f\n\x0f\n\x07\x04\x12\x04\0\x02\ + \x02\x02\x12\x04\x86\x02\"#\nx\n\x02\x04\x13\x12\x06\x90\x02\0\x92\x02\ + \x01\x1aj*\n\x20Request:\x20Computer\x20replies\x20with\x20word\x20from\ + \x20the\x20mnemonic\n\x20@next\x20WordRequest\n\x20@next\x20Success\n\ + \x20@next\x20Failure\n\n\x0b\n\x03\x04\x13\x01\x12\x04\x90\x02\x08\x0f\n\ + 6\n\x04\x04\x13\x02\0\x12\x04\x91\x02\x04\x1d\"(\x20one\x20word\x20of\ + \x20mnemonic\x20on\x20asked\x20position\n\n\r\n\x05\x04\x13\x02\0\x04\ + \x12\x04\x91\x02\x04\x0c\n\r\n\x05\x04\x13\x02\0\x05\x12\x04\x91\x02\r\ + \x13\n\r\n\x05\x04\x13\x02\0\x01\x12\x04\x91\x02\x14\x18\n\r\n\x05\x04\ + \x13\x02\0\x03\x12\x04\x91\x02\x1b\x1c\nA\n\x02\x04\x14\x12\x06\x99\x02\ + \0\x9b\x02\x01\x1a3*\n\x20Request:\x20Set\x20U2F\x20counter\n\x20@start\ + \n\x20@next\x20Success\n\n\x0b\n\x03\x04\x14\x01\x12\x04\x99\x02\x08\x15\ + \n\x17\n\x04\x04\x14\x02\0\x12\x04\x9a\x02\x04$\"\t\x20counter\n\n\r\n\ + \x05\x04\x14\x02\0\x04\x12\x04\x9a\x02\x04\x0c\n\r\n\x05\x04\x14\x02\0\ + \x05\x12\x04\x9a\x02\r\x13\n\r\n\x05\x04\x14\x02\0\x01\x12\x04\x9a\x02\ + \x14\x1f\n\r\n\x05\x04\x14\x02\0\x03\x12\x04\x9a\x02\"#\ +"; + +static mut file_descriptor_proto_lazy: ::protobuf::lazy::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::descriptor::FileDescriptorProto, +}; + +fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto { + ::protobuf::parse_from_bytes(file_descriptor_proto_data).unwrap() +} + +pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { + unsafe { + file_descriptor_proto_lazy.get(|| { + parse_descriptor_proto() + }) + } +} diff --git a/src/protos/mod.rs b/src/protos/mod.rs new file mode 100644 index 0000000..1d7d2fa --- /dev/null +++ b/src/protos/mod.rs @@ -0,0 +1,15 @@ +pub mod messages; +pub mod messages_bitcoin; +pub mod messages_bootloader; +pub mod messages_common; +pub mod messages_crypto; +pub mod messages_debug; +pub mod messages_management; + +pub use self::messages::*; +pub use self::messages_bitcoin::*; +pub use self::messages_bootloader::*; +pub use self::messages_common::*; +pub use self::messages_crypto::*; +pub use self::messages_debug::*; +pub use self::messages_management::*; diff --git a/src/trezor.rs b/src/trezor.rs new file mode 100644 index 0000000..b559a6d --- /dev/null +++ b/src/trezor.rs @@ -0,0 +1,187 @@ +use std::fmt; + +use hid; + +use super::Model; +use constants; +use error::{Error, Result}; +use protobuf; +use protocol::{Protocol, ProtocolV1, ProtocolV2, Transport}; + +pub struct Trezor { + pub model: Model, + pub debug: bool, + + _hid_manager: hid::Manager, + hid_version: usize, + handle: Option, +} + +impl Drop for Trezor { + fn drop(&mut self) { + // Manually drop before manager is dropped. + self.handle.take(); + } +} + +impl fmt::Debug for Trezor { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "{} (debug: {}, hid version: {})", self.model, self.debug, self.hid_version) + } +} + +impl fmt::Display for Trezor { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "{} (debug: {})", self.model, self.debug) + } +} + +impl Transport for Trezor { + fn write_chunk(&mut self, chunk: Vec) -> Result<()> { + assert_eq!(64, chunk.len()); + Ok(()) + } + fn read_chunk(&mut self) -> Result> { + Ok(vec![]) + } +} + +impl Trezor { + fn call(&mut self, send: S) -> Result + where + S: protobuf::Message, + R: protobuf::Message, + { + Err(Error::UnknownHidVersion) + } +} + +/// Used to indicate that a Trezor device was found, but that it was unavailable for usage. +#[derive(Debug)] +pub struct AvailableDevice { + pub model: Model, + pub debug: bool, + pub serial_nb: String, +} + +impl fmt::Display for AvailableDevice { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "{} (debug: {}, serial nb: {})", self.model, self.debug, &self.serial_nb) + } +} + +/// Probe the HID version for a Trezor 1 device. +fn probe_hid_version(handle: &mut hid::Handle) -> Result { + let mut w = vec![0xff; 65]; + w[0] = 0; + w[1] = 63; + if handle.data().write(w)? == 65 { + return Ok(2); + } + let mut w = vec![0xff; 64]; + w[0] = 63; + if handle.data().write(w)? == 64 { + return Ok(1); + } + Err(Error::UnknownHidVersion) +} + +impl AvailableDevice { + /// Convert the available device in a connected Trezor client. + pub fn connect(self) -> Result { + // Traverse all devices again and find the matching one. + let hidman = hid::init()?; + + let mut found = None; + for dev in hidman.devices() { + if derive_model(&dev) == Some(self.model.clone()) + && derive_debug(&dev) == Some(self.debug) + && dev.serial_number() == Some(self.serial_nb.clone()) + { + found = Some(dev.open()?); + break; + } + } + + if let Some(mut handle) = found { + let hid_version = probe_hid_version(&mut handle)?; + Ok(Trezor { + model: self.model, + debug: self.debug, + _hid_manager: hidman, + hid_version: hid_version, + handle: Some(handle), + }) + } else { + Err(Error::NoDeviceFound) + } + } +} + +fn derive_model(dev: &hid::Device) -> Option { + match (dev.vendor_id(), dev.product_id()) { + constants::hid::DEV_TREZOR1 => Some(Model::Trezor1), + constants::hid::DEV_TREZOR2 => Some(Model::Trezor2), + constants::hid::DEV_TREZOR2_BL => Some(Model::Trezor2Bl), + _ => None, + } +} + +/// Derive from the HID device whether or not it is a debugable device or not. +/// It returns None for not-recognized devices. +fn derive_debug(dev: &hid::Device) -> Option { + if dev.usage_page() == constants::hid::DEBUGLINK_USAGE + || dev.interface_number() == constants::hid::DEBUGLINK_INTERFACE + { + Some(true) + } else if dev.usage_page() == constants::hid::WIRELINK_USAGE + || dev.interface_number() == constants::hid::WIRELINK_INTERFACE + { + Some(false) + } else { + None + } +} + +/// Look for connected Trezor devices. +/// This method returns a tuple of the avilable devices and unavailable devices. +pub fn find_devices() -> Result> { + let hidman = hid::init()?; + let mut found = Vec::new(); + for dev in hidman.devices() { + let model = match derive_model(&dev) { + Some(m) => m, + None => continue, + }; + let debug = match derive_debug(&dev) { + Some(d) => d, + None => continue, + }; + let serial = match dev.serial_number() { + Some(s) => s.clone(), + None => continue, + }; + + found.push(AvailableDevice { + model: model, + debug: debug, + serial_nb: serial, + }); + } + Ok(found) +} + +/// Try to get a single device. Optionally specify whether debug should be enabled or not. +/// Can error if there are multiple or no devices available. +/// For more fine-grained device selection, use `find_devices()` and `find_devices_with_hid()`. +pub fn unique(debug: Option) -> Result { + let mut devices = find_devices()?; + if let Some(debug) = debug { + devices.retain(|d| d.debug == debug); + } + match devices.len() { + 0 => Err(Error::NoDeviceFound), + 1 => Ok(devices.remove(0).connect()?), + _ => Err(Error::DeviceNotUnique), + } +}