parent
62ad4d6a39
commit
fd1718f8b6
@ -1,25 +1,43 @@
|
||||
|
||||
# ../extmod/modtrezorcrypto/modtrezorcrypto-ed25519.h
|
||||
# extmod/modtrezorcrypto/modtrezorcrypto-ed25519.h
|
||||
def generate_secret() -> bytes:
|
||||
'''
|
||||
Generate secret key.
|
||||
'''
|
||||
|
||||
# ../extmod/modtrezorcrypto/modtrezorcrypto-ed25519.h
|
||||
# extmod/modtrezorcrypto/modtrezorcrypto-ed25519.h
|
||||
def publickey(secret_key: bytes) -> bytes:
|
||||
'''
|
||||
Computes public key from secret key.
|
||||
'''
|
||||
|
||||
# ../extmod/modtrezorcrypto/modtrezorcrypto-ed25519.h
|
||||
# extmod/modtrezorcrypto/modtrezorcrypto-ed25519.h
|
||||
def sign(secret_key: bytes, message: bytes) -> bytes:
|
||||
'''
|
||||
Uses secret key to produce the signature of message.
|
||||
'''
|
||||
|
||||
# ../extmod/modtrezorcrypto/modtrezorcrypto-ed25519.h
|
||||
# extmod/modtrezorcrypto/modtrezorcrypto-ed25519.h
|
||||
def verify(public_key: bytes, signature: bytes, message: bytes) -> bool:
|
||||
'''
|
||||
Uses public key to verify the signature of the message.
|
||||
Returns True on success.
|
||||
'''
|
||||
|
||||
# extmod/modtrezorcrypto/modtrezorcrypto-ed25519.h
|
||||
def cosi_combine_publickeys(public_keys: list) -> bytes:
|
||||
'''
|
||||
Combines a list of public keys used in COSI cosigning scheme
|
||||
'''
|
||||
|
||||
# extmod/modtrezorcrypto/modtrezorcrypto-ed25519.h
|
||||
def cosi_combine_signatures(R: bytes, signatures: list) -> bytes:
|
||||
'''
|
||||
Combines a list of signatures used in COSI cosigning scheme
|
||||
'''
|
||||
|
||||
# extmod/modtrezorcrypto/modtrezorcrypto-ed25519.h
|
||||
def cosi_sign(secret_key: bytes, message: bytes, nonce: bytes, sigR: bytes, combined_pubkey: bytes) -> bytes:
|
||||
'''
|
||||
Produce signature of message using COSI cosigning scheme
|
||||
'''
|
||||
|
@ -1,41 +1,48 @@
|
||||
# ../extmod/modtrezorcrypto/modtrezorcrypto-blake2s.h
|
||||
def blake2s(data: bytes=None, key: bytes=None) -> Blake2s:
|
||||
|
||||
# extmod/modtrezorcrypto/modtrezorcrypto-blake2b.h
|
||||
def blake2b(data: bytes=None, key: bytes=None) -> Blake2b:
|
||||
'''
|
||||
Creates a hash context object.
|
||||
'''
|
||||
|
||||
# ../extmod/modtrezorcrypto/modtrezorcrypto-sha1.h
|
||||
def sha1(data: bytes=None) -> Sha1:
|
||||
# extmod/modtrezorcrypto/modtrezorcrypto-sha3-256.h
|
||||
def sha3_256(data: bytes=None) -> Sha3_256:
|
||||
'''
|
||||
Creates a hash context object.
|
||||
'''
|
||||
|
||||
# ../extmod/modtrezorcrypto/modtrezorcrypto-ripemd160.h
|
||||
def ripemd160(data: bytes=None) -> Ripemd160:
|
||||
# extmod/modtrezorcrypto/modtrezorcrypto-sha512.h
|
||||
def sha512(data: bytes=None) -> Sha512:
|
||||
'''
|
||||
Creates a hash context object.
|
||||
'''
|
||||
|
||||
# ../extmod/modtrezorcrypto/modtrezorcrypto-sha256.h
|
||||
# extmod/modtrezorcrypto/modtrezorcrypto-sha256.h
|
||||
def sha256(data: bytes=None) -> Sha256:
|
||||
'''
|
||||
Creates a hash context object.
|
||||
'''
|
||||
|
||||
# ../extmod/modtrezorcrypto/modtrezorcrypto-sha512.h
|
||||
def sha512(data: bytes=None) -> Sha512:
|
||||
# extmod/modtrezorcrypto/modtrezorcrypto-ripemd160.h
|
||||
def ripemd160(data: bytes=None) -> Ripemd160:
|
||||
'''
|
||||
Creates a hash context object.
|
||||
'''
|
||||
|
||||
# ../extmod/modtrezorcrypto/modtrezorcrypto-sha3-256.h
|
||||
def sha3_256(data: bytes=None) -> Sha3_256:
|
||||
# extmod/modtrezorcrypto/modtrezorcrypto-sha3-512.h
|
||||
def sha3_512(data: bytes=None) -> Sha3_512:
|
||||
'''
|
||||
Creates a hash context object.
|
||||
'''
|
||||
|
||||
# ../extmod/modtrezorcrypto/modtrezorcrypto-sha3-512.h
|
||||
def sha3_512(data: bytes=None) -> Sha3_512:
|
||||
# extmod/modtrezorcrypto/modtrezorcrypto-sha1.h
|
||||
def sha1(data: bytes=None) -> Sha1:
|
||||
'''
|
||||
Creates a hash context object.
|
||||
'''
|
||||
|
||||
# extmod/modtrezorcrypto/modtrezorcrypto-blake2s.h
|
||||
def blake2s(data: bytes=None, key: bytes=None) -> Blake2s:
|
||||
'''
|
||||
Creates a hash context object.
|
||||
'''
|
||||
|
@ -0,0 +1,12 @@
|
||||
|
||||
# extmod/modtrezorcrypto/modtrezorcrypto-blake2b.h
|
||||
def update(self, data: bytes) -> None:
|
||||
'''
|
||||
Update the hash context with hashed data.
|
||||
'''
|
||||
|
||||
# extmod/modtrezorcrypto/modtrezorcrypto-blake2b.h
|
||||
def digest(self) -> bytes:
|
||||
'''
|
||||
Returns the digest of hashed data.
|
||||
'''
|
@ -0,0 +1,6 @@
|
||||
|
||||
# extmod/modtrezorcrypto/modtrezorcrypto-rfc6979.h
|
||||
def next() -> bytes:
|
||||
'''
|
||||
Compute next 32-bytes of pseudorandom data
|
||||
'''
|
Loading…
Reference in new issue