feat(core): introduce external app orchestration
What changed, and why it matters
This commit adds the first version of a new feature that lets a Trezor device load and run small external applications sent from a connected computer. It introduces new message types, a loading protocol, and a place to store app-related data. The actual execution part is only a stub that returns 'Not implemented', so this commit is mostly scaffolding. Because it deals with loading and running external code, it is security-sensitive, but the current code does not appear to be an active vulnerability on its own.
Treat this as a security-relevant feature addition that needs careful review once the native verification and IPC runtime are included. Specifically: ensure the fingerprint check is enforced in release builds, validate the root packet timestamp/state update against downgrade/replay attacks, bound chunk sizes and counts, and require user confirmation before loading or running external apps. Review the final run.py implementation and any sandboxing around ExtAppMessage when it lands.
Security signals we found
New wire protocol for loading and invoking external code on the device
Host-supplied header, proof, root packet, and data chunks are passed into native app image creation/verification functions not shown in this diff
Fingerprint check is gated by `if __debug__`, meaning it is disabled in release builds
Root packet update uses host-provided timestamp and state serialization without visible replay/rollback protections in this diff
ExtAppMessage/Response creates a generic IPC-style channel into an external app with arbitrary bytes
run.py is currently a stub, so the execution surface is not yet active
Large generated protobuf surface increases parsing/serialization attack surface
Evidence from the diff
The commit introduces the ‘external app orchestration’ feature. It adds protobuf messages (ExtAppLoad, ExtAppLoaded, ExtAppHeaderRequest/Ack, ExtAppRootPacketRequest/Ack, ExtAppDataChunkRequest/Ack, ExtAppMessage/Response), a shared Version message, and wires them into the message dispatch table under the USE_APP_LOADING feature flag. core/src/apps/extapp/load.py implements a host-driven loading flow: request header, update root packet if timestamp changed, create an app image, verify it matches the requested id/version/fingerprint, then stream chunks by index. core/src/apps/extapp/run.py is a stub that raises DataError(‘Not implemented’). Storage and cache keys for app root packet state and extapp instance/handle mapping are added. The C app_arena code is only touched for comment typos. No verification implementation details (app.create_image, image.write_chunk, app.root_update, etc.) are visible in this diff.
Changed components
core/src/apps/extapp/load.pycore/src/apps/extapp/run.pycore/src/apps/workflow_handlers.pycore/src/storage/cache_codec.pycore/src/storage/cache_codec_keys.pycore/src/storage/cache_thp.pycore/src/storage/cache_thp_keys.pycore/src/storage/device.pycommon/protob/messages-extapp.protocommon/protob/messages-common.protocommon/protob/messages.protocore/embed/io/app_arena/app_arena.ccore/embed/io/app_arena/inc/io/app_arena.hpython/src/trezorlib/messages.pyrust/trezor-client/src/protos/generated/messages_extapp.rsInspect captured patch +3114 / −28
### common/protob/check.py
@@ -31,6 +31,8 @@
prefix = "NEM"
elif prefix == "Webauthn":
prefix = "WebAuthn"
+ elif prefix == "Extapp":
+ prefix = "ExtApp"
for line in f:
line = line.strip().split(" ")
if line[0] not in ("enum", "message"):
### common/protob/messages-common.proto
@@ -203,3 +203,14 @@ message PaymentRequest {
required bytes mac = 5; // the MAC returned by GetAddress
}
}
+
+/**
+ * Structure representing a semantic version (major.minor.patch.build)
+ * @embed
+ */
+message Version {
+ required uint32 major = 1;
+ required uint32 minor = 2;
+ optional uint32 patch = 3 [default = 0];
+ optional uint32 build = 4 [default = 0];
+}
### common/protob/messages-extapp.proto
@@ -0,0 +1,135 @@
+syntax = "proto2";
+package hw.trezor.messages.extapp;
+
+// Sugar for easier handling in Java
+option java_package = "com.satoshilabs.trezor.lib.protobuf";
+option java_outer_classname = "MessageExtApp";
+
+import "messages-common.proto";
+
+/**
+ * Request: Load an external application onto the device.
+ *
+ * If the app is present in the app cache, it will be loaded into memory.
+ * Otherwise, an app header loading flow will be initiated to download the app
+ * into Trezor.
+ *
+ * @start
+ * @next ExtAppLoaded
+ * @next ExtAppHeaderRequest
+ */
+message ExtAppLoad {
+ /// Application id
+ required string id = 1;
+ /// Minimal required version
+ required common.Version version = 2;
+ /// Fingerprint of the app to load (optional)
+ optional bytes fingerprint = 3;
+}
+
+/**
+ * Response: External application loaded
+ * @end
+ */
+message ExtAppLoaded {
+ /// Instance ID of the loaded app, referred to in ExtAppRun
+ required uint32 instance_id = 1;
+ /// Version of the loaded application.
+ required common.Version version = 2;
+}
+
+/**
+ * Request: Ask for application header and merkle proof
+ *
+ * @next ExtAppHeaderAck
+ */
+message ExtAppHeaderRequest {}
+
+/**
+ * Response: Application header and merkle proof
+ *
+ * @next ExtAppDataChunkRequest
+ * @next ExtAppRootPacketRequest
+ */
+message ExtAppHeaderAck {
+ /// Application header
+ required bytes header = 1;
+ /// Merkle proof
+ required bytes proof = 2;
+ /// Root packet timestamp
+ required sint64 root_packet_timestamp = 3;
+}
+
+/**
+ * Request: Ask for the appropriate root packet
+ *
+ * The device asks for a root packet required for verification
+ * of the uploaded application.
+ *
+ * @next ExtAppRootPacketAck
+ */
+message ExtAppRootPacketRequest {
+ /// Application ring of the requested root packet
+ required uint32 app_ring = 1;
+}
+
+/**
+ * Response: Root packet
+ *
+ * @next ExtAppDataChunkRequest
+ */
+message ExtAppRootPacketAck {
+ /// Root packet content
+ required bytes root_packet = 1;
+}
+
+/**
+ * Response: Device asks for more data from application image.
+ * @end
+ * @next ExtAppDataChunkAck
+ */
+message ExtAppDataChunkRequest {
+ /// Index of the requested chunk
+ required uint32 index = 1;
+}
+
+/**
+ * Request: Data chunk sent to the device
+ *
+ * @next ExtAppDataChunkRequest
+ * @next ExtAppLoaded
+ */
+message ExtAppDataChunkAck {
+ /// Bytes from the application image
+ required bytes data = 1;
+ /// Hash used for the chunk verification
+ required bytes hash = 2;
+}
+
+/**
+ * Request: Run a workflow in an external application.
+ *
+ * @start
+ * @next ExtAppResponse
+ */
+message ExtAppMessage {
+ /// Instance ID of a loaded external application, result of ExtAppLoad.
+ required uint32 instance_id = 1;
+ /// Message ID to pass to the external app.
+ required uint32 message_id = 2;
+ /// Data to pass to the external app.
+ required bytes data = 3;
+}
+
+/**
+ * Response: Response of a workflow in the external application.
+ * @next ExtAppMessage
+ */
+message ExtAppResponse {
+ /// Message ID of the response.
+ required uint32 message_id = 1;
+ /// Data returned by the external application.
+ required bytes data = 2;
+ /// Indicator whether the workflow is finished.
+ optional bool finished = 3 [default = false];
+}
### common/protob/messages.proto
@@ -407,4 +407,16 @@ enum MessageType {
// Telemetry
MessageType_TelemetryGet = 1100 [(bitcoin_only) = true, (wire_in) = true];
MessageType_Telemetry = 1101 [(bitcoin_only) = true, (wire_out) = true];
+
+ // Trezor Apps
+ MessageType_ExtAppLoad = 9200 [(wire_in) = true];
+ MessageType_ExtAppLoaded = 9201 [(wire_out) = true];
+ MessageType_ExtAppHeaderRequest = 9202 [(wire_out) = true];
+ MessageType_ExtAppHeaderAck = 9203 [(wire_in) = true];
+ MessageType_ExtAppRootPacketRequest = 9204 [(wire_out) = true];
+ MessageType_ExtAppRootPacketAck = 9205 [(wire_in) = true];
+ MessageType_ExtAppDataChunkRequest = 9206 [(wire_out) = true];
+ MessageType_ExtAppDataChunkAck = 9207 [(wire_in) = true];
+ MessageType_ExtAppMessage = 9208 [(wire_in) = true];
+ MessageType_ExtAppResponse = 9209 [(wire_out) = true];
}
### core/embed/io/app_arena/app_arena.c
@@ -77,7 +77,7 @@ typedef struct {
size_t written_bytes;
// Hash of the next chunk
sha256_digest_t chunk_hash;
- // App fingerpint (hash of the image header)
+ // App fingerprint (hash of the image header)
sha256_digest_t fingerprint;
// Applet associated with the application
### core/embed/io/app_arena/inc/io/app_arena.h
@@ -57,7 +57,7 @@ typedef struct {
size_t data_size;
/** Size of each chunk of the payload in bytes */
size_t chunk_size;
- /** App finger print - hash of the image header */
+ /** App fingerprint - hash of the image header */
sha256_digest_t fingerprint;
/** List of allowed curves (e.g., secp256k1, ed25519)
* Each entry is a null-terminated string, and the list
### core/embed/upymod/build.rs
@@ -1211,7 +1211,7 @@ impl<'a> MpyBuilder<'a> {
}
if cfg!(feature = "app_loading") {
- files.add(src, "apps/trezorapp/*.py")?;
+ files.add(src, "apps/extapp/*.py")?;
}
if cfg!(feature = "universal_fw") {
### core/embed/upymod/qstrdefsport.h
@@ -128,6 +128,9 @@ Q(apps.evolu.get_delegated_identity_key)
Q(apps.evolu.get_node)
Q(apps.evolu.index_management)
Q(apps.evolu.sign_registration_request)
+Q(apps.extapp)
+Q(apps.extapp.load)
+Q(apps.extapp.run)
Q(apps.homescreen)
Q(apps.homescreen.device_menu)
Q(apps.management)
@@ -223,6 +226,7 @@ Q(eckhart)
Q(enums)
Q(errors)
Q(evolu)
+Q(extapp)
Q(fido)
Q(fido2)
Q(get_address)
@@ -248,6 +252,7 @@ Q(keychain)
Q(layout)
Q(layouts)
Q(list_names)
+Q(load)
Q(lock_manager)
Q(log)
Q(log_benchmark)
### core/src/apps/extapp/__init__.py
[binary or diff unavailable]
### core/src/apps/extapp/load.py
@@ -0,0 +1,145 @@
+from typing import TYPE_CHECKING
+
+import storage.device as storage_device
+import ustruct # pyright: ignore[reportMissingImports]
+from storage import cache_common as cc
+from trezor import log
+from trezor.crypto import random
+from trezor.messages import (
+ ExtAppDataChunkAck,
+ ExtAppDataChunkRequest,
+ ExtAppHeaderAck,
+ ExtAppHeaderRequest,
+ ExtAppLoad,
+ ExtAppLoaded,
+ ExtAppRootPacketAck,
+ ExtAppRootPacketRequest,
+ Version,
+)
+from trezor.wire import context
+from trezor.wire.errors import DataError
+from trezordefinitions import app_root_min_timestamp
+
+if TYPE_CHECKING:
+ from trezor import app
+
+
+def image_matches(image: app.AppImage, msg: ExtAppLoad) -> bool:
+ v = msg.version
+ if image.id() != msg.id:
+ return False
+ if image.version() < (v.major, v.minor, v.patch, v.build):
+ return False
+ if __debug__:
+ if msg.fingerprint is not None and image.fingerprint() != msg.fingerprint:
+ return False
+ return True
+
+
+async def _load_image(msg: ExtAppLoad) -> app.AppImage:
+ from trezor import app
+ from trezor.ui.layouts.progress import progress
+
+ # ---------------------------------------------------------------
+ # Request app header
+ # ---------------------------------------------------------------
+
+ header_ack = await context.call(
+ ExtAppHeaderRequest(),
+ ExtAppHeaderAck,
+ )
+
+ # ---------------------------------------------------------------
+ # Check whether the root packet is already loaded and up to date.
+ # ---------------------------------------------------------------
+
+ app_ring = app.app_ring_from_header(header_ack.header)
+
+ if app.root_is_loaded(app_ring):
+ root_timestamp = app.root_timestamp(app_ring)
+ else:
+ root_timestamp = 0
+
+ if root_timestamp != header_ack.root_packet_timestamp:
+ root_packet_ack = await context.call(
+ ExtAppRootPacketRequest(app_ring=app_ring),
+ ExtAppRootPacketAck,
+ )
+
+ # Update the root packet
+ min_timestamp = app_root_min_timestamp()
+ state = app.AppRootState(min_timestamp, storage_device.get_app_root_state())
+ app.root_update(root_packet_ack.root_packet, state)
+ storage_device.set_app_root_state(state.serialize())
+
+ # ---------------------------------------------------------------
+ # Create image and load chunks
+ # ---------------------------------------------------------------
+
+ image = app.create_image(header_ack.header, header_ack.proof)
+
+ if not image_matches(image, msg):
+ image.delete()
+ raise DataError("Loaded image does not match the expected app")
+
+ prog = progress("Loading app...")
+ chunk_size = image.chunk_size()
+ chunk_count = (image.size() + chunk_size - 1) // chunk_size
+ for chunk_index in range(chunk_count):
+ prog.report(int(chunk_index / chunk_count * 1000))
+ chunk = await context.call(
+ ExtAppDataChunkRequest(
+ index=chunk_index,
+ ),
+ ExtAppDataChunkAck,
+ )
+ image.write_chunk(chunk.data, chunk.hash)
+
+ if not image.is_ready():
+ image.delete()
+ # Image was not fully loaded, probably truncated by the host.
+ raise DataError("App image truncated")
+
+ prog.stop()
+ return image
+
+
+async def load(msg: ExtAppLoad) -> ExtAppLoaded:
+ """Load external application from a host"""
+ from trezor import app
+
+ try:
+ image = next(app.images())
+ except StopIteration:
+ image = None
+
+ if image is not None:
+ if not image_matches(image, msg) or not image.is_ready():
+ image.delete()
+ image = None
+ elif image.is_running():
+ image.stop() # ensure clean state
+
+ if image is None:
+ try:
+ image = await _load_image(msg)
+ except app.AppImageVerificationError as e:
+ log.exception(__name__, e)
+ raise DataError("App image verification failed")
+ except app.AppImageMemoryError as e:
+ log.exception(__name__, e)
+ raise DataError("Not enough memory to load app")
+ except app.AppError as e:
+ log.exception(__name__, e)
+ raise DataError("Failed to load app")
+
+ image.run()
+
+ instance_id = random.uniform(2**32 - 1)
+ cache_entry = ustruct.pack("<II", image.handle(), instance_id)
+ context.cache_set(cc.APP_EXTAPP_IDS, cache_entry)
+ major, minor, patch, build = image.version()
+ return ExtAppLoaded(
+ instance_id=instance_id,
+ version=Version(major=major, minor=minor, patch=patch, build=build),
+ )
### core/src/apps/extapp/run.py
@@ -0,0 +1,6 @@
+from trezor.messages import ExtAppMessage, ExtAppResponse
+from trezor.wire.errors import DataError
+
+
+async def run(_request: ExtAppMessage) -> ExtAppResponse:
+ raise DataError("Not implemented")
### core/src/apps/workflow_handlers.py
@@ -98,6 +98,13 @@ def _find_message_handler_module(msg_type: int) -> str:
if msg_type == MessageType.VerifyMessage:
return "apps.bitcoin.verify_message"
+ # extapp
+ if utils.USE_APP_LOADING:
+ if msg_type == MessageType.ExtAppLoad:
+ return "apps.extapp.load"
+ if msg_type == MessageType.ExtAppMessage:
+ return "apps.extapp.run"
+
# misc
if msg_type == MessageType.GetEntropy:
return "apps.misc.get_entropy"
### core/src/storage/cache_codec.py
@@ -41,6 +41,7 @@ def __init__(self) -> None:
96, # APP_CARDANO_ICARUS_SECRET
96, # APP_CARDANO_ICARUS_TREZOR_SECRET
0, # APP_MONERO_LIVE_REFRESH
+ 4 + 4, # APP_EXTAPP_IDS
)
self.last_usage = 0
super().__init__()
### core/src/storage/cache_codec_keys.py
@@ -13,3 +13,4 @@
APP_CARDANO_ICARUS_SECRET = const(5)
APP_CARDANO_ICARUS_TREZOR_SECRET = const(6)
APP_MONERO_LIVE_REFRESH = const(7)
+ APP_EXTAPP_IDS = const(8)
### core/src/storage/cache_thp.py
@@ -53,6 +53,7 @@ def __init__(self) -> None:
96, # APP_CARDANO_ICARUS_SECRET
96, # APP_CARDANO_ICARUS_TREZOR_SECRET
0, # APP_MONERO_LIVE_REFRESH
+ 4 + 4, # APP_EXTAPP_IDS
)
super().__init__()
### core/src/storage/cache_thp_keys.py
@@ -17,3 +17,4 @@
APP_CARDANO_ICARUS_SECRET = const(9)
APP_CARDANO_ICARUS_TREZOR_SECRET = const(10)
APP_MONERO_LIVE_REFRESH = const(11)
+ APP_EXTAPP_IDS = const(12)
### core/src/storage/device.py
@@ -53,6 +53,7 @@
_BINARY_MNEMONIC = const(0x25) # bytes
_DELEGATED_IDENTITY_KEY_ROTATION_INDEX = const(0x26) # int
_DISABLE_TAP_TO_WAKE = const(0x27) # bool (0x01 or empty)
+_APP_ROOT_PACKET_STATE = const(0x28) # bytes
SAFETY_CHECK_LEVEL_STRICT : Literal[0] = const(0)
@@ -568,3 +569,21 @@ def set_delegated_identity_key_rotation_index(rotation_index: int) -> None:
common.set_uint16(
_NAMESPACE, _DELEGATED_IDENTITY_KEY_ROTATION_INDEX, rotation_index
)
+
+
+if utils.USE_APP_LOADING:
+
+ def set_app_root_state(state: bytes | None) -> None:
+ """
+ Set the app root state.
+ """
+ if state is None:
+ common.delete(_NAMESPACE, _APP_ROOT_PACKET_STATE)
+ else:
+ common.set(_NAMESPACE, _APP_ROOT_PACKET_STATE, state)
+
+ def get_app_root_state() -> bytes | None:
+ """
+ Get the app root state.
+ """
+ return common.get(_NAMESPACE, _APP_ROOT_PACKET_STATE)
### core/src/trezor/enums/MessageType.py
@@ -305,3 +305,13 @@
TronDelegateResourceContract = 2211
TronUnDelegateResourceContract = 2212
TronWithdrawBalance = 2213
+ ExtAppLoad = 9200
+ ExtAppLoaded = 9201
+ ExtAppHeaderRequest = 9202
+ ExtAppHeaderAck = 9203
+ ExtAppRootPacketRequest = 9204
+ ExtAppRootPacketAck = 9205
+ ExtAppDataChunkRequest = 9206
+ ExtAppDataChunkAck = 9207
+ ExtAppMessage = 9208
+ ExtAppResponse = 9209
### core/src/trezor/enums/__init__.py
@@ -784,3 +784,13 @@ class MessageType(IntEnum):
BenchmarkResult = 9103
TelemetryGet = 1100
Telemetry = 1101
+ ExtAppLoad = 9200
+ ExtAppLoaded = 9201
+ ExtAppHeaderRequest = 9202
+ ExtAppHeaderAck = 9203
+ ExtAppRootPacketRequest = 9204
+ ExtAppRootPacketAck = 9205
+ ExtAppDataChunkRequest = 9206
+ ExtAppDataChunkAck = 9207
+ ExtAppMessage = 9208
+ ExtAppResponse = 9209
### core/src/trezor/messages.py
@@ -285,6 +285,26 @@ def __init__(
def is_type_of(cls, msg: Any) -> TypeGuard["PaymentRequest"]:
return isinstance(msg, cls)
+ class Version(protobuf.MessageType):
+ major: "int"
+ minor: "int"
+ patch: "int"
+ build: "int"
+
+ def __init__(
+ self,
+ *,
+ major: "int",
+ minor: "int",
+ patch: "int | None" = None,
+ build: "int | None" = None,
+ ) -> None:
+ pass
+
+ @classmethod
+ def is_type_of(cls, msg: Any) -> TypeGuard["Version"]:
+ return isinstance(msg, cls)
+
class PaymentRequestMemo(protobuf.MessageType):
text_memo: "TextMemo | None"
refund_memo: "RefundMemo | None"
@@ -4623,6 +4643,158 @@ def __init__(
def is_type_of(cls, msg: Any) -> TypeGuard["EvoluIndexManagementResponse"]:
return isinstance(msg, cls)
+ class ExtAppLoad(protobuf.MessageType):
+ id: "str"
+ version: "Version"
+ fingerprint: "AnyBytes | None"
+
+ def __init__(
+ self,
+ *,
+ id: "str",
+ version: "Version",
+ fingerprint: "AnyBytes | None" = None,
+ ) -> None:
+ pass
+
+ @classmethod
+ def is_type_of(cls, msg: Any) -> TypeGuard["ExtAppLoad"]:
+ return isinstance(msg, cls)
+
+ class ExtAppLoaded(protobuf.MessageType):
+ instance_id: "int"
+ version: "Version"
+
+ def __init__(
+ self,
+ *,
+ instance_id: "int",
+ version: "Version",
+ ) -> None:
+ pass
+
+ @classmethod
+ def is_type_of(cls, msg: Any) -> TypeGuard["ExtAppLoaded"]:
+ return isinstance(msg, cls)
+
+ class ExtAppHeaderRequest(protobuf.MessageType):
+
+ @classmethod
+ def is_type_of(cls, msg: Any) -> TypeGuard["ExtAppHeaderRequest"]:
+ return isinstance(msg, cls)
+
+ class ExtAppHeaderAck(protobuf.MessageType):
+ header: "AnyBytes"
+ proof: "AnyBytes"
+ root_packet_timestamp: "int"
+
+ def __init__(
+ self,
+ *,
+ header: "AnyBytes",
+ proof: "AnyBytes",
+ root_packet_timestamp: "int",
+ ) -> None:
+ pass
+
+ @classmethod
+ def is_type_of(cls, msg: Any) -> TypeGuard["ExtAppHeaderAck"]:
+ return isinstance(msg, cls)
+
+ class ExtAppRootPacketRequest(protobuf.MessageType):
+ app_ring: "int"
+
+ def __init__(
+ self,
+ *,
+ app_ring: "int",
+ ) -> None:
+ pass
+
+ @classmethod
+ def is_type_of(cls, msg: Any) -> TypeGuard["ExtAppRootPacketRequest"]:
+ return isinstance(msg, cls)
+
+ class ExtAppRootPacketAck(protobuf.MessageType):
+ root_packet: "AnyBytes"
+
+ def __init__(
+ self,
+ *,
+ root_packet: "AnyBytes",
+ ) -> None:
+ pass
+
+ @classmethod
+ def is_type_of(cls, msg: Any) -> TypeGuard["ExtAppRootPacketAck"]:
+ return isinstance(msg, cls)
+
+ class ExtAppDataChunkRequest(protobuf.MessageType):
+ index: "int"
+
+ def __init__(
+ self,
+ *,
+ index: "int",
+ ) -> None:
+ pass
+
+ @classmethod
+ def is_type_of(cls, msg: Any) -> TypeGuard["ExtAppDataChunkRequest"]:
+ return isinstance(msg, cls)
+
+ class ExtAppDataChunkAck(protobuf.MessageType):
+ data: "AnyBytes"
+ hash: "AnyBytes"
+
+ def __init__(
+ self,
+ *,
+ data: "AnyBytes",
+ hash: "AnyBytes",
+ ) -> None:
+ pass
+
+ @classmethod
+ def is_type_of(cls, msg: Any) -> TypeGuard["ExtAppDataChunkAck"]:
+ return isinstance(msg, cls)
+
+ class ExtAppMessage(protobuf.MessageType):
+ instance_id: "int"
+ message_id: "int"
+ data: "AnyBytes"
+
+ def __init__(
+ self,
+ *,
+ instance_id: "int",
+ message_id: "int",
+ data: "AnyBytes",
+ ) -> None:
+ pass
+
+ @classmethod
+ def is_type_of(cls, msg: Any) -> TypeGuard["ExtAppMessage"]:
+ return isinstance(msg, cls)
+
+ class ExtAppResponse(protobuf.MessageType):
+ message_id: "int"
+ data: "AnyBytes"
+ finished: "bool"
+
+ def __init__(
+ self,
+ *,
+ message_id: "int",
+ data: "AnyBytes",
+ finished: "bool | None" = None,
+ ) -> None:
+ pass
+
+ @classmethod
+ def is_type_of(cls, msg: Any) -> TypeGuard["ExtAppResponse"]:
+ return isinstance(msg, cls)
+
class MoneroTransactionSourceEntry(protobuf.MessageType):
outputs: "list[MoneroOutputEntry]"
real_output: "int | None"
### core/tools/build_mocks
@@ -18,15 +18,15 @@ current_indent = 0
current_class = None
current_method = None
current_package = None
-current_method_is_overload = False
+current_decorators = []
def split_to_parts(line, mod_desc=None):
global current_indent
global current_class
global current_method
global current_package
- global current_method_is_overload
+ global current_decorators
if line.startswith("package: "):
current_package = line[9:].strip()
@@ -37,8 +37,8 @@ def split_to_parts(line, mod_desc=None):
current_class = None
return
- if line == "@overload\n":
- current_method_is_overload = True
+ if line.startswith("@"):
+ current_decorators.append(line)
return
if line.startswith("class "):
@@ -58,9 +58,9 @@ def split_to_parts(line, mod_desc=None):
yield (current_package, "\n")
current_indent = 4
- if current_method_is_overload:
- yield (current_package, current_indent * " " + "@overload\n")
- current_method_is_overload = False
+ for decorator in current_decorators:
+ yield (current_package, current_indent * " " + decorator)
+ current_decorators.clear()
if not line.strip():
yield (current_package, "\n")
### docs/core/embed-arch/embed-arch.md
@@ -394,7 +394,7 @@ The coreapp IPC API uses the IPC mechanism provided by the kernel:
- An application task can send an IPC message to another task by calling `ipc_send()`. This function copies an arbitrary payload, including IPC call arguments, into the recipient task's address space.
- An application task can wait for an incoming IPC message using the standard polling mechanism. Once the message is signaled, the application can call `ipc_try_receive()` to retrieve it.
-The IPC handler in coreapp is implemented in MicroPython, in `core/src/apps/trezorapp/run.py`.
+The IPC handler in coreapp is implemented in MicroPython, in `core/src/apps/extapp/run.py`.
Each IPC call is identified by a _service_ and a _message id_. The following services are currently supported:
### legacy/firmware/protob/Makefile
@@ -24,7 +24,10 @@ SKIPPED_MESSAGES := Cardano DebugMonero Eos Monero Ontology Ripple SdProtect Tez
NostrGetPubkey NostrPubkey NostrSignEvent NostrEventSignature \
BleUnpair PaymentNotification Evolu \
GetSerialNumber SerialNumber \
- TelemetryGet, Telemetry
+ TelemetryGet Telemetry \
+ ExtAppLoad ExtAppLoaded ExtAppHeaderRequest ExtAppHeaderAck \
+ ExtAppRootPacketRequest ExtAppRootPacketAck ExtAppDataChunkRequest ExtAppDataChunkAck \
+ ExtAppMessage ExtAppResponse
ifeq ($(BITCOIN_ONLY), 1)
SKIPPED_MESSAGES += Ethereum NEM Stellar
### python/src/trezorlib/messages.py
@@ -852,6 +852,16 @@ class MessageType(IntEnum):
BenchmarkResult = 9103
TelemetryGet = 1100
Telemetry = 1101
+ ExtAppLoad = 9200
+ ExtAppLoaded = 9201
+ ExtAppHeaderRequest = 9202
+ ExtAppHeaderAck = 9203
+ ExtAppRootPacketRequest = 9204
+ ExtAppRootPacketAck = 9205
+ ExtAppDataChunkRequest = 9206
+ ExtAppDataChunkAck = 9207
+ ExtAppMessage = 9208
+ ExtAppResponse = 9209
class BenchmarkListNames(protobuf.MessageType):
@@ -1062,6 +1072,29 @@ def __init__(
self.amount = amount
+class Version(protobuf.MessageType):
+ MESSAGE_WIRE_TYPE = None
+ FIELDS = {
+ 1: protobuf.Field("major", "uint32", repeated=False, required=True),
+ 2: protobuf.Field("minor", "uint32", repeated=False, required=True),
+ 3: protobuf.Field("patch", "uint32", repeated=False, required=False, default=0),
+ 4: protobuf.Field("build", "uint32", repeated=False, required=False, default=0),
+ }
+
+ def __init__(
+ self,
+ *,
+ major: "int",
+ minor: "int",
+ patch: Optional["int"] = 0,
+ build: Optional["int"] = 0,
+ ) -> None:
+ self.major = major
+ self.minor = minor
+ self.patch = patch
+ self.build = build
+
+
class PaymentRequestMemo(protobuf.MessageType):
MESSAGE_WIRE_TYPE = None
FIELDS = {
@@ -6262,6 +6295,166 @@ def __init__(
self.rotation_index = rotation_index
+class ExtAppLoad(protobuf.MessageType):
+ MESSAGE_WIRE_TYPE = 9200
+ FIELDS = {
+ 1: protobuf.Field("id", "string", repeated=False, required=True),
+ 2: protobuf.Field("version", "Version", repeated=False, required=True),
+ 3: protobuf.Field("fingerprint", "bytes", repeated=False, required=False, default=None),
+ }
+
+ def __init__(
+ self,
+ *,
+ id: "str",
+ version: "Version",
+ fingerprint: Optional["bytes"] = None,
+ ) -> None:
+ self.id = id
+ self.version = version
+ self.fingerprint = fingerprint
+
+
+class ExtAppLoaded(protobuf.MessageType):
+ MESSAGE_WIRE_TYPE = 9201
+ FIELDS = {
+ 1: protobuf.Field("instance_id", "uint32", repeated=False, required=True),
+ 2: protobuf.Field("version", "Version", repeated=False, required=True),
+ }
+
+ def __init__(
+ self,
+ *,
+ instance_id: "int",
+ version: "Version",
+ ) -> None:
+ self.instance_id = instance_id
+ self.version = version
+
+
+class ExtAppHeaderRequest(protobuf.MessageType):
+ MESSAGE_WIRE_TYPE = 9202
+
+
+class ExtAppHeaderAck(protobuf.MessageType):
+ MESSAGE_WIRE_TYPE = 9203
+ FIELDS = {
+ 1: protobuf.Field("header", "bytes", repeated=False, required=True),
+ 2: protobuf.Field("proof", "bytes", repeated=False, required=True),
+ 3: protobuf.Field("root_packet_timestamp", "sint64", repeated=False, required=True),
+ }
+
+ def __init__(
+ self,
+ *,
+ header: "bytes",
+ proof: "bytes",
+ root_packet_timestamp: "int",
+ ) -> None:
+ self.header = header
+ self.proof = proof
+ self.root_packet_timestamp = root_packet_timestamp
+
+
+class ExtAppRootPacketRequest(protobuf.MessageType):
+ MESSAGE_WIRE_TYPE = 9204
+ FIELDS = {
+ 1: protobuf.Field("app_ring", "uint32", repeated=False, required=True),
+ }
+
+ def __init__(
+ self,
+ *,
+ app_ring: "int",
+ ) -> None:
+ self.app_ring = app_ring
+
+
+class ExtAppRootPacketAck(protobuf.MessageType):
+ MESSAGE_WIRE_TYPE = 9205
+ FIELDS = {
+ 1: protobuf.Field("root_packet", "bytes", repeated=False, required=True),
+ }
+
+ def __init__(
+ self,
+ *,
+ root_packet: "bytes",
+ ) -> None:
+ self.root_packet = root_packet
+
+
+class ExtAppDataChunkRequest(protobuf.MessageType):
+ MESSAGE_WIRE_TYPE = 9206
+ FIELDS = {
+ 1: protobuf.Field("index", "uint32", repeated=False, required=True),
+ }
+
+ def __init__(
+ self,
+ *,
+ index: "int",
+ ) -> None:
+ self.index = index
+
+
+class ExtAppDataChunkAck(protobuf.MessageType):
+ MESSAGE_WIRE_TYPE = 9207
+ FIELDS = {
+ 1: protobuf.Field("data", "bytes", repeated=False, required=True),
+ 2: protobuf.Field("hash", "bytes", repeated=False, required=True),
+ }
+
+ def __init__(
+ self,
+ *,
+ data: "bytes",
+ hash: "bytes",
+ ) -> None:
+ self.data = data
+ self.hash = hash
+
+
+class ExtAppMessage(protobuf.MessageType):
+ MESSAGE_WIRE_TYPE = 9208
+ FIELDS = {
+ 1: protobuf.Field("instance_id", "uint32", repeated=False, required=True),
+ 2: protobuf.Field("message_id", "uint32", repeated=False, required=True),
+ 3: protobuf.Field("data", "bytes", repeated=False, required=True),
+ }
+
+ def __init__(
+ self,
+ *,
+ instance_id: "int",
+ message_id: "int",
+ data: "bytes",
+ ) -> None:
+ self.instance_id = instance_id
+ self.message_id = message_id
+ self.data = data
+
+
+class ExtAppResponse(protobuf.MessageType):
+ MESSAGE_WIRE_TYPE = 9209
+ FIELDS = {
+ 1: protobuf.Field("message_id", "uint32", repeated=False, required=True),
+ 2: protobuf.Field("data", "bytes", repeated=False, required=True),
+ 3: protobuf.Field("finished", "bool", repeated=False, required=False, default=False),
+ }
+
+ def __init__(
+ self,
+ *,
+ message_id: "int",
+ data: "bytes",
+ finished: Optional["bool"] = False,
+ ) -> None:
+ self.message_id = message_id
+ self.data = data
+ self.finished = finished
+
+
class MoneroTransactionSourceEntry(protobuf.MessageType):
MESSAGE_WIRE_TYPE = None
FIELDS = {
### rust/trezor-client/src/messages/generated.rs
@@ -107,6 +107,16 @@ trezor_message_impl! {
BenchmarkResult => MessageType_BenchmarkResult,
TelemetryGet => MessageType_TelemetryGet,
Telemetry => MessageType_Telemetry,
+ ExtAppLoad => MessageType_ExtAppLoad,
+ ExtAppLoaded => MessageType_ExtAppLoaded,
+ ExtAppHeaderRequest => MessageType_ExtAppHeaderRequest,
+ ExtAppHeaderAck => MessageType_ExtAppHeaderAck,
+ ExtAppRootPacketRequest => MessageType_ExtAppRootPacketRequest,
+ ExtAppRootPacketAck => MessageType_ExtAppRootPacketAck,
+ ExtAppDataChunkRequest => MessageType_ExtAppDataChunkRequest,
+ ExtAppDataChunkAck => MessageType_ExtAppDataChunkAck,
+ ExtAppMessage => MessageType_ExtAppMessage,
+ ExtAppResponse => MessageType_ExtAppResponse,
}
#[cfg(feature = "bitcoin")]
### rust/trezor-client/src/protos/generated/messages.rs
@@ -623,6 +623,26 @@ pub enum MessageType {
MessageType_TelemetryGet = 1100,
// @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_Telemetry)
MessageType_Telemetry = 1101,
+ // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_ExtAppLoad)
+ MessageType_ExtAppLoad = 9200,
+ // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_ExtAppLoaded)
+ MessageType_ExtAppLoaded = 9201,
+ // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_ExtAppHeaderRequest)
+ MessageType_ExtAppHeaderRequest = 9202,
+ // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_ExtAppHeaderAck)
+ MessageType_ExtAppHeaderAck = 9203,
+ // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_ExtAppRootPacketRequest)
+ MessageType_ExtAppRootPacketRequest = 9204,
+ // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_ExtAppRootPacketAck)
+ MessageType_ExtAppRootPacketAck = 9205,
+ // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_ExtAppDataChunkRequest)
+ MessageType_ExtAppDataChunkRequest = 9206,
+ // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_ExtAppDataChunkAck)
+ MessageType_ExtAppDataChunkAck = 9207,
+ // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_ExtAppMessage)
+ MessageType_ExtAppMessage = 9208,
+ // @@protoc_insertion_point(enum_value:hw.trezor.messages.MessageType.MessageType_ExtAppResponse)
+ MessageType_ExtAppResponse = 9209,
}
impl ::protobuf::Enum for MessageType {
@@ -932,6 +952,16 @@ impl ::protobuf::Enum for MessageType {
9103 => ::std::option::Option::Some(MessageType::MessageType_BenchmarkResult),
1100 => ::std::option::Option::Some(MessageType::MessageType_TelemetryGet),
1101 => ::std::option::Option::Some(MessageType::MessageType_Telemetry),
+ 9200 => ::std::option::Option::Some(MessageType::MessageType_ExtAppLoad),
+ 9201 => ::std::option::Option::Some(MessageType::MessageType_ExtAppLoaded),
+ 9202 => ::std::option::Option::Some(MessageType::MessageType_ExtAppHeaderRequest),
+ 9203 => ::std::option::Option::Some(MessageType::MessageType_ExtAppHeaderAck),
+ 9204 => ::std::option::Option::Some(MessageType::MessageType_ExtAppRootPacketRequest),
+ 9205 => ::std::option::Option::Some(MessageType::MessageType_ExtAppRootPacketAck),
+ 9206 => ::std::option::Option::Some(MessageType::MessageType_ExtAppDataChunkRequest),
+ 9207 => ::std::option::Option::Some(MessageType::MessageType_ExtAppDataChunkAck),
+ 9208 => ::std::option::Option::Some(MessageType::MessageType_ExtAppMessage),
+ 9209 => ::std::option::Option::Some(MessageType::MessageType_ExtAppResponse),
_ => ::std::option::Option::None
}
}
@@ -1236,6 +1266,16 @@ impl ::protobuf::Enum for MessageType {
"MessageType_BenchmarkResult" => ::std::option::Option::Some(MessageType::MessageType_BenchmarkResult),
"MessageType_TelemetryGet" => ::std::option::Option::Some(MessageType::MessageType_TelemetryGet),
"MessageType_Telemetry" => ::std::option::Option::Some(MessageType::MessageType_Telemetry),
+ "MessageType_ExtAppLoad" => ::std::option::Option::Some(MessageType::MessageType_ExtAppLoad),
+ "MessageType_ExtAppLoaded" => ::std::option::Option::Some(MessageType::MessageType_ExtAppLoaded),
+ "MessageType_ExtAppHeaderRequest" => ::std::option::Option::Some(MessageType::MessageType_ExtAppHeaderRequest),
+ "MessageType_ExtAppHeaderAck" => ::std::option::Option::Some(MessageType::MessageType_ExtAppHeaderAck),
+ "MessageType_ExtAppRootPacketRequest" => ::std::option::Option::Some(MessageType::MessageType_ExtAppRootPacketRequest),
+ "MessageType_ExtAppRootPacketAck" => ::std::option::Option::Some(MessageType::MessageType_ExtAppRootPacketAck),
+ "MessageType_ExtAppDataChunkRequest" => ::std::option::Option::Some(MessageType::MessageType_ExtAppDataChunkRequest),
+ "MessageType_ExtAppDataChunkAck" => ::std::option::Option::Some(MessageType::MessageType_ExtAppDataChunkAck),
+ "MessageType_ExtAppMessage" => ::std::option::Option::Some(MessageType::MessageType_ExtAppMessage),
+ "MessageType_ExtAppResponse" => ::std::option::Option::Some(MessageType::MessageType_ExtAppResponse),
_ => ::std::option::Option::None
}
}
@@ -1539,6 +1579,16 @@ impl ::protobuf::Enum for MessageType {
MessageType::MessageType_BenchmarkResult,
MessageType::MessageType_TelemetryGet,
MessageType::MessageType_Telemetry,
+ MessageType::MessageType_ExtAppLoad,
+ MessageType::MessageType_ExtAppLoaded,
+ MessageType::MessageType_ExtAppHeaderRequest,
+ MessageType::MessageType_ExtAppHeaderAck,
+ MessageType::MessageType_ExtAppRootPacketRequest,
+ MessageType::MessageType_ExtAppRootPacketAck,
+ MessageType::MessageType_ExtAppDataChunkRequest,
+ MessageType::MessageType_ExtAppDataChunkAck,
+ MessageType::MessageType_ExtAppMessage,
+ MessageType::MessageType_ExtAppResponse,
];
}
@@ -1848,6 +1898,16 @@ impl ::protobuf::EnumFull for MessageType {
MessageType::MessageType_BenchmarkResult => 295,
MessageType::MessageType_TelemetryGet => 296,
MessageType::MessageType_Telemetry => 297,
+ MessageType::MessageType_ExtAppLoad => 298,
+ MessageType::MessageType_ExtAppLoaded => 299,
+ MessageType::MessageType_ExtAppHeaderRequest => 300,
+ MessageType::MessageType_ExtAppHeaderAck => 301,
+ MessageType::MessageType_ExtAppRootPacketRequest => 302,
+ MessageType::MessageType_ExtAppRootPacketAck => 303,
+ MessageType::MessageType_ExtAppDataChunkRequest => 304,
+ MessageType::MessageType_ExtAppDataChunkAck => 305,
+ MessageType::MessageType_ExtAppMessage => 306,
+ MessageType::MessageType_ExtAppResponse => 307,
};
Self::enum_descriptor().value_by_index(index)
}
@@ -1866,7 +1926,7 @@ impl MessageType {
}
static file_descriptor_proto_data: &'static [u8] = b"\
- \n\x0emessages.proto\x12\x12hw.trezor.messages\x1a\roptions.proto*\xe4i\
+ \n\x0emessages.proto\x12\x12hw.trezor.messages\x1a\roptions.proto*\x83m\
\n\x0bMessageType\x12(\n\x16MessageType_Initialize\x10\0\x1a\x0c\xb0\xb5\
\x18\x01\x80\xa6\x1d\x01\x90\xb5\x18\x01\x12\x1e\n\x10MessageType_Ping\
\x10\x01\x1a\x08\x80\xa6\x1d\x01\x90\xb5\x18\x01\x12%\n\x13MessageType_S\
@@ -2209,17 +2269,27 @@ static file_descriptor_proto_data: &'static [u8] = b"\
MessageType_BenchmarkResult\x10\x8fG\x1a\x04\x80\xa6\x1d\x01\x12'\n\x18M\
essageType_TelemetryGet\x10\xcc\x08\x1a\x08\x80\xa6\x1d\x01\x90\xb5\x18\
\x01\x12$\n\x15MessageType_Telemetry\x10\xcd\x08\x1a\x08\x80\xa6\x1d\x01\
- \x98\xb5\x18\x01\x1a\x08\xc8\xf3\x18\x01\xd0\xf3\x18\x01\"\x04\x08Z\x10\
- \\\"\x04\x08M\x10N\"\x04\x08G\x10J\"\x06\x08\xd9\x03\x10\xda\x03\"\x04\
- \x08r\x10z\"\x05\x08{\x10\x95\x01\"\x06\x08\xdb\x01\x10\xdb\x01\"\x06\
- \x08\xe0\x01\x10\xe0\x01\"\x06\x08\xe2\x01\x10\xe2\x01\"\x06\x08\xe3\x01\
- \x10\xe3\x01\"\x06\x08\xe4\x01\x10\xe4\x01\"\x06\x08\xe5\x01\x10\xe5\x01\
- \"\x06\x08\xe7\x01\x10\xe7\x01\"\x06\x08\xe8\x01\x10\xe8\x01\"\x06\x08\
- \xe9\x01\x10\xe9\x01\"\x06\x08\xea\x01\x10\xea\x01\"\x06\x08\xec\x01\x10\
- \xec\x01\"\x06\x08\xed\x01\x10\xed\x01\"\x06\x08\xac\x02\x10\xb0\x02\"\
- \x06\x08\xb5\x02\x10\xb8\x02\"\x06\x08\xbc\x05\x10\xc5\x05\"\x06\x08\xe9\
- \x07\x10\xf7\x07\"\x06\x08\xfa\x07\x10\xcb\x08B8\n#com.satoshilabs.trezo\
- r.lib.protobufB\rTrezorMessage\x80\xa6\x1d\x01\
+ \x98\xb5\x18\x01\x12!\n\x16MessageType_ExtAppLoad\x10\xf0G\x1a\x04\x90\
+ \xb5\x18\x01\x12#\n\x18MessageType_ExtAppLoaded\x10\xf1G\x1a\x04\x98\xb5\
+ \x18\x01\x12*\n\x1fMessageType_ExtAppHeaderRequest\x10\xf2G\x1a\x04\x98\
+ \xb5\x18\x01\x12&\n\x1bMessageType_ExtAppHeaderAck\x10\xf3G\x1a\x04\x90\
+ \xb5\x18\x01\x12.\n#MessageType_ExtAppRootPacketRequest\x10\xf4G\x1a\x04\
+ \x98\xb5\x18\x01\x12*\n\x1fMessageType_ExtAppRootPacketAck\x10\xf5G\x1a\
+ \x04\x90\xb5\x18\x01\x12-\n\"MessageType_ExtAppDataChunkRequest\x10\xf6G\
+ \x1a\x04\x98\xb5\x18\x01\x12)\n\x1eMessageType_ExtAppDataChunkAck\x10\
+ \xf7G\x1a\x04\x90\xb5\x18\x01\x12$\n\x19MessageType_ExtAppMessage\x10\
+ \xf8G\x1a\x04\x90\xb5\x18\x01\x12%\n\x1aMessageType_ExtAppResponse\x10\
+ \xf9G\x1a\x04\x98\xb5\x18\x01\x1a\x08\xc8\xf3\x18\x01\xd0\xf3\x18\x01\"\
+ \x04\x08Z\x10\\\"\x04\x08M\x10N\"\x04\x08G\x10J\"\x06\x08\xd9\x03\x10\
+ \xda\x03\"\x04\x08r\x10z\"\x05\x08{\x10\x95\x01\"\x06\x08\xdb\x01\x10\
+ \xdb\x01\"\x06\x08\xe0\x01\x10\xe0\x01\"\x06\x08\xe2\x01\x10\xe2\x01\"\
+ \x06\x08\xe3\x01\x10\xe3\x01\"\x06\x08\xe4\x01\x10\xe4\x01\"\x06\x08\xe5\
+ \x01\x10\xe5\x01\"\x06\x08\xe7\x01\x10\xe7\x01\"\x06\x08\xe8\x01\x10\xe8\
+ \x01\"\x06\x08\xe9\x01\x10\xe9\x01\"\x06\x08\xea\x01\x10\xea\x01\"\x06\
+ \x08\xec\x01\x10\xec\x01\"\x06\x08\xed\x01\x10\xed\x01\"\x06\x08\xac\x02\
+ \x10\xb0\x02\"\x06\x08\xb5\x02\x10\xb8\x02\"\x06\x08\xbc\x05\x10\xc5\x05\
+ \"\x06\x08\xe9\x07\x10\xf7\x07\"\x06\x08\xfa\x07\x10\xcb\x08B8\n#com.sat\
+ oshilabs.trezor.lib.protobufB\rTrezorMessage\x80\xa6\x1d\x01\
";
/// `FileDescriptorProto` object which was a source for this generated file
### rust/trezor-client/src/protos/generated/messages_common.rs
@@ -3655,6 +3655,264 @@ pub mod payment_request {
}
}
+// @@protoc_insertion_point(message:hw.trezor.messages.common.Version)
+#[derive(PartialEq,Clone,Default,Debug)]
+pub struct Version {
+ // message fields
+ // @@protoc_insertion_point(field:hw.trezor.messages.common.Version.major)
+ pub major: ::std::option::Option<u32>,
+ // @@protoc_insertion_point(field:hw.trezor.messages.common.Version.minor)
+ pub minor: ::std::option::Option<u32>,
+ // @@protoc_insertion_point(field:hw.trezor.messages.common.Version.patch)
+ pub patch: ::std::option::Option<u32>,
+ // @@protoc_insertion_point(field:hw.trezor.messages.common.Version.build)
+ pub build: ::std::option::Option<u32>,
+ // special fields
+ // @@protoc_insertion_point(special_field:hw.trezor.messages.common.Version.special_fields)
+ pub special_fields: ::protobuf::SpecialFields,
+}
+
+impl<'a> ::std::default::Default for &'a Version {
+ fn default() -> &'a Version {
+ <Version as ::protobuf::Message>::default_instance()
+ }
+}
+
+impl Version {
+ pub fn new() -> Version {
+ ::std::default::Default::default()
+ }
+
+ // required uint32 major = 1;
+
+ pub fn major(&self) -> u32 {
+ self.major.unwrap_or(0)
+ }
+
+ pub fn clear_major(&mut self) {
+ self.major = ::std::option::Option::None;
+ }
+
+ pub fn has_major(&self) -> bool {
+ self.major.is_some()
+ }
+
+ // Param is passed by value, moved
+ pub fn set_major(&mut self, v: u32) {
+ self.major = ::std::option::Option::Some(v);
+ }
+
+ // required uint32 minor = 2;
+
+ pub fn minor(&self) -> u32 {
+ self.minor.unwrap_or(0)
+ }
+
+ pub fn clear_minor(&mut self) {
+ self.minor = ::std::option::Option::None;
+ }
+
+ pub fn has_minor(&self) -> bool {
+ self.minor.is_some()
+ }
+
+ // Param is passed by value, moved
+ pub fn set_minor(&mut self, v: u32) {
+ self.minor = ::std::option::Option::Some(v);
+ }
+
+ // optional uint32 patch = 3;
+
+ pub fn patch(&self) -> u32 {
+ self.patch.unwrap_or(0u32)
+ }
+
+ pub fn clear_patch(&mut self) {
+ self.patch = ::std::option::Option::None;
+ }
+
+ pub fn has_patch(&self) -> bool {
+ self.patch.is_some()
+ }
+
+ // Param is passed by value, moved
+ pub fn set_patch(&mut self, v: u32) {
+ self.patch = ::std::option::Option::Some(v);
+ }
+
+ // optional uint32 build = 4;
+
+ pub fn build(&self) -> u32 {
+ self.build.unwrap_or(0u32)
+ }
+
+ pub fn clear_build(&mut self) {
+ self.build = ::std::option::Option::None;
+ }
+
+ pub fn has_build(&self) -> bool {
+ self.build.is_some()
+ }
+
+ // Param is passed by value, moved
+ pub fn set_build(&mut self, v: u32) {
+ self.build = ::std::option::Option::Some(v);
+ }
+
+ fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData {
+ let mut fields = ::std::vec::Vec::with_capacity(4);
+ let mut oneofs = ::std::vec::Vec::with_capacity(0);
+ fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
+ "major",
+ |m: &Version| { &m.major },
+ |m: &mut Version| { &mut m.major },
+ ));
+ fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
+ "minor",
+ |m: &Version| { &m.minor },
+ |m: &mut Version| { &mut m.minor },
+ ));
+ fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
+ "patch",
+ |m: &Version| { &m.patch },
+ |m: &mut Version| { &mut m.patch },
+ ));
+ fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
+ "build",
+ |m: &Version| { &m.build },
+ |m: &mut Version| { &mut m.build },
+ ));
+ ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::<Version>(
+ "Version",
+ fields,
+ oneofs,
+ )
+ }
+}
+
+impl ::protobuf::Message for Version {
+ const NAME: &'static str = "Version";
+
+ fn is_initialized(&self) -> bool {
+ if self.major.is_none() {
+ return false;
+ }
+ if self.minor.is_none() {
+ return false;
+ }
+ true
+ }
+
+ fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> {
+ while let Some(tag) = is.read_raw_tag_or_eof()? {
+ match tag {
+ 8 => {
+ self.major = ::std::option::Option::Some(is.read_uint32()?);
+ },
+ 16 => {
+ self.minor = ::std::option::Option::Some(is.read_uint32()?);
+ },
+ 24 => {
+ self.patch = ::std::option::Option::Some(is.read_uint32()?);
+ },
+ 32 => {
+ self.build = ::std::option::Option::Some(is.read_uint32()?);
+ },
+ tag => {
+ ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
+ },
+ };
+ }
+ ::std::result::Result::Ok(())
+ }
+
+ // Compute sizes of nested messages
+ #[allow(unused_variables)]
+ fn compute_size(&self) -> u64 {
+ let mut my_size = 0;
+ if let Some(v) = self.major {
+ my_size += ::protobuf::rt::uint32_size(1, v);
+ }
+ if let Some(v) = self.minor {
+ my_size += ::protobuf::rt::uint32_size(2, v);
+ }
+ if let Some(v) = self.patch {
+ my_size += ::protobuf::rt::uint32_size(3, v);
+ }
+ if let Some(v) = self.build {
+ my_size += ::protobuf::rt::uint32_size(4, v);
+ }
+ my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
+ self.special_fields.cached_size().set(my_size as u32);
+ my_size
+ }
+
+ fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
+ if let Some(v) = self.major {
+ os.write_uint32(1, v)?;
+ }
+ if let Some(v) = self.minor {
+ os.write_uint32(2, v)?;
+ }
+ if let Some(v) = self.patch {
+ os.write_uint32(3, v)?;
+ }
+ if let Some(v) = self.build {
+ os.write_uint32(4, v)?;
+ }
+ os.write_unknown_fields(self.special_fields.unknown_fields())?;
+ ::std::result::Result::Ok(())
+ }
+
+ fn special_fields(&self) -> &::protobuf::SpecialFields {
+ &self.special_fields
+ }
+
+ fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
+ &mut self.special_fields
+ }
+
+ fn new() -> Version {
+ Version::new()
+ }
+
+ fn clear(&mut self) {
+ self.major = ::std::option::Option::None;
+ self.minor = ::std::option::Option::None;
+ self.patch = ::std::option::Option::None;
+ self.build = ::std::option::Option::None;
+ self.special_fields.clear();
+ }
+
+ fn default_instance() -> &'static Version {
+ static instance: Version = Version {
+ major: ::std::option::Option::None,
+ minor: ::std::option::Option::None,
+ patch: ::std::option::Option::None,
+ build: ::std::option::Option::None,
+ special_fields: ::protobuf::SpecialFields::new(),
+ };
+ &instance
+ }
+}
+
+impl ::protobuf::MessageFull for Version {
+ fn descriptor() -> ::protobuf::reflect::MessageDescriptor {
+ static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new();
+ descriptor.get(|| file_descriptor().message_by_package_relative_name("Version").unwrap()).clone()
+ }
+}
+
+impl ::std::fmt::Display for Version {
+ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+ ::protobuf::text_format::fmt(self, f)
+ }
+}
+
+impl ::protobuf::reflect::ProtobufValue for Version {
+ type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage<Self>;
+}
+
static file_descriptor_proto_data: &'static [u8] = b"\
\n\x15messages-common.proto\x12\x19hw.trezor.messages.common\x1a\roption\
s.proto\"%\n\x07Success\x12\x1a\n\x07message\x18\x01\x20\x01(\t:\0R\x07m\
@@ -3725,9 +3983,12 @@ static file_descriptor_proto_data: &'static [u8] = b"\
haseMemo\x12\x1b\n\tcoin_type\x18\x01\x20\x02(\rR\x08coinType\x12\x16\n\
\x06amount\x18\x02\x20\x02(\tR\x06amount\x12\x18\n\x07address\x18\x03\
\x20\x02(\tR\x07address\x12\x1b\n\taddress_n\x18\x04\x20\x03(\rR\x08addr\
- essN\x12\x10\n\x03mac\x18\x05\x20\x02(\x0cR\x03macJ\x04\x08\x04\x10\x05B\
- >\n#com.satoshilabs.trezor.lib.protobufB\x13TrezorMessageCommon\x80\xa6\
- \x1d\x01\
+ essN\x12\x10\n\x03mac\x18\x05\x20\x02(\x0cR\x03macJ\x04\x08\x04\x10\x05\
+ \"g\n\x07Version\x12\x14\n\x05major\x18\x01\x20\x02(\rR\x05major\x12\x14\
+ \n\x05minor\x18\x02\x20\x02(\rR\x05minor\x12\x17\n\x05patch\x18\x03\x20\
+ \x01(\r:\x010R\x05patch\x12\x17\n\x05build\x18\x04\x20\x01(\r:\x010R\x05\
+ buildB>\n#com.satoshilabs.trezor.lib.protobufB\x13TrezorMessageCommon\
+ \x80\xa6\x1d\x01\
";
/// `FileDescriptorProto` object which was a source for this generated file
@@ -3746,7 +4007,7 @@ pub fn file_descriptor() -> &'static ::protobuf::reflect::FileDescriptor {
let generated_file_descriptor = generated_file_descriptor_lazy.get(|| {
let mut deps = ::std::vec::Vec::with_capacity(1);
deps.push(super::options::file_descriptor().clone());
- let mut messages = ::std::vec::Vec::with_capacity(15);
+ let mut messages = ::std::vec::Vec::with_capacity(16);
messages.push(Success::generated_message_descriptor_data());
messages.push(Failure::generated_message_descriptor_data());
messages.push(ButtonRequest::generated_message_descriptor_data());
@@ -3757,6 +4018,7 @@ pub fn file_descriptor() -> &'static ::protobuf::reflect::FileDescriptor {
messages.push(PassphraseAck::generated_message_descriptor_data());
messages.push(HDNodeType::generated_message_descriptor_data());
messages.push(PaymentRequest::generated_message_descriptor_data());
+ messages.push(Version::generated_message_descriptor_data());
messages.push(payment_request::PaymentRequestMemo::generated_message_descriptor_data());
messages.push(payment_request::TextMemo::generated_message_descriptor_data());
messages.push(payment_request::TextDetailsMemo::generated_message_descriptor_data());
### rust/trezor-client/src/protos/generated/messages_extapp.rs
@@ -0,0 +1,2009 @@
+// This file is generated by rust-protobuf 3.7.2. Do not edit
+// .proto file is parsed by protoc 31.1
+// @generated
+
+// https://github.com/rust-lang/rust-clippy/issues/702
+#![allow(unknown_lints)]
+#![allow(clippy::all)]
+
+#![allow(unused_attributes)]
+#![cfg_attr(rustfmt, rustfmt::skip)]
+
+#![allow(dead_code)]
+#![allow(missing_docs)]
+#![allow(non_camel_case_types)]
+#![allow(non_snake_case)]
+#![allow(non_upper_case_globals)]
+#![allow(trivial_casts)]
+#![allow(unused_results)]
+#![allow(unused_mut)]
+
+//! Generated file from `messages-extapp.proto`
+
+/// Generated files are compatible only with the same version
+/// of protobuf runtime.
+const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_7_2;
+
+// @@protoc_insertion_point(message:hw.trezor.messages.extapp.ExtAppLoad)
+#[derive(PartialEq,Clone,Default,Debug)]
+pub struct ExtAppLoad {
+ // message fields
+ // @@protoc_insertion_point(field:hw.trezor.messages.extapp.ExtAppLoad.id)
+ pub id: ::std::option::Option<::std::string::String>,
+ // @@protoc_insertion_point(field:hw.trezor.messages.extapp.ExtAppLoad.version)
+ pub version: ::protobuf::MessageField<super::messages_common::Version>,
+ // @@protoc_insertion_point(field:hw.trezor.messages.extapp.ExtAppLoad.fingerprint)
+ pub fingerprint: ::std::option::Option<::std::vec::Vec<u8>>,
+ // special fields
+ // @@protoc_insertion_point(special_field:hw.trezor.messages.extapp.ExtAppLoad.special_fields)
+ pub special_fields: ::protobuf::SpecialFields,
+}
+
+impl<'a> ::std::default::Default for &'a ExtAppLoad {
+ fn default() -> &'a ExtAppLoad {
+ <ExtAppLoad as ::protobuf::Message>::default_instance()
+ }
+}
+
+impl ExtAppLoad {
+ pub fn new() -> ExtAppLoad {
+ ::std::default::Default::default()
+ }
+
+ // required string id = 1;
+
+ pub fn id(&self) -> &str {
+ match self.id.as_ref() {
+ Some(v) => v,
+ None => "",
+ }
+ }
+
+ pub fn clear_id(&mut self) {
+ self.id = ::std::option::Option::None;
+ }
+
+ pub fn has_id(&self) -> bool {
+ self.id.is_some()
+ }
+
+ // Param is passed by value, moved
+ pub fn set_id(&mut self, v: ::std::string::String) {
+ self.id = ::std::option::Option::Some(v);
+ }
+
+ // Mutable pointer to the field.
+ // If field is not initialized, it is initialized with default value first.
+ pub fn mut_id(&mut self) -> &mut ::std::string::String {
+ if self.id.is_none() {
+ self.id = ::std::option::Option::Some(::std::string::String::new());
+ }
+ self.id.as_mut().unwrap()
+ }
+
+ // Take field
+ pub fn take_id(&mut self) -> ::std::string::String {
+ self.id.take().unwrap_or_else(|| ::std::string::String::new())
+ }
+
+ // optional bytes fingerprint = 3;
+
+ pub fn fingerprint(&self) -> &[u8] {
+ match self.fingerprint.as_ref() {
+ Some(v) => v,
+ None => &[],
+ }
+ }
+
+ 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: ::std::vec::Vec<u8>) {
+ self.fingerprint = ::std::option::Option::Some(v);
+ }
+
+ // Mutable pointer to the field.
+ // If field is not initialized, it is initialized with default value first.
+ pub fn mut_fingerprint(&mut self) -> &mut ::std::vec::Vec<u8> {
+ if self.fingerprint.is_none() {
+ self.fingerprint = ::std::option::Option::Some(::std::vec::Vec::new());
+ }
+ self.fingerprint.as_mut().unwrap()
+ }
+
+ // Take field
+ pub fn take_fingerprint(&mut self) -> ::std::vec::Vec<u8> {
+ self.fingerprint.take().unwrap_or_else(|| ::std::vec::Vec::new())
+ }
+
+ fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData {
+ let mut fields = ::std::vec::Vec::with_capacity(3);
+ let mut oneofs = ::std::vec::Vec::with_capacity(0);
+ fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
+ "id",
+ |m: &ExtAppLoad| { &m.id },
+ |m: &mut ExtAppLoad| { &mut m.id },
+ ));
+ fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, super::messages_common::Version>(
+ "version",
+ |m: &ExtAppLoad| { &m.version },
+ |m: &mut ExtAppLoad| { &mut m.version },
+ ));
+ fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
+ "fingerprint",
+ |m: &ExtAppLoad| { &m.fingerprint },
+ |m: &mut ExtAppLoad| { &mut m.fingerprint },
+ ));
+ ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::<ExtAppLoad>(
+ "ExtAppLoad",
+ fields,
+ oneofs,
+ )
+ }
+}
+
+impl ::protobuf::Message for ExtAppLoad {
+ const NAME: &'static str = "ExtAppLoad";
+
+ fn is_initialized(&self) -> bool {
+ if self.id.is_none() {
+ return false;
+ }
+ if self.version.is_none() {
+ return false;
+ }
+ for v in &self.version {
+ if !v.is_initialized() {
+ return false;
+ }
+ };
+ true
+ }
+
+ fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> {
+ while let Some(tag) = is.read_raw_tag_or_eof()? {
+ match tag {
+ 10 => {
+ self.id = ::std::option::Option::Some(is.read_string()?);
+ },
+ 18 => {
+ ::protobuf::rt::read_singular_message_into_field(is, &mut self.version)?;
+ },
+ 26 => {
+ self.fingerprint = ::std::option::Option::Some(is.read_bytes()?);
+ },
+ tag => {
+ ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
+ },
+ };
+ }
+ ::std::result::Result::Ok(())
+ }
+
+ // Compute sizes of nested messages
+ #[allow(unused_variables)]
+ fn compute_size(&self) -> u64 {
+ let mut my_size = 0;
+ if let Some(v) = self.id.as_ref() {
+ my_size += ::protobuf::rt::string_size(1, &v);
+ }
+ if let Some(v) = self.version.as_ref() {
+ let len = v.compute_size();
+ my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
+ }
+ if let Some(v) = self.fingerprint.as_ref() {
+ my_size += ::protobuf::rt::bytes_size(3, &v);
+ }
+ my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
+ self.special_fields.cached_size().set(my_size as u32);
+ my_size
+ }
+
+ fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
+ if let Some(v) = self.id.as_ref() {
+ os.write_string(1, v)?;
+ }
+ if let Some(v) = self.version.as_ref() {
+ ::protobuf::rt::write_message_field_with_cached_size(2, v, os)?;
+ }
+ if let Some(v) = self.fingerprint.as_ref() {
+ os.write_bytes(3, v)?;
+ }
+ os.write_unknown_fields(self.special_fields.unknown_fields())?;
+ ::std::result::Result::Ok(())
+ }
+
+ fn special_fields(&self) -> &::protobuf::SpecialFields {
+ &self.special_fields
+ }
+
+ fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
+ &mut self.special_fields
+ }
+
+ fn new() -> ExtAppLoad {
+ ExtAppLoad::new()
+ }
+
+ fn clear(&mut self) {
+ self.id = ::std::option::Option::None;
+ self.version.clear();
+ self.fingerprint = ::std::option::Option::None;
+ self.special_fields.clear();
+ }
+
+ fn default_instance() -> &'static ExtAppLoad {
+ static instance: ExtAppLoad = ExtAppLoad {
+ id: ::std::option::Option::None,
+ version: ::protobuf::MessageField::none(),
+ fingerprint: ::std::option::Option::None,
+ special_fields: ::protobuf::SpecialFields::new(),
+ };
+ &instance
+ }
+}
+
+impl ::protobuf::MessageFull for ExtAppLoad {
+ fn descriptor() -> ::protobuf::reflect::MessageDescriptor {
+ static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new();
+ descriptor.get(|| file_descriptor().message_by_package_relative_name("ExtAppLoad").unwrap()).clone()
+ }
+}
+
+impl ::std::fmt::Display for ExtAppLoad {
+ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+ ::protobuf::text_format::fmt(self, f)
+ }
+}
+
+impl ::protobuf::reflect::ProtobufValue for ExtAppLoad {
+ type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage<Self>;
+}
+
+// @@protoc_insertion_point(message:hw.trezor.messages.extapp.ExtAppLoaded)
+#[derive(PartialEq,Clone,Default,Debug)]
+pub struct ExtAppLoaded {
+ // message fields
+ // @@protoc_insertion_point(field:hw.trezor.messages.extapp.ExtAppLoaded.instance_id)
+ pub instance_id: ::std::option::Option<u32>,
+ // @@protoc_insertion_point(field:hw.trezor.messages.extapp.ExtAppLoaded.version)
+ pub version: ::protobuf::MessageField<super::messages_common::Version>,
+ // special fields
+ // @@protoc_insertion_point(special_field:hw.trezor.messages.extapp.ExtAppLoaded.special_fields)
+ pub special_fields: ::protobuf::SpecialFields,
+}
+
+impl<'a> ::std::default::Default for &'a ExtAppLoaded {
+ fn default() -> &'a ExtAppLoaded {
+ <ExtAppLoaded as ::protobuf::Message>::default_instance()
+ }
+}
+
+impl ExtAppLoaded {
+ pub fn new() -> ExtAppLoaded {
+ ::std::default::Default::default()
+ }
+
+ // required uint32 instance_id = 1;
+
+ pub fn instance_id(&self) -> u32 {
+ self.instance_id.unwrap_or(0)
+ }
+
+ pub fn clear_instance_id(&mut self) {
+ self.instance_id = ::std::option::Option::None;
+ }
+
+ pub fn has_instance_id(&self) -> bool {
+ self.instance_id.is_some()
+ }
+
+ // Param is passed by value, moved
+ pub fn set_instance_id(&mut self, v: u32) {
+ self.instance_id = ::std::option::Option::Some(v);
+ }
+
+ fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData {
+ let mut fields = ::std::vec::Vec::with_capacity(2);
+ let mut oneofs = ::std::vec::Vec::with_capacity(0);
+ fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
+ "instance_id",
+ |m: &ExtAppLoaded| { &m.instance_id },
+ |m: &mut ExtAppLoaded| { &mut m.instance_id },
+ ));
+ fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, super::messages_common::Version>(
+ "version",
+ |m: &ExtAppLoaded| { &m.version },
+ |m: &mut ExtAppLoaded| { &mut m.version },
+ ));
+ ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::<ExtAppLoaded>(
+ "ExtAppLoaded",
+ fields,
+ oneofs,
+ )
+ }
+}
+
+impl ::protobuf::Message for ExtAppLoaded {
+ const NAME: &'static str = "ExtAppLoaded";
+
+ fn is_initialized(&self) -> bool {
+ if self.instance_id.is_none() {
+ return false;
+ }
+ if self.version.is_none() {
+ return false;
+ }
+ for v in &self.version {
+ if !v.is_initialized() {
+ return false;
+ }
+ };
+ true
+ }
+
+ fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> {
+ while let Some(tag) = is.read_raw_tag_or_eof()? {
+ match tag {
+ 8 => {
+ self.instance_id = ::std::option::Option::Some(is.read_uint32()?);
+ },
+ 18 => {
+ ::protobuf::rt::read_singular_message_into_field(is, &mut self.version)?;
+ },
+ tag => {
+ ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
+ },
+ };
+ }
+ ::std::result::Result::Ok(())
+ }
+
+ // Compute sizes of nested messages
+ #[allow(unused_variables)]
+ fn compute_size(&self) -> u64 {
+ let mut my_size = 0;
+ if let Some(v) = self.instance_id {
+ my_size += ::protobuf::rt::uint32_size(1, v);
+ }
+ if let Some(v) = self.version.as_ref() {
+ let len = v.compute_size();
+ my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
+ }
+ my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
+ self.special_fields.cached_size().set(my_size as u32);
+ my_size
+ }
+
+ fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
+ if let Some(v) = self.instance_id {
+ os.write_uint32(1, v)?;
+ }
+ if let Some(v) = self.version.as_ref() {
+ ::protobuf::rt::write_message_field_with_cached_size(2, v, os)?;
+ }
+ os.write_unknown_fields(self.special_fields.unknown_fields())?;
+ ::std::result::Result::Ok(())
+ }
+
+ fn special_fields(&self) -> &::protobuf::SpecialFields {
+ &self.special_fields
+ }
+
+ fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
+ &mut self.special_fields
+ }
+
+ fn new() -> ExtAppLoaded {
+ ExtAppLoaded::new()
+ }
+
+ fn clear(&mut self) {
+ self.instance_id = ::std::option::Option::None;
+ self.version.clear();
+ self.special_fields.clear();
+ }
+
+ fn default_instance() -> &'static ExtAppLoaded {
+ static instance: ExtAppLoaded = ExtAppLoaded {
+ instance_id: ::std::option::Option::None,
+ version: ::protobuf::MessageField::none(),
+ special_fields: ::protobuf::SpecialFields::new(),
+ };
+ &instance
+ }
+}
+
+impl ::protobuf::MessageFull for ExtAppLoaded {
+ fn descriptor() -> ::protobuf::reflect::MessageDescriptor {
+ static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new();
+ descriptor.get(|| file_descriptor().message_by_package_relative_name("ExtAppLoaded").unwrap()).clone()
+ }
+}
+
+impl ::std::fmt::Display for ExtAppLoaded {
+ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+ ::protobuf::text_format::fmt(self, f)
+ }
+}
+
+impl ::protobuf::reflect::ProtobufValue for ExtAppLoaded {
+ type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage<Self>;
+}
+
+// @@protoc_insertion_point(message:hw.trezor.messages.extapp.ExtAppHeaderRequest)
+#[derive(PartialEq,Clone,Default,Debug)]
+pub struct ExtAppHeaderRequest {
+ // special fields
+ // @@protoc_insertion_point(special_field:hw.trezor.messages.extapp.ExtAppHeaderRequest.special_fields)
+ pub special_fields: ::protobuf::SpecialFields,
+}
+
+impl<'a> ::std::default::Default for &'a ExtAppHeaderRequest {
+ fn default() -> &'a ExtAppHeaderRequest {
+ <ExtAppHeaderRequest as ::protobuf::Message>::default_instance()
+ }
+}
+
+impl ExtAppHeaderRequest {
+ pub fn new() -> ExtAppHeaderRequest {
+ ::std::default::Default::default()
+ }
+
+ fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData {
+ let mut fields = ::std::vec::Vec::with_capacity(0);
+ let mut oneofs = ::std::vec::Vec::with_capacity(0);
+ ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::<ExtAppHeaderRequest>(
+ "ExtAppHeaderRequest",
+ fields,
+ oneofs,
+ )
+ }
+}
+
+impl ::protobuf::Message for ExtAppHeaderRequest {
+ const NAME: &'static str = "ExtAppHeaderRequest";
+
+ fn is_initialized(&self) -> bool {
+ true
+ }
+
+ fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> {
+ while let Some(tag) = is.read_raw_tag_or_eof()? {
+ match tag {
+ tag => {
+ ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
+ },
+ };
+ }
+ ::std::result::Result::Ok(())
+ }
+
+ // Compute sizes of nested messages
+ #[allow(unused_variables)]
+ fn compute_size(&self) -> u64 {
+ let mut my_size = 0;
+ my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
+ self.special_fields.cached_size().set(my_size as u32);
+ my_size
+ }
+
+ fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
+ os.write_unknown_fields(self.special_fields.unknown_fields())?;
+ ::std::result::Result::Ok(())
+ }
+
+ fn special_fields(&self) -> &::protobuf::SpecialFields {
+ &self.special_fields
+ }
+
+ fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
+ &mut self.special_fields
+ }
+
+ fn new() -> ExtAppHeaderRequest {
+ ExtAppHeaderRequest::new()
+ }
+
+ fn clear(&mut self) {
+ self.special_fields.clear();
+ }
+
+ fn default_instance() -> &'static ExtAppHeaderRequest {
+ static instance: ExtAppHeaderRequest = ExtAppHeaderRequest {
+ special_fields: ::protobuf::SpecialFields::new(),
+ };
+ &instance
+ }
+}
+
+impl ::protobuf::MessageFull for ExtAppHeaderRequest {
+ fn descriptor() -> ::protobuf::reflect::MessageDescriptor {
+ static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new();
+ descriptor.get(|| file_descriptor().message_by_package_relative_name("ExtAppHeaderRequest").unwrap()).clone()
+ }
+}
+
+impl ::std::fmt::Display for ExtAppHeaderRequest {
+ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+ ::protobuf::text_format::fmt(self, f)
+ }
+}
+
+impl ::protobuf::reflect::ProtobufValue for ExtAppHeaderRequest {
+ type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage<Self>;
+}
+
+// @@protoc_insertion_point(message:hw.trezor.messages.extapp.ExtAppHeaderAck)
+#[derive(PartialEq,Clone,Default,Debug)]
+pub struct ExtAppHeaderAck {
+ // message fields
+ // @@protoc_insertion_point(field:hw.trezor.messages.extapp.ExtAppHeaderAck.header)
+ pub header: ::std::option::Option<::std::vec::Vec<u8>>,
+ // @@protoc_insertion_point(field:hw.trezor.messages.extapp.ExtAppHeaderAck.proof)
+ pub proof: ::std::option::Option<::std::vec::Vec<u8>>,
+ // @@protoc_insertion_point(field:hw.trezor.messages.extapp.ExtAppHeaderAck.root_packet_timestamp)
+ pub root_packet_timestamp: ::std::option::Option<i64>,
+ // special fields
+ // @@protoc_insertion_point(special_field:hw.trezor.messages.extapp.ExtAppHeaderAck.special_fields)
+ pub special_fields: ::protobuf::SpecialFields,
+}
+
+impl<'a> ::std::default::Default for &'a ExtAppHeaderAck {
+ fn default() -> &'a ExtAppHeaderAck {
+ <ExtAppHeaderAck as ::protobuf::Message>::default_instance()
+ }
+}
+
+impl ExtAppHeaderAck {
+ pub fn new() -> ExtAppHeaderAck {
+ ::std::default::Default::default()
+ }
+
+ // required bytes header = 1;
+
+ pub fn header(&self) -> &[u8] {
+ match self.header.as_ref() {
+ Some(v) => v,
+ None => &[],
+ }
+ }
+
+ pub fn clear_header(&mut self) {
+ self.header = ::std::option::Option::None;
+ }
+
+ pub fn has_header(&self) -> bool {
+ self.header.is_some()
+ }
+
+ // Param is passed by value, moved
+ pub fn set_header(&mut self, v: ::std::vec::Vec<u8>) {
+ self.header = ::std::option::Option::Some(v);
+ }
+
+ // Mutable pointer to the field.
+ // If field is not initialized, it is initialized with default value first.
+ pub fn mut_header(&mut self) -> &mut ::std::vec::Vec<u8> {
+ if self.header.is_none() {
+ self.header = ::std::option::Option::Some(::std::vec::Vec::new());
+ }
+ self.header.as_mut().unwrap()
+ }
+
+ // Take field
+ pub fn take_header(&mut self) -> ::std::vec::Vec<u8> {
+ self.header.take().unwrap_or_else(|| ::std::vec::Vec::new())
+ }
+
+ // required bytes proof = 2;
+
+ pub fn proof(&self) -> &[u8] {
+ match self.proof.as_ref() {
+ Some(v) => v,
+ None => &[],
+ }
+ }
+
+ pub fn clear_proof(&mut self) {
+ self.proof = ::std::option::Option::None;
+ }
+
+ pub fn has_proof(&self) -> bool {
+ self.proof.is_some()
+ }
+
+ // Param is passed by value, moved
+ pub fn set_proof(&mut self, v: ::std::vec::Vec<u8>) {
+ self.proof = ::std::option::Option::Some(v);
+ }
+
+ // Mutable pointer to the field.
+ // If field is not initialized, it is initialized with default value first.
+ pub fn mut_proof(&mut self) -> &mut ::std::vec::Vec<u8> {
+ if self.proof.is_none() {
+ self.proof = ::std::option::Option::Some(::std::vec::Vec::new());
+ }
+ self.proof.as_mut().unwrap()
+ }
+
+ // Take field
+ pub fn take_proof(&mut self) -> ::std::vec::Vec<u8> {
+ self.proof.take().unwrap_or_else(|| ::std::vec::Vec::new())
+ }
+
+ // required sint64 root_packet_timestamp = 3;
+
+ pub fn root_packet_timestamp(&self) -> i64 {
+ self.root_packet_timestamp.unwrap_or(0)
+ }
+
+ pub fn clear_root_packet_timestamp(&mut self) {
+ self.root_packet_timestamp = ::std::option::Option::None;
+ }
+
+ pub fn has_root_packet_timestamp(&self) -> bool {
+ self.root_packet_timestamp.is_some()
+ }
+
+ // Param is passed by value, moved
+ pub fn set_root_packet_timestamp(&mut self, v: i64) {
+ self.root_packet_timestamp = ::std::option::Option::Some(v);
+ }
+
+ fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData {
+ let mut fields = ::std::vec::Vec::with_capacity(3);
+ let mut oneofs = ::std::vec::Vec::with_capacity(0);
+ fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
+ "header",
+ |m: &ExtAppHeaderAck| { &m.header },
+ |m: &mut ExtAppHeaderAck| { &mut m.header },
+ ));
+ fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
+ "proof",
+ |m: &ExtAppHeaderAck| { &m.proof },
+ |m: &mut ExtAppHeaderAck| { &mut m.proof },
+ ));
+ fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
+ "root_packet_timestamp",
+ |m: &ExtAppHeaderAck| { &m.root_packet_timestamp },
+ |m: &mut ExtAppHeaderAck| { &mut m.root_packet_timestamp },
+ ));
+ ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::<ExtAppHeaderAck>(
+ "ExtAppHeaderAck",
+ fields,
+ oneofs,
+ )
+ }
+}
+
+impl ::protobuf::Message for ExtAppHeaderAck {
+ const NAME: &'static str = "ExtAppHeaderAck";
+
+ fn is_initialized(&self) -> bool {
+ if self.header.is_none() {
+ return false;
+ }
+ if self.proof.is_none() {
+ return false;
+ }
+ if self.root_packet_timestamp.is_none() {
+ return false;
+ }
+ true
+ }
+
+ fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> {
+ while let Some(tag) = is.read_raw_tag_or_eof()? {
+ match tag {
+ 10 => {
+ self.header = ::std::option::Option::Some(is.read_bytes()?);
+ },
+ 18 => {
+ self.proof = ::std::option::Option::Some(is.read_bytes()?);
+ },
+ 24 => {
+ self.root_packet_timestamp = ::std::option::Option::Some(is.read_sint64()?);
+ },
+ tag => {
+ ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
+ },
+ };
+ }
+ ::std::result::Result::Ok(())
+ }
+
+ // Compute sizes of nested messages
+ #[allow(unused_variables)]
+ fn compute_size(&self) -> u64 {
+ let mut my_size = 0;
+ if let Some(v) = self.header.as_ref() {
+ my_size += ::protobuf::rt::bytes_size(1, &v);
+ }
+ if let Some(v) = self.proof.as_ref() {
+ my_size += ::protobuf::rt::bytes_size(2, &v);
+ }
+ if let Some(v) = self.root_packet_timestamp {
+ my_size += ::protobuf::rt::sint64_size(3, v);
+ }
+ my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
+ self.special_fields.cached_size().set(my_size as u32);
+ my_size
+ }
+
+ fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
+ if let Some(v) = self.header.as_ref() {
+ os.write_bytes(1, v)?;
+ }
+ if let Some(v) = self.proof.as_ref() {
+ os.write_bytes(2, v)?;
+ }
+ if let Some(v) = self.root_packet_timestamp {
+ os.write_sint64(3, v)?;
+ }
+ os.write_unknown_fields(self.special_fields.unknown_fields())?;
+ ::std::result::Result::Ok(())
+ }
+
+ fn special_fields(&self) -> &::protobuf::SpecialFields {
+ &self.special_fields
+ }
+
+ fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
+ &mut self.special_fields
+ }
+
+ fn new() -> ExtAppHeaderAck {
+ ExtAppHeaderAck::new()
+ }
+
+ fn clear(&mut self) {
+ self.header = ::std::option::Option::None;
+ self.proof = ::std::option::Option::None;
+ self.root_packet_timestamp = ::std::option::Option::None;
+ self.special_fields.clear();
+ }
+
+ fn default_instance() -> &'static ExtAppHeaderAck {
+ static instance: ExtAppHeaderAck = ExtAppHeaderAck {
+ header: ::std::option::Option::None,
+ proof: ::std::option::Option::None,
+ root_packet_timestamp: ::std::option::Option::None,
+ special_fields: ::protobuf::SpecialFields::new(),
+ };
+ &instance
+ }
+}
+
+impl ::protobuf::MessageFull for ExtAppHeaderAck {
+ fn descriptor() -> ::protobuf::reflect::MessageDescriptor {
+ static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new();
+ descriptor.get(|| file_descriptor().message_by_package_relative_name("ExtAppHeaderAck").unwrap()).clone()
+ }
+}
+
+impl ::std::fmt::Display for ExtAppHeaderAck {
+ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+ ::protobuf::text_format::fmt(self, f)
+ }
+}
+
+impl ::protobuf::reflect::ProtobufValue for ExtAppHeaderAck {
+ type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage<Self>;
+}
+
+// @@protoc_insertion_point(message:hw.trezor.messages.extapp.ExtAppRootPacketRequest)
+#[derive(PartialEq,Clone,Default,Debug)]
+pub struct ExtAppRootPacketRequest {
+ // message fields
+ // @@protoc_insertion_point(field:hw.trezor.messages.extapp.ExtAppRootPacketRequest.app_ring)
+ pub app_ring: ::std::option::Option<u32>,
+ // special fields
+ // @@protoc_insertion_point(special_field:hw.trezor.messages.extapp.ExtAppRootPacketRequest.special_fields)
+ pub special_fields: ::protobuf::SpecialFields,
+}
+
+impl<'a> ::std::default::Default for &'a ExtAppRootPacketRequest {
+ fn default() -> &'a ExtAppRootPacketRequest {
+ <ExtAppRootPacketRequest as ::protobuf::Message>::default_instance()
+ }
+}
+
+impl ExtAppRootPacketRequest {
+ pub fn new() -> ExtAppRootPacketRequest {
+ ::std::default::Default::default()
+ }
+
+ // required uint32 app_ring = 1;
+
+ pub fn app_ring(&self) -> u32 {
+ self.app_ring.unwrap_or(0)
+ }
+
+ pub fn clear_app_ring(&mut self) {
+ self.app_ring = ::std::option::Option::None;
+ }
+
+ pub fn has_app_ring(&self) -> bool {
+ self.app_ring.is_some()
+ }
+
+ // Param is passed by value, moved
+ pub fn set_app_ring(&mut self, v: u32) {
+ self.app_ring = ::std::option::Option::Some(v);
+ }
+
+ fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData {
+ let mut fields = ::std::vec::Vec::with_capacity(1);
+ let mut oneofs = ::std::vec::Vec::with_capacity(0);
+ fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
+ "app_ring",
+ |m: &ExtAppRootPacketRequest| { &m.app_ring },
+ |m: &mut ExtAppRootPacketRequest| { &mut m.app_ring },
+ ));
+ ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::<ExtAppRootPacketRequest>(
+ "ExtAppRootPacketRequest",
+ fields,
+ oneofs,
+ )
+ }
+}
+
+impl ::protobuf::Message for ExtAppRootPacketRequest {
+ const NAME: &'static str = "ExtAppRootPacketRequest";
+
+ fn is_initialized(&self) -> bool {
+ if self.app_ring.is_none() {
+ return false;
+ }
+ true
+ }
+
+ fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> {
+ while let Some(tag) = is.read_raw_tag_or_eof()? {
+ match tag {
+ 8 => {
+ self.app_ring = ::std::option::Option::Some(is.read_uint32()?);
+ },
+ tag => {
+ ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
+ },
+ };
+ }
+ ::std::result::Result::Ok(())
+ }
+
+ // Compute sizes of nested messages
+ #[allow(unused_variables)]
+ fn compute_size(&self) -> u64 {
+ let mut my_size = 0;
+ if let Some(v) = self.app_ring {
+ my_size += ::protobuf::rt::uint32_size(1, v);
+ }
+ my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
+ self.special_fields.cached_size().set(my_size as u32);
+ my_size
+ }
+
+ fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
+ if let Some(v) = self.app_ring {
+ os.write_uint32(1, v)?;
+ }
+ os.write_unknown_fields(self.special_fields.unknown_fields())?;
+ ::std::result::Result::Ok(())
+ }
+
+ fn special_fields(&self) -> &::protobuf::SpecialFields {
+ &self.special_fields
+ }
+
+ fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
+ &mut self.special_fields
+ }
+
+ fn new() -> ExtAppRootPacketRequest {
+ ExtAppRootPacketRequest::new()
+ }
+
+ fn clear(&mut self) {
+ self.app_ring = ::std::option::Option::None;
+ self.special_fields.clear();
+ }
+
+ fn default_instance() -> &'static ExtAppRootPacketRequest {
+ static instance: ExtAppRootPacketRequest = ExtAppRootPacketRequest {
+ app_ring: ::std::option::Option::None,
+ special_fields: ::protobuf::SpecialFields::new(),
+ };
+ &instance
+ }
+}
+
+impl ::protobuf::MessageFull for ExtAppRootPacketRequest {
+ fn descriptor() -> ::protobuf::reflect::MessageDescriptor {
+ static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new();
+ descriptor.get(|| file_descriptor().message_by_package_relative_name("ExtAppRootPacketRequest").unwrap()).clone()
+ }
+}
+
+impl ::std::fmt::Display for ExtAppRootPacketRequest {
+ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+ ::protobuf::text_format::fmt(self, f)
+ }
+}
+
+impl ::protobuf::reflect::ProtobufValue for ExtAppRootPacketRequest {
+ type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage<Self>;
+}
+
+// @@protoc_insertion_point(message:hw.trezor.messages.extapp.ExtAppRootPacketAck)
+#[derive(PartialEq,Clone,Default,Debug)]
+pub struct ExtAppRootPacketAck {
+ // message fields
+ // @@protoc_insertion_point(field:hw.trezor.messages.extapp.ExtAppRootPacketAck.root_packet)
+ pub root_packet: ::std::option::Option<::std::vec::Vec<u8>>,
+ // special fields
+ // @@protoc_insertion_point(special_field:hw.trezor.messages.extapp.ExtAppRootPacketAck.special_fields)
+ pub special_fields: ::protobuf::SpecialFields,
+}
+
+impl<'a> ::std::default::Default for &'a ExtAppRootPacketAck {
+ fn default() -> &'a ExtAppRootPacketAck {
+ <ExtAppRootPacketAck as ::protobuf::Message>::default_instance()
+ }
+}
+
+impl ExtAppRootPacketAck {
+ pub fn new() -> ExtAppRootPacketAck {
+ ::std::default::Default::default()
+ }
+
+ // required bytes root_packet = 1;
+
+ pub fn root_packet(&self) -> &[u8] {
+ match self.root_packet.as_ref() {
+ Some(v) => v,
+ None => &[],
+ }
+ }
+
+ pub fn clear_root_packet(&mut self) {
+ self.root_packet = ::std::option::Option::None;
+ }
+
+ pub fn has_root_packet(&self) -> bool {
+ self.root_packet.is_some()
+ }
+
+ // Param is passed by value, moved
+ pub fn set_root_packet(&mut self, v: ::std::vec::Vec<u8>) {
+ self.root_packet = ::std::option::Option::Some(v);
+ }
+
+ // Mutable pointer to the field.
+ // If field is not initialized, it is initialized with default value first.
+ pub fn mut_root_packet(&mut self) -> &mut ::std::vec::Vec<u8> {
+ if self.root_packet.is_none() {
+ self.root_packet = ::std::option::Option::Some(::std::vec::Vec::new());
+ }
+ self.root_packet.as_mut().unwrap()
+ }
+
+ // Take field
+ pub fn take_root_packet(&mut self) -> ::std::vec::Vec<u8> {
+ self.root_packet.take().unwrap_or_else(|| ::std::vec::Vec::new())
+ }
+
+ fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData {
+ let mut fields = ::std::vec::Vec::with_capacity(1);
+ let mut oneofs = ::std::vec::Vec::with_capacity(0);
+ fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
+ "root_packet",
+ |m: &ExtAppRootPacketAck| { &m.root_packet },
+ |m: &mut ExtAppRootPacketAck| { &mut m.root_packet },
+ ));
+ ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::<ExtAppRootPacketAck>(
+ "ExtAppRootPacketAck",
+ fields,
+ oneofs,
+ )
+ }
+}
+
+impl ::protobuf::Message for ExtAppRootPacketAck {
+ const NAME: &'static str = "ExtAppRootPacketAck";
+
+ fn is_initialized(&self) -> bool {
+ if self.root_packet.is_none() {
+ return false;
+ }
+ true
+ }
+
+ fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> {
+ while let Some(tag) = is.read_raw_tag_or_eof()? {
+ match tag {
+ 10 => {
+ self.root_packet = ::std::option::Option::Some(is.read_bytes()?);
+ },
+ tag => {
+ ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
+ },
+ };
+ }
+ ::std::result::Result::Ok(())
+ }
+
+ // Compute sizes of nested messages
+ #[allow(unused_variables)]
+ fn compute_size(&self) -> u64 {
+ let mut my_size = 0;
+ if let Some(v) = self.root_packet.as_ref() {
+ my_size += ::protobuf::rt::bytes_size(1, &v);
+ }
+ my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
+ self.special_fields.cached_size().set(my_size as u32);
+ my_size
+ }
+
+ fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
+ if let Some(v) = self.root_packet.as_ref() {
+ os.write_bytes(1, v)?;
+ }
+ os.write_unknown_fields(self.special_fields.unknown_fields())?;
+ ::std::result::Result::Ok(())
+ }
+
+ fn special_fields(&self) -> &::protobuf::SpecialFields {
+ &self.special_fields
+ }
+
+ fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
+ &mut self.special_fields
+ }
+
+ fn new() -> ExtAppRootPacketAck {
+ ExtAppRootPacketAck::new()
+ }
+
+ fn clear(&mut self) {
+ self.root_packet = ::std::option::Option::None;
+ self.special_fields.clear();
+ }
+
+ fn default_instance() -> &'static ExtAppRootPacketAck {
+ static instance: ExtAppRootPacketAck = ExtAppRootPacketAck {
+ root_packet: ::std::option::Option::None,
+ special_fields: ::protobuf::SpecialFields::new(),
+ };
+ &instance
+ }
+}
+
+impl ::protobuf::MessageFull for ExtAppRootPacketAck {
+ fn descriptor() -> ::protobuf::reflect::MessageDescriptor {
+ static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new();
+ descriptor.get(|| file_descriptor().message_by_package_relative_name("ExtAppRootPacketAck").unwrap()).clone()
+ }
+}
+
+impl ::std::fmt::Display for ExtAppRootPacketAck {
+ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+ ::protobuf::text_format::fmt(self, f)
+ }
+}
+
+impl ::protobuf::reflect::ProtobufValue for ExtAppRootPacketAck {
+ type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage<Self>;
+}
+
+// @@protoc_insertion_point(message:hw.trezor.messages.extapp.ExtAppDataChunkRequest)
+#[derive(PartialEq,Clone,Default,Debug)]
+pub struct ExtAppDataChunkRequest {
+ // message fields
+ // @@protoc_insertion_point(field:hw.trezor.messages.extapp.ExtAppDataChunkRequest.index)
+ pub index: ::std::option::Option<u32>,
+ // special fields
+ // @@protoc_insertion_point(special_field:hw.trezor.messages.extapp.ExtAppDataChunkRequest.special_fields)
+ pub special_fields: ::protobuf::SpecialFields,
+}
+
+impl<'a> ::std::default::Default for &'a ExtAppDataChunkRequest {
+ fn default() -> &'a ExtAppDataChunkRequest {
+ <ExtAppDataChunkRequest as ::protobuf::Message>::default_instance()
+ }
+}
+
+impl ExtAppDataChunkRequest {
+ pub fn new() -> ExtAppDataChunkRequest {
+ ::std::default::Default::default()
+ }
+
+ // required uint32 index = 1;
+
+ pub fn index(&self) -> u32 {
+ self.index.unwrap_or(0)
+ }
+
+ 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);
+ }
+
+ fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData {
+ let mut fields = ::std::vec::Vec::with_capacity(1);
+ let mut oneofs = ::std::vec::Vec::with_capacity(0);
+ fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
+ "index",
+ |m: &ExtAppDataChunkRequest| { &m.index },
+ |m: &mut ExtAppDataChunkRequest| { &mut m.index },
+ ));
+ ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::<ExtAppDataChunkRequest>(
+ "ExtAppDataChunkRequest",
+ fields,
+ oneofs,
+ )
+ }
+}
+
+impl ::protobuf::Message for ExtAppDataChunkRequest {
+ const NAME: &'static str = "ExtAppDataChunkRequest";
+
+ fn is_initialized(&self) -> bool {
+ if self.index.is_none() {
+ return false;
+ }
+ true
+ }
+
+ fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> {
+ while let Some(tag) = is.read_raw_tag_or_eof()? {
+ match tag {
+ 8 => {
+ self.index = ::std::option::Option::Some(is.read_uint32()?);
+ },
+ tag => {
+ ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
+ },
+ };
+ }
+ ::std::result::Result::Ok(())
+ }
+
+ // Compute sizes of nested messages
+ #[allow(unused_variables)]
+ fn compute_size(&self) -> u64 {
+ let mut my_size = 0;
+ if let Some(v) = self.index {
+ my_size += ::protobuf::rt::uint32_size(1, v);
+ }
+ my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
+ self.special_fields.cached_size().set(my_size as u32);
+ my_size
+ }
+
+ fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
+ if let Some(v) = self.index {
+ os.write_uint32(1, v)?;
+ }
+ os.write_unknown_fields(self.special_fields.unknown_fields())?;
+ ::std::result::Result::Ok(())
+ }
+
+ fn special_fields(&self) -> &::protobuf::SpecialFields {
+ &self.special_fields
+ }
+
+ fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
+ &mut self.special_fields
+ }
+
+ fn new() -> ExtAppDataChunkRequest {
+ ExtAppDataChunkRequest::new()
+ }
+
+ fn clear(&mut self) {
+ self.index = ::std::option::Option::None;
+ self.special_fields.clear();
+ }
+
+ fn default_instance() -> &'static ExtAppDataChunkRequest {
+ static instance: ExtAppDataChunkRequest = ExtAppDataChunkRequest {
+ index: ::std::option::Option::None,
+ special_fields: ::protobuf::SpecialFields::new(),
+ };
+ &instance
+ }
+}
+
+impl ::protobuf::MessageFull for ExtAppDataChunkRequest {
+ fn descriptor() -> ::protobuf::reflect::MessageDescriptor {
+ static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new();
+ descriptor.get(|| file_descriptor().message_by_package_relative_name("ExtAppDataChunkRequest").unwrap()).clone()
+ }
+}
+
+impl ::std::fmt::Display for ExtAppDataChunkRequest {
+ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+ ::protobuf::text_format::fmt(self, f)
+ }
+}
+
+impl ::protobuf::reflect::ProtobufValue for ExtAppDataChunkRequest {
+ type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage<Self>;
+}
+
+// @@protoc_insertion_point(message:hw.trezor.messages.extapp.ExtAppDataChunkAck)
+#[derive(PartialEq,Clone,Default,Debug)]
+pub struct ExtAppDataChunkAck {
+ // message fields
+ // @@protoc_insertion_point(field:hw.trezor.messages.extapp.ExtAppDataChunkAck.data)
+ pub data: ::std::option::Option<::std::vec::Vec<u8>>,
+ // @@protoc_insertion_point(field:hw.trezor.messages.extapp.ExtAppDataChunkAck.hash)
+ pub hash: ::std::option::Option<::std::vec::Vec<u8>>,
+ // special fields
+ // @@protoc_insertion_point(special_field:hw.trezor.messages.extapp.ExtAppDataChunkAck.special_fields)
+ pub special_fields: ::protobuf::SpecialFields,
+}
+
+impl<'a> ::std::default::Default for &'a ExtAppDataChunkAck {
+ fn default() -> &'a ExtAppDataChunkAck {
+ <ExtAppDataChunkAck as ::protobuf::Message>::default_instance()
+ }
+}
+
+impl ExtAppDataChunkAck {
+ pub fn new() -> ExtAppDataChunkAck {
+ ::std::default::Default::default()
+ }
+
+ // required bytes data = 1;
+
+ pub fn data(&self) -> &[u8] {
+ match self.data.as_ref() {
+ Some(v) => v,
+ None => &[],
+ }
+ }
+
+ pub fn clear_data(&mut self) {
+ self.data = ::std::option::Option::None;
+ }
+
+ 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<u8>) {
+ self.data = ::std::option::Option::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<u8> {
+ if self.data.is_none() {
+ self.data = ::std::option::Option::Some(::std::vec::Vec::new());
+ }
+ self.data.as_mut().unwrap()
+ }
+
+ // Take field
+ pub fn take_data(&mut self) -> ::std::vec::Vec<u8> {
+ self.data.take().unwrap_or_else(|| ::std::vec::Vec::new())
+ }
+
+ // required bytes hash = 2;
+
+ pub fn hash(&self) -> &[u8] {
+ match self.hash.as_ref() {
+ Some(v) => v,
+ None => &[],
+ }
+ }
+
+ pub fn clear_hash(&mut self) {
+ self.hash = ::std::option::Option::None;
+ }
+
+ 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<u8>) {
+ self.hash = ::std::option::Option::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<u8> {
+ if self.hash.is_none() {
+ self.hash = ::std::option::Option::Some(::std::vec::Vec::new());
+ }
+ self.hash.as_mut().unwrap()
+ }
+
+ // Take field
+ pub fn take_hash(&mut self) -> ::std::vec::Vec<u8> {
+ self.hash.take().unwrap_or_else(|| ::std::vec::Vec::new())
+ }
+
+ fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData {
+ let mut fields = ::std::vec::Vec::with_capacity(2);
+ let mut oneofs = ::std::vec::Vec::with_capacity(0);
+ fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
+ "data",
+ |m: &ExtAppDataChunkAck| { &m.data },
+ |m: &mut ExtAppDataChunkAck| { &mut m.data },
+ ));
+ fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
+ "hash",
+ |m: &ExtAppDataChunkAck| { &m.hash },
+ |m: &mut ExtAppDataChunkAck| { &mut m.hash },
+ ));
+ ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::<ExtAppDataChunkAck>(
+ "ExtAppDataChunkAck",
+ fields,
+ oneofs,
+ )
+ }
+}
+
+impl ::protobuf::Message for ExtAppDataChunkAck {
+ const NAME: &'static str = "ExtAppDataChunkAck";
+
+ fn is_initialized(&self) -> bool {
+ if self.data.is_none() {
+ return false;
+ }
+ if self.hash.is_none() {
+ return false;
+ }
+ true
+ }
+
+ fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> {
+ while let Some(tag) = is.read_raw_tag_or_eof()? {
+ match tag {
+ 10 => {
+ self.data = ::std::option::Option::Some(is.read_bytes()?);
+ },
+ 18 => {
+ self.hash = ::std::option::Option::Some(is.read_bytes()?);
+ },
+ tag => {
+ ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
+ },
+ };
+ }
+ ::std::result::Result::Ok(())
+ }
+
+ // Compute sizes of nested messages
+ #[allow(unused_variables)]
+ fn compute_size(&self) -> u64 {
+ let mut my_size = 0;
+ if let Some(v) = self.data.as_ref() {
+ my_size += ::protobuf::rt::bytes_size(1, &v);
+ }
+ if let Some(v) = self.hash.as_ref() {
+ my_size += ::protobuf::rt::bytes_size(2, &v);
+ }
+ my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
+ self.special_fields.cached_size().set(my_size as u32);
+ my_size
+ }
+
+ fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
+ if let Some(v) = self.data.as_ref() {
+ os.write_bytes(1, v)?;
+ }
+ if let Some(v) = self.hash.as_ref() {
+ os.write_bytes(2, v)?;
+ }
+ os.write_unknown_fields(self.special_fields.unknown_fields())?;
+ ::std::result::Result::Ok(())
+ }
+
+ fn special_fields(&self) -> &::protobuf::SpecialFields {
+ &self.special_fields
+ }
+
+ fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
+ &mut self.special_fields
+ }
+
+ fn new() -> ExtAppDataChunkAck {
+ ExtAppDataChunkAck::new()
+ }
+
+ fn clear(&mut self) {
+ self.data = ::std::option::Option::None;
+ self.hash = ::std::option::Option::None;
+ self.special_fields.clear();
+ }
+
+ fn default_instance() -> &'static ExtAppDataChunkAck {
+ static instance: ExtAppDataChunkAck = ExtAppDataChunkAck {
+ data: ::std::option::Option::None,
+ hash: ::std::option::Option::None,
+ special_fields: ::protobuf::SpecialFields::new(),
+ };
+ &instance
+ }
+}
+
+impl ::protobuf::MessageFull for ExtAppDataChunkAck {
+ fn descriptor() -> ::protobuf::reflect::MessageDescriptor {
+ static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new();
+ descriptor.get(|| file_descriptor().message_by_package_relative_name("ExtAppDataChunkAck").unwrap()).clone()
+ }
+}
+
+impl ::std::fmt::Display for ExtAppDataChunkAck {
+ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+ ::protobuf::text_format::fmt(self, f)
+ }
+}
+
+impl ::protobuf::reflect::ProtobufValue for ExtAppDataChunkAck {
+ type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage<Self>;
+}
+
+// @@protoc_insertion_point(message:hw.trezor.messages.extapp.ExtAppMessage)
+#[derive(PartialEq,Clone,Default,Debug)]
+pub struct ExtAppMessage {
+ // message fields
+ // @@protoc_insertion_point(field:hw.trezor.messages.extapp.ExtAppMessage.instance_id)
+ pub instance_id: ::std::option::Option<u32>,
+ // @@protoc_insertion_point(field:hw.trezor.messages.extapp.ExtAppMessage.message_id)
+ pub message_id: ::std::option::Option<u32>,
+ // @@protoc_insertion_point(field:hw.trezor.messages.extapp.ExtAppMessage.data)
+ pub data: ::std::option::Option<::std::vec::Vec<u8>>,
+ // special fields
+ // @@protoc_insertion_point(special_field:hw.trezor.messages.extapp.ExtAppMessage.special_fields)
+ pub special_fields: ::protobuf::SpecialFields,
+}
+
+impl<'a> ::std::default::Default for &'a ExtAppMessage {
+ fn default() -> &'a ExtAppMessage {
+ <ExtAppMessage as ::protobuf::Message>::default_instance()
+ }
+}
+
+impl ExtAppMessage {
+ pub fn new() -> ExtAppMessage {
+ ::std::default::Default::default()
+ }
+
+ // required uint32 instance_id = 1;
+
+ pub fn instance_id(&self) -> u32 {
+ self.instance_id.unwrap_or(0)
+ }
+
+ pub fn clear_instance_id(&mut self) {
+ self.instance_id = ::std::option::Option::None;
+ }
+
+ pub fn has_instance_id(&self) -> bool {
+ self.instance_id.is_some()
+ }
+
+ // Param is passed by value, moved
+ pub fn set_instance_id(&mut self, v: u32) {
+ self.instance_id = ::std::option::Option::Some(v);
+ }
+
+ // required uint32 message_id = 2;
+
+ pub fn message_id(&self) -> u32 {
+ self.message_id.unwrap_or(0)
+ }
+
+ pub fn clear_message_id(&mut self) {
+ self.message_id = ::std::option::Option::None;
+ }
+
+ pub fn has_message_id(&self) -> bool {
+ self.message_id.is_some()
+ }
+
+ // Param is passed by value, moved
+ pub fn set_message_id(&mut self, v: u32) {
+ self.message_id = ::std::option::Option::Some(v);
+ }
+
+ // required bytes data = 3;
+
+ pub fn data(&self) -> &[u8] {
+ match self.data.as_ref() {
+ Some(v) => v,
+ None => &[],
+ }
+ }
+
+ pub fn clear_data(&mut self) {
+ self.data = ::std::option::Option::None;
+ }
+
+ 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<u8>) {
+ self.data = ::std::option::Option::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<u8> {
+ if self.data.is_none() {
+ self.data = ::std::option::Option::Some(::std::vec::Vec::new());
+ }
+ self.data.as_mut().unwrap()
+ }
+
+ // Take field
+ pub fn take_data(&mut self) -> ::std::vec::Vec<u8> {
+ self.data.take().unwrap_or_else(|| ::std::vec::Vec::new())
+ }
+
+ fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData {
+ let mut fields = ::std::vec::Vec::with_capacity(3);
+ let mut oneofs = ::std::vec::Vec::with_capacity(0);
+ fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
+ "instance_id",
+ |m: &ExtAppMessage| { &m.instance_id },
+ |m: &mut ExtAppMessage| { &mut m.instance_id },
+ ));
+ fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
+ "message_id",
+ |m: &ExtAppMessage| { &m.message_id },
+ |m: &mut ExtAppMessage| { &mut m.message_id },
+ ));
+ fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
+ "data",
+ |m: &ExtAppMessage| { &m.data },
+ |m: &mut ExtAppMessage| { &mut m.data },
+ ));
+ ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::<ExtAppMessage>(
+ "ExtAppMessage",
+ fields,
+ oneofs,
+ )
+ }
+}
+
+impl ::protobuf::Message for ExtAppMessage {
+ const NAME: &'static str = "ExtAppMessage";
+
+ fn is_initialized(&self) -> bool {
+ if self.instance_id.is_none() {
+ return false;
+ }
+ if self.message_id.is_none() {
+ return false;
+ }
+ if self.data.is_none() {
+ return false;
+ }
+ true
+ }
+
+ fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> {
+ while let Some(tag) = is.read_raw_tag_or_eof()? {
+ match tag {
+ 8 => {
+ self.instance_id = ::std::option::Option::Some(is.read_uint32()?);
+ },
+ 16 => {
+ self.message_id = ::std::option::Option::Some(is.read_uint32()?);
+ },
+ 26 => {
+ self.data = ::std::option::Option::Some(is.read_bytes()?);
+ },
+ tag => {
+ ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
+ },
+ };
+ }
+ ::std::result::Result::Ok(())
+ }
+
+ // Compute sizes of nested messages
+ #[allow(unused_variables)]
+ fn compute_size(&self) -> u64 {
+ let mut my_size = 0;
+ if let Some(v) = self.instance_id {
+ my_size += ::protobuf::rt::uint32_size(1, v);
+ }
+ if let Some(v) = self.message_id {
+ my_size += ::protobuf::rt::uint32_size(2, v);
+ }
+ if let Some(v) = self.data.as_ref() {
+ my_size += ::protobuf::rt::bytes_size(3, &v);
+ }
+ my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
+ self.special_fields.cached_size().set(my_size as u32);
+ my_size
+ }
+
+ fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
+ if let Some(v) = self.instance_id {
+ os.write_uint32(1, v)?;
+ }
+ if let Some(v) = self.message_id {
+ os.write_uint32(2, v)?;
+ }
+ if let Some(v) = self.data.as_ref() {
+ os.write_bytes(3, v)?;
+ }
+ os.write_unknown_fields(self.special_fields.unknown_fields())?;
+ ::std::result::Result::Ok(())
+ }
+
+ fn special_fields(&self) -> &::protobuf::SpecialFields {
+ &self.special_fields
+ }
+
+ fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
+ &mut self.special_fields
+ }
+
+ fn new() -> ExtAppMessage {
+ ExtAppMessage::new()
+ }
+
+ fn clear(&mut self) {
+ self.instance_id = ::std::option::Option::None;
+ self.message_id = ::std::option::Option::None;
+ self.data = ::std::option::Option::None;
+ self.special_fields.clear();
+ }
+
+ fn default_instance() -> &'static ExtAppMessage {
+ static instance: ExtAppMessage = ExtAppMessage {
+ instance_id: ::std::option::Option::None,
+ message_id: ::std::option::Option::None,
+ data: ::std::option::Option::None,
+ special_fields: ::protobuf::SpecialFields::new(),
+ };
+ &instance
+ }
+}
+
+impl ::protobuf::MessageFull for ExtAppMessage {
+ fn descriptor() -> ::protobuf::reflect::MessageDescriptor {
+ static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new();
+ descriptor.get(|| file_descriptor().message_by_package_relative_name("ExtAppMessage").unwrap()).clone()
+ }
+}
+
+impl ::std::fmt::Display for ExtAppMessage {
+ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+ ::protobuf::text_format::fmt(self, f)
+ }
+}
+
+impl ::protobuf::reflect::ProtobufValue for ExtAppMessage {
+ type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage<Self>;
+}
+
+// @@protoc_insertion_point(message:hw.trezor.messages.extapp.ExtAppResponse)
+#[derive(PartialEq,Clone,Default,Debug)]
+pub struct ExtAppResponse {
+ // message fields
+ // @@protoc_insertion_point(field:hw.trezor.messages.extapp.ExtAppResponse.message_id)
+ pub message_id: ::std::option::Option<u32>,
+ // @@protoc_insertion_point(field:hw.trezor.messages.extapp.ExtAppResponse.data)
+ pub data: ::std::option::Option<::std::vec::Vec<u8>>,
+ // @@protoc_insertion_point(field:hw.trezor.messages.extapp.ExtAppResponse.finished)
+ pub finished: ::std::option::Option<bool>,
+ // special fields
+ // @@protoc_insertion_point(special_field:hw.trezor.messages.extapp.ExtAppResponse.special_fields)
+ pub special_fields: ::protobuf::SpecialFields,
+}
+
+impl<'a> ::std::default::Default for &'a ExtAppResponse {
+ fn default() -> &'a ExtAppResponse {
+ <ExtAppResponse as ::protobuf::Message>::default_instance()
+ }
+}
+
+impl ExtAppResponse {
+ pub fn new() -> ExtAppResponse {
+ ::std::default::Default::default()
+ }
+
+ // required uint32 message_id = 1;
+
+ pub fn message_id(&self) -> u32 {
+ self.message_id.unwrap_or(0)
+ }
+
+ pub fn clear_message_id(&mut self) {
+ self.message_id = ::std::option::Option::None;
+ }
+
+ pub fn has_message_id(&self) -> bool {
+ self.message_id.is_some()
+ }
+
+ // Param is passed by value, moved
+ pub fn set_message_id(&mut self, v: u32) {
+ self.message_id = ::std::option::Option::Some(v);
+ }
+
+ // required bytes data = 2;
+
+ pub fn data(&self) -> &[u8] {
+ match self.data.as_ref() {
+ Some(v) => v,
+ None => &[],
+ }
+ }
+
+ pub fn clear_data(&mut self) {
+ self.data = ::std::option::Option::None;
+ }
+
+ 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<u8>) {
+ self.data = ::std::option::Option::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<u8> {
+ if self.data.is_none() {
+ self.data = ::std::option::Option::Some(::std::vec::Vec::new());
+ }
+ self.data.as_mut().unwrap()
+ }
+
+ // Take field
+ pub fn take_data(&mut self) -> ::std::vec::Vec<u8> {
+ self.data.take().unwrap_or_else(|| ::std::vec::Vec::new())
+ }
+
+ // optional bool finished = 3;
+
+ pub fn finished(&self) -> bool {
+ self.finished.unwrap_or(false)
+ }
+
+ pub fn clear_finished(&mut self) {
+ self.finished = ::std::option::Option::None;
+ }
+
+ pub fn has_finished(&self) -> bool {
+ self.finished.is_some()
+ }
+
+ // Param is passed by value, moved
+ pub fn set_finished(&mut self, v: bool) {
+ self.finished = ::std::option::Option::Some(v);
+ }
+
+ fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData {
+ let mut fields = ::std::vec::Vec::with_capacity(3);
+ let mut oneofs = ::std::vec::Vec::with_capacity(0);
+ fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
+ "message_id",
+ |m: &ExtAppResponse| { &m.message_id },
+ |m: &mut ExtAppResponse| { &mut m.message_id },
+ ));
+ fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
+ "data",
+ |m: &ExtAppResponse| { &m.data },
+ |m: &mut ExtAppResponse| { &mut m.data },
+ ));
+ fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
+ "finished",
+ |m: &ExtAppResponse| { &m.finished },
+ |m: &mut ExtAppResponse| { &mut m.finished },
+ ));
+ ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::<ExtAppResponse>(
+ "ExtAppResponse",
+ fields,
+ oneofs,
+ )
+ }
+}
+
+impl ::protobuf::Message for ExtAppResponse {
+ const NAME: &'static str = "ExtAppResponse";
+
+ fn is_initialized(&self) -> bool {
+ if self.message_id.is_none() {
+ return false;
+ }
+ if self.data.is_none() {
+ return false;
+ }
+ true
+ }
+
+ fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> {
+ while let Some(tag) = is.read_raw_tag_or_eof()? {
+ match tag {
+ 8 => {
+ self.message_id = ::std::option::Option::Some(is.read_uint32()?);
+ },
+ 18 => {
+ self.data = ::std::option::Option::Some(is.read_bytes()?);
+ },
+ 24 => {
+ self.finished = ::std::option::Option::Some(is.read_bool()?);
+ },
+ tag => {
+ ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
+ },
+ };
+ }
+ ::std::result::Result::Ok(())
+ }
+
+ // Compute sizes of nested messages
+ #[allow(unused_variables)]
+ fn compute_size(&self) -> u64 {
+ let mut my_size = 0;
+ if let Some(v) = self.message_id {
+ my_size += ::protobuf::rt::uint32_size(1, v);
+ }
+ if let Some(v) = self.data.as_ref() {
+ my_size += ::protobuf::rt::bytes_size(2, &v);
+ }
+ if let Some(v) = self.finished {
+ my_size += 1 + 1;
+ }
+ my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
+ self.special_fields.cached_size().set(my_size as u32);
+ my_size
+ }
+
+ fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
+ if let Some(v) = self.message_id {
+ os.write_uint32(1, v)?;
+ }
+ if let Some(v) = self.data.as_ref() {
+ os.write_bytes(2, v)?;
+ }
+ if let Some(v) = self.finished {
+ os.write_bool(3, v)?;
+ }
+ os.write_unknown_fields(self.special_fields.unknown_fields())?;
+ ::std::result::Result::Ok(())
+ }
+
+ fn special_fields(&self) -> &::protobuf::SpecialFields {
+ &self.special_fields
+ }
+
+ fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
+ &mut self.special_fields
+ }
+
+ fn new() -> ExtAppResponse {
+ ExtAppResponse::new()
+ }
+
+ fn clear(&mut self) {
+ self.message_id = ::std::option::Option::None;
+ self.data = ::std::option::Option::None;
+ self.finished = ::std::option::Option::None;
+ self.special_fields.clear();
+ }
+
+ fn default_instance() -> &'static ExtAppResponse {
+ static instance: ExtAppResponse = ExtAppResponse {
+ message_id: ::std::option::Option::None,
+ data: ::std::option::Option::None,
+ finished: ::std::option::Option::None,
+ special_fields: ::protobuf::SpecialFields::new(),
+ };
+ &instance
+ }
+}
+
+impl ::protobuf::MessageFull for ExtAppResponse {
+ fn descriptor() -> ::protobuf::reflect::MessageDescriptor {
+ static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new();
+ descriptor.get(|| file_descriptor().message_by_package_relative_name("ExtAppResponse").unwrap()).clone()
+ }
+}
+
+impl ::std::fmt::Display for ExtAppResponse {
+ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+ ::protobuf::text_format::fmt(self, f)
+ }
+}
+
+impl ::protobuf::reflect::ProtobufValue for ExtAppResponse {
+ type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage<Self>;
+}
+
+static file_descriptor_proto_data: &'static [u8] = b"\
+ \n\x15messages-extapp.proto\x12\x19hw.trezor.messages.extapp\x1a\x15mess\
+ ages-common.proto\"|\n\nExtAppLoad\x12\x0e\n\x02id\x18\x01\x20\x02(\tR\
+ \x02id\x12<\n\x07version\x18\x02\x20\x02(\x0b2\".hw.trezor.messages.comm\
+ on.VersionR\x07version\x12\x20\n\x0bfingerprint\x18\x03\x20\x01(\x0cR\
+ \x0bfingerprint\"m\n\x0cExtAppLoaded\x12\x1f\n\x0binstance_id\x18\x01\
+ \x20\x02(\rR\ninstanceId\x12<\n\x07version\x18\x02\x20\x02(\x0b2\".hw.tr\
+ ezor.messages.common.VersionR\x07version\"\x15\n\x13ExtAppHeaderRequest\
+ \"s\n\x0fExtAppHeaderAck\x12\x16\n\x06header\x18\x01\x20\x02(\x0cR\x06he\
+ ader\x12\x14\n\x05proof\x18\x02\x20\x02(\x0cR\x05proof\x122\n\x15root_pa\
+ cket_timestamp\x18\x03\x20\x02(\x12R\x13rootPacketTimestamp\"4\n\x17ExtA\
+ ppRootPacketRequest\x12\x19\n\x08app_ring\x18\x01\x20\x02(\rR\x07appRing\
+ \"6\n\x13ExtAppRootPacketAck\x12\x1f\n\x0broot_packet\x18\x01\x20\x02(\
+ \x0cR\nrootPacket\".\n\x16ExtAppDataChunkRequest\x12\x14\n\x05index\x18\
+ \x01\x20\x02(\rR\x05index\"<\n\x12ExtAppDataChunkAck\x12\x12\n\x04data\
+ \x18\x01\x20\x02(\x0cR\x04data\x12\x12\n\x04hash\x18\x02\x20\x02(\x0cR\
+ \x04hash\"c\n\rExtAppMessage\x12\x1f\n\x0binstance_id\x18\x01\x20\x02(\r\
+ R\ninstanceId\x12\x1d\n\nmessage_id\x18\x02\x20\x02(\rR\tmessageId\x12\
+ \x12\n\x04data\x18\x03\x20\x02(\x0cR\x04data\"f\n\x0eExtAppResponse\x12\
+ \x1d\n\nmessage_id\x18\x01\x20\x02(\rR\tmessageId\x12\x12\n\x04data\x18\
+ \x02\x20\x02(\x0cR\x04data\x12!\n\x08finished\x18\x03\x20\x01(\x08:\x05f\
+ alseR\x08finishedB4\n#com.satoshilabs.trezor.lib.protobufB\rMessageExtAp\
+ p\
+";
+
+/// `FileDescriptorProto` object which was a source for this generated file
+fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
+ static file_descriptor_proto_lazy: ::protobuf::rt::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::Lazy::new();
+ file_descriptor_proto_lazy.get(|| {
+ ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap()
+ })
+}
+
+/// `FileDescriptor` object which allows dynamic access to files
+pub fn file_descriptor() -> &'static ::protobuf::reflect::FileDescriptor {
+ static generated_file_descriptor_lazy: ::protobuf::rt::Lazy<::protobuf::reflect::GeneratedFileDescriptor> = ::protobuf::rt::Lazy::new();
+ static file_descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::FileDescriptor> = ::protobuf::rt::Lazy::new();
+ file_descriptor.get(|| {
+ let generated_file_descriptor = generated_file_descriptor_lazy.get(|| {
+ let mut deps = ::std::vec::Vec::with_capacity(1);
+ deps.push(super::messages_common::file_descriptor().clone());
+ let mut messages = ::std::vec::Vec::with_capacity(10);
+ messages.push(ExtAppLoad::generated_message_descriptor_data());
+ messages.push(ExtAppLoaded::generated_message_descriptor_data());
+ messages.push(ExtAppHeaderRequest::generated_message_descriptor_data());
+ messages.push(ExtAppHeaderAck::generated_message_descriptor_data());
+ messages.push(ExtAppRootPacketRequest::generated_message_descriptor_data());
+ messages.push(ExtAppRootPacketAck::generated_message_descriptor_data());
+ messages.push(ExtAppDataChunkRequest::generated_message_descriptor_data());
+ messages.push(ExtAppDataChunkAck::generated_message_descriptor_data());
+ messages.push(ExtAppMessage::generated_message_descriptor_data());
+ messages.push(ExtAppResponse::generated_message_descriptor_data());
+ let mut enums = ::std::vec::Vec::with_capacity(0);
+ ::protobuf::reflect::GeneratedFileDescriptor::new_generated(
+ file_descriptor_proto(),
+ deps,
+ messages,
+ enums,
+ )
+ });
+ ::protobuf::reflect::FileDescriptor::new_generated_2(generated_file_descriptor)
+ })
+}
### rust/trezor-client/src/protos/mod.rs
@@ -26,6 +26,7 @@ mod generated {
messages_benchmark
messages_thp
messages_telemetry
+ messages_extapp
options
"bitcoin" => messages_bitcoinWhy this scored 41/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.