mirror of
https://github.com/elseif/MikroTikPatch.git
synced 2025-01-23 13:35:09 +03:00
Update mikro.py
Signed-off-by: Amir <loskiq@gmail.com>
This commit is contained in:
parent
f65a65e830
commit
e61c981f84
6
mikro.py
6
mikro.py
@ -39,8 +39,8 @@ def mikro_softwareid_encode(id:int)->str:
|
||||
assert(isinstance(id, int))
|
||||
ret = ''
|
||||
for i in range(8):
|
||||
ret += chr(SOFTWARE_ID_CHARACTER_TABLE[id % 0x23])
|
||||
id //= 0x23
|
||||
ret += chr(SOFTWARE_ID_CHARACTER_TABLE[id % len(SOFTWARE_ID_CHARACTER_TABLE)])
|
||||
id //= len(SOFTWARE_ID_CHARACTER_TABLE)
|
||||
if i == 3:
|
||||
ret += '-'
|
||||
return ret
|
||||
@ -205,4 +205,4 @@ def mikro_kcdsa_verify(data:bytes, signature:bytes, public_key:bytes)->bool:
|
||||
nonce = int((public_key * signature + curve.G * data_hash).x)
|
||||
if mikro_sha256(Tools.inttobytes_le(nonce,32))[:len(nonce_hash)] == nonce_hash:
|
||||
return True
|
||||
return False
|
||||
return False
|
||||
|
Loading…
Reference in New Issue
Block a user