mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-18 21:48:13 +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:
|
elif l <= 0xFF:
|
||||||
return bytes([0x81, l])
|
return bytes([0x81, l])
|
||||||
elif l <= 0xFFFF:
|
elif l <= 0xFFFF:
|
||||||
return bytes([0x82, l & 0xFF, l >> 8])
|
return bytes([0x82, l >> 8, l & 0xFF])
|
||||||
else:
|
else:
|
||||||
raise ValueError
|
raise ValueError
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user