1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-23 23:08:14 +00:00

core/keyctl: get rid of serpent conversions

This commit is contained in:
matejcik 2019-12-20 15:00:32 +01:00 committed by Pavol Rusnak
parent b26a430b85
commit fe4ef336aa
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
2 changed files with 4 additions and 10 deletions

View File

@ -4,9 +4,10 @@ import struct
import click
import pyblake2
import Pyro4
import serpent
from trezorlib import cosi
Pyro4.config.SERIALIZER = "marshal"
PORT = 5001
indexmap = {"bootloader": 0, "vendorheader": 1, "firmware": 2}
@ -50,7 +51,6 @@ def sign(index, filename, participants):
pks, Rs = [], []
for i, p in enumerate(proxy):
pk, R = p.get_commit(index, digest)
pk, R = serpent.tobytes(pk), serpent.tobytes(R)
pks.append(pk)
Rs.append(R)
print("collected commit #%d from %s" % (i, p._pyroUri.host))
@ -61,7 +61,6 @@ def sign(index, filename, participants):
sigs = []
for i, p in enumerate(proxy):
sig = p.get_signature(index, digest, global_R, global_pk)
sig = serpent.tobytes(sig)
sigs.append(sig)
print("collected signature #%d from %s" % (i, p._pyroUri.host))
# compute global signature

View File

@ -4,9 +4,10 @@ import sys
import traceback
import Pyro4
import serpent
from trezorlib import cosi, tools
Pyro4.config.SERIALIZER = "marshal"
PORT = 5001
indexmap = {"bootloader": 0, "vendorheader": 1, "firmware": 2}
@ -26,7 +27,6 @@ def get_path(index):
@Pyro4.expose
class KeyctlProxy(object):
def get_commit(self, index, digest):
digest = serpent.tobytes(digest)
path = get_path(index)
commit = None
while commit is None:
@ -47,11 +47,6 @@ class KeyctlProxy(object):
return (pk, R)
def get_signature(self, index, digest, global_R, global_pk):
digest, global_R, global_pk = (
serpent.tobytes(digest),
serpent.tobytes(global_R),
serpent.tobytes(global_pk),
)
path = get_path(index)
signature = None
while signature is None: