diff --git a/ed25519.py b/ed25519.py index 0dbeaee..fd74fbe 100644 --- a/ed25519.py +++ b/ed25519.py @@ -32,7 +32,6 @@ import hashlib - __version__ = "1.0.dev0" @@ -118,7 +117,7 @@ def edwards_add(P, Q): def edwards_double(P): # This is formula sequence 'dbl-2008-hwcd' from # http://www.hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html - (x1, y1, z1, t1) = P + (x1, y1, z1, _) = P a = x1 * x1 % q b = y1 * y1 % q @@ -183,7 +182,7 @@ def encodeint(y): def encodepoint(P): - (x, y, z, t) = P + (x, y, z, _) = P zi = inv(z) x = (x * zi) % q y = (y * zi) % q @@ -238,11 +237,11 @@ def isoncurve(P): def decodeint(s): - return sum(2**i * bit(s, i) for i in range(0, b)) + return sum(2**i * bit(s, i) for i in range(b)) def decodepoint(s): - y = sum(2**i * bit(s, i) for i in range(0, b - 1)) + y = sum(2**i * bit(s, i) for i in range(b - 1)) x = xrecover(y) if x & 1 != bit(s, b - 1): x = q - x @@ -274,8 +273,8 @@ def checkvalid(s, m, pk): S = decodeint(s[b // 8 : b // 4]) h = Hint(encodepoint(R) + pk + m) - (x1, y1, z1, t1) = P = scalarmult_B(S) - (x2, y2, z2, t2) = Q = edwards_add(R, scalarmult(A, h)) + (x1, y1, z1, _) = P = scalarmult_B(S) + (x2, y2, z2, _) = Q = edwards_add(R, scalarmult(A, h)) if ( not isoncurve(P) diff --git a/science.py b/science.py index a72efe4..2c57616 100644 --- a/science.py +++ b/science.py @@ -17,7 +17,6 @@ import ed25519 - seed = os.urandom(32) data = b"The quick brown fox jumps over the lazy dog" diff --git a/setup.py b/setup.py index 6f3bf0d..7dbd36e 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,6 @@ import ed25519 - setup( name="ed25519.py", version=ed25519.__version__, diff --git a/test_ed25519.py b/test_ed25519.py index a8a15eb..d86cb58 100644 --- a/test_ed25519.py +++ b/test_ed25519.py @@ -98,6 +98,6 @@ def test_checkparams(): assert pow(ed25519.d, (ed25519.q - 1) // 2, ed25519.q) == ed25519.q - 1 assert pow(ed25519.I, 2, ed25519.q) == ed25519.q - 1 assert ed25519.isoncurve(ed25519.B) - x, y, z, t = P = ed25519.scalarmult(ed25519.B, ed25519.l) + x, y, z, _ = P = ed25519.scalarmult(ed25519.B, ed25519.l) assert ed25519.isoncurve(P) assert (x, y) == (0, z)