[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [stem/master] Python 2.x char -> int compatibility
commit 0fdf7792a368984c33cff200414847c8ec39f9c4
Author: Damian Johnson <atagar@xxxxxxxxxxxxxx>
Date: Sat Oct 12 13:50:58 2019 -0700
Python 2.x char -> int compatibility
======================================================================
ERROR: test_encode_decode_descriptor
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/atagar/Desktop/stem/test/unit/descriptor/hidden_service_v3.py", line 279, in test_encode_decode_descriptor
blinding_param=blind_param)
File "/home/atagar/Desktop/stem/stem/descriptor/hidden_service.py", line 1009, in content
blinding_param=blinding_param)
File "/home/atagar/Desktop/stem/stem/descriptor/hsv3_crypto.py", line 45, in __init__
expanded_identity_priv_key = ed25519_exts_ref.expandSK(secret_seed)
File "/home/atagar/Desktop/stem/stem/descriptor/ed25519_exts_ref.py", line 42, in expandSK
a = 2**(b-2) + sum(2**i * bit(h,i) for i in range(3,b-2))
File "/home/atagar/Desktop/stem/stem/descriptor/ed25519_exts_ref.py", line 42, in <genexpr>
a = 2**(b-2) + sum(2**i * bit(h,i) for i in range(3,b-2))
File "/home/atagar/Desktop/stem/stem/descriptor/slow_ed25519.py", line 70, in bit
return (h[i//8] >> (i%8)) & 1
TypeError: unsupported operand type(s) for >>: 'str' and 'int'
---
stem/descriptor/slow_ed25519.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/stem/descriptor/slow_ed25519.py b/stem/descriptor/slow_ed25519.py
index ba2766ba..fbe6e35f 100644
--- a/stem/descriptor/slow_ed25519.py
+++ b/stem/descriptor/slow_ed25519.py
@@ -67,7 +67,7 @@ def encodepoint(P):
return b''.join([bytes([sum([bits[i * 8 + j] << j for j in range(8)])]) for i in range(b//8)])
def bit(h,i):
- return (h[i//8] >> (i%8)) & 1
+ return (ord(h[i//8]) >> (i%8)) & 1
def publickey(sk):
h = H(sk)
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits