Skip to content

Commit c0f8f5c

Browse files
committed
Encode chr(0) in pyelliptic.eccblind
1 parent 5467e20 commit c0f8f5c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/pyelliptic/eccblind.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def _ec_point_serialize(self, point):
150150
# padding manually
151151
bx = OpenSSL.malloc(0, OpenSSL.BN_num_bytes(x))
152152
OpenSSL.BN_bn2bin(x, bx)
153-
out = bx.raw.rjust(l_, chr(0))
153+
out = bx.raw.rjust(l_, chr(0).encode())
154154
return pack(EC, y_byte, out)
155155

156156
finally:
@@ -180,7 +180,7 @@ def _bn_serialize(self, bn):
180180
except AttributeError:
181181
o = OpenSSL.malloc(0, OpenSSL.BN_num_bytes(bn))
182182
OpenSSL.BN_bn2bin(bn, o)
183-
return o.raw.rjust(l_, chr(0))
183+
return o.raw.rjust(l_, chr(0).encode())
184184

185185
def _bn_deserialize(self, data):
186186
"""Make a BigNum out of string"""

0 commit comments

Comments
 (0)