docs(core): Add references to SLIPs in the code.

pull/1514/head
Andrew Kozlik 3 years ago
parent 5cff6ac964
commit 850aa56691

@ -20,7 +20,9 @@ if False:
from trezor.messages.TxInputType import EnumTypeInputScriptType
from apps.common.coininfo import CoinInfo
# This module implements the SLIP-0019 proof of ownership format.
# This module implements the SLIP-0019 proof of ownership format, see
# https://github.com/satoshilabs/slips/blob/master/slip-0019.md.
_VERSION_MAGIC = b"SL\x00\x19"
_FLAG_USER_CONFIRMED = 0x01

@ -83,7 +83,7 @@ async def get_keychain(ctx: wire.Context) -> Keychain:
assert secret_bytes is not None
root = bip32.from_mnemonic_cardano(secret_bytes.decode(), passphrase)
else:
# derive the root node via SLIP-0023
# derive the root node via SLIP-0023 https://github.com/satoshilabs/slips/blob/master/slip-0022.md
seed = await get_seed(ctx)
root = bip32.from_seed(seed, "ed25519 cardano seed")

@ -10,6 +10,11 @@ if False:
class Slip21Node:
"""
This class implements the SLIP-0021 hierarchical derivation of symmetric keys, see
https://github.com/satoshilabs/slips/blob/master/slip-0021.md.
"""
def __init__(self, seed: bytes = None, data: bytes = None) -> None:
assert seed is None or data is None, "Specify exactly one of: seed, data"
if data is not None:

@ -11,6 +11,9 @@ if False:
from trezor.messages.CipherKeyValue import CipherKeyValue
from trezor.wire import Context
# This module implements the SLIP-0011 symmetric encryption of key-value pairs using a
# deterministic hierarchy, see https://github.com/satoshilabs/slips/blob/master/slip-0011.md.
async def cipher_key_value(ctx: Context, msg: CipherKeyValue) -> CipheredKeyValue:
keychain = await get_keychain(ctx, "secp256k1", [AlwaysMatchingSchema])

@ -19,6 +19,9 @@ if False:
from apps.common.paths import Bip32Path
# This module implements the SLIP-0017 Elliptic Curve Diffie-Hellman algorithm, using a
# determinstic hierarchy, see https://github.com/satoshilabs/slips/blob/master/slip-0017.md.
async def get_ecdh_session_key(
ctx: wire.Context, msg: GetECDHSessionKey

@ -20,6 +20,9 @@ if False:
from apps.common.paths import Bip32Path
# This module implements the SLIP-0013 authentication using a deterministic hierarchy, see
# https://github.com/satoshilabs/slips/blob/master/slip-0013.md.
async def sign_identity(ctx: wire.Context, msg: SignIdentity) -> SignedIdentity:
if msg.ecdsa_curve_name is None:

@ -103,8 +103,12 @@ class Credential:
return U2fCredential.from_key_handle(data, rp_id_hash)
# SLIP-0022: FIDO2 credential ID format for HD wallets
class Fido2Credential(Credential):
"""
This class implements the SLIP-0022 FIDO2 Credential ID format for HD wallets, see
https://github.com/satoshilabs/slips/blob/master/slip-0022.md.
"""
def __init__(self) -> None:
super().__init__()
self.rp_name: Optional[str] = None

Loading…
Cancel
Save