1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-07-09 16:18:10 +00:00
trezor-firmware/core/src/apps/monero/xmr/serialize_messages/tx_rsig_bulletproof.py
Dusan Klinec 33c174491f refactor(core/monero): Monero code cleanup
* remove support for HF12 and below
* remove MLSAG support
* clean up monero cryptography naming
* get rid of "optional first argument" pattern, in favor of mandatory argument that is allowed to be None
  (and fix several bugs related to this feature)

Co-authored-by: grdddj <jiri.musil06@seznam.cz>
Co-authored-by: Martin Milata <martin@martinmilata.cz>
Co-authored-by: matejcik <ja@matejcik.cz>
2022-05-16 12:37:24 +02:00

34 lines
844 B
Python

from micropython import const
from typing import TYPE_CHECKING
from apps.monero.xmr.serialize.message_types import ContainerType, MessageType
from apps.monero.xmr.serialize_messages.base import ECKey
if TYPE_CHECKING:
from ..serialize.base_types import XmrType
class _KeyV(ContainerType):
FIX_SIZE = const(0)
ELEM_TYPE: XmrType[bytes] = ECKey
class Bulletproof(MessageType):
__slots__ = ("A", "S", "T1", "T2", "taux", "mu", "L", "R", "a", "b", "t", "V")
@classmethod
def f_specs(cls) -> tuple:
return (
("A", ECKey),
("S", ECKey),
("T1", ECKey),
("T2", ECKey),
("taux", ECKey),
("mu", ECKey),
("L", _KeyV),
("R", _KeyV),
("a", ECKey),
("b", ECKey),
("t", ECKey),
)