Beispiel #1
0
def get_backup_type() -> EnumTypeBackupType:
    backup_type = common.get_uint8(_NAMESPACE, _BACKUP_TYPE)
    if backup_type is None:
        backup_type = _DEFAULT_BACKUP_TYPE

    if backup_type not in (
            BackupType.Bip39,
            BackupType.Slip39_Basic,
            BackupType.Slip39_Advanced,
    ):
        # Invalid backup type
        raise RuntimeError
    return backup_type
Beispiel #2
0
def get_slip39_iteration_exponent() -> Optional[int]:
    """
    The device's actual SLIP-39 iteration exponent used in passphrase derivation.
    """
    return common.get_uint8(_NAMESPACE, _SLIP39_ITERATION_EXPONENT)
def get_slip39_iteration_exponent() -> Optional[int]:
    _require_progress()
    return common.get_uint8(_NAMESPACE, _SLIP39_ITERATION_EXPONENT)
def get_slip39_group_count() -> int:
    _require_progress()
    return (
        common.get_uint8(_NAMESPACE, _SLIP39_GROUP_COUNT) or _DEFAULT_SLIP39_GROUP_COUNT
    )
Beispiel #5
0
def get_slip39_threshold() -> Optional[int]:
    _require_progress()
    return common.get_uint8(_NAMESPACE, _SLIP39_THRESHOLD)
Beispiel #6
0
def get_slip39_group_threshold() -> Optional[int]:
    return common.get_uint8(_NAMESPACE, _SLIP39_GROUP_THRESHOLD)
Beispiel #7
0
def get_slip39_group_count() -> Optional[int]:
    return common.get_uint8(_NAMESPACE, _SLIP39_GROUP_COUNT)
Beispiel #8
0
def get_word_count() -> Optional[int]:
    return common.get_uint8(_NAMESPACE, _WORD_COUNT)
Beispiel #9
0
def get_mnemonic_type() -> Optional[int]:
    return common.get_uint8(_NAMESPACE, _MNEMONIC_TYPE)