1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-27 00:28:10 +00:00

tools: add header to ed25519raw.py, fix whitespace in keytool

This commit is contained in:
Pavol Rusnak 2017-04-02 23:03:07 +02:00
parent 99915f1a63
commit f92e8b6e4b
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
2 changed files with 7 additions and 7 deletions

View File

@ -1,3 +1,6 @@
# orignal version downloaded from https://ed25519.cr.yp.to/python/ed25519.py
# modified for Python 3 by Jochen Hoenicke <hoenicke@gmail.com>
import hashlib
b = 256
@ -9,7 +12,7 @@ def H(m):
def expmod(b,e,m):
if e < 0:
raise Exception('negative exponent')
raise Exception("negative exponent")
if e == 0: return 1
t = expmod(b,e>>1,m)**2 % m
if e & 1: t = (t*b) % m

View File

@ -233,14 +233,11 @@ def test():
commits.append(R)
sigs.append(ed25519raw.encodeint(S))
print('-----------------')
sig = combine_sig(globalR, [sigs[i] for i in [1,3,4]])
print('Global sig: %s' %hex(sig))
ed25519raw.checkvalid(sig, digest, globalPk)
print('Valid Signature!')
if __name__ == '__main__':
test()