mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-18 13:38:12 +00:00
core/crypto: Fix endianity in DER length encoding.
This commit is contained in:
parent
e7f230d66e
commit
872768928b
@ -4,7 +4,7 @@ def encode_length(l: int) -> bytes:
|
||||
elif l <= 0xFF:
|
||||
return bytes([0x81, l])
|
||||
elif l <= 0xFFFF:
|
||||
return bytes([0x82, l & 0xFF, l >> 8])
|
||||
return bytes([0x82, l >> 8, l & 0xFF])
|
||||
else:
|
||||
raise ValueError
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user