Пример #1
0
def set_slip39_iteration_exponent(exponent: int) -> None:
    """
    The device's actual SLIP-39 iteration exponent used in passphrase derivation.
    Not to be confused with recovery.iteration_exponent, which is stored only during
    the recovery process and it is copied here upon success.
    """
    common._set_uint8(_NAMESPACE, _SLIP39_ITERATION_EXPONENT, exponent)
Пример #2
0
def store_mnemonic_secret(
    secret: bytes,
    mnemonic_type: int,
    needs_backup: bool = False,
    no_backup: bool = False,
) -> None:
    set_version(common._STORAGE_VERSION_CURRENT)
    common._set(_NAMESPACE, _MNEMONIC_SECRET, secret)
    common._set_uint8(_NAMESPACE, _MNEMONIC_TYPE, mnemonic_type)
    common._set_true_or_delete(_NAMESPACE, _NO_BACKUP, no_backup)
    if not no_backup:
        common._set_true_or_delete(_NAMESPACE, _NEEDS_BACKUP, needs_backup)
Пример #3
0
def set_iteration_exponent(exponent: int) -> None:
    common._set_uint8(_NAMESPACE, _SLIP39_ITERATION_EXPONENT, exponent)
Пример #4
0
def set_words_count(count: int) -> None:
    common._set_uint8(_NAMESPACE, _SLIP39_WORDS_COUNT, count)
Пример #5
0
def set_remaining(remaining: int) -> None:
    common._set_uint8(_NAMESPACE, _SLIP39_REMAINING, remaining)
Пример #6
0
def set_threshold(threshold: int) -> None:
    common._set_uint8(_NAMESPACE, _SLIP39_THRESHOLD, threshold)
Пример #7
0
def set_word_count(count: int) -> None:
    common._set_uint8(_NAMESPACE, _WORD_COUNT, count)