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:
parent
b26a430b85
commit
fe4ef336aa
@ -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
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user