iceland2k14/secp256k1

ice.sha256 overwrites variable

RDmitriev opened this issue · 1 comments

Hi

a1 = ice.get_sha256('test')
print(a1)

a2 = ice.get_sha256('test2')
print(a2)
print(a1)

return

b'\x9f\x86\xd0\x81\x88L}e\x9a/\xea\xa0\xc5Z\xd0\x15\xa3\xbfO\x1b+\x0b\x82,\xd1]l\x15\xb0\xf0\n\x08'
b'`0:\xe2+\x99\x88a\xbc\xe3\xb2\x8f3\xee\xc1\xbeu\x8a!<\x86\xc9<\x07m\xbe\x9fU\x8c\x11\xc7R'
b'`0:\xe2+\x99\x88a\xbc\xe3\xb2\x8f3\xee\xc1\xbeu\x8a!<\x86\xc9<\x07m\xbe\x9fU\x8c\x11\xc7R'

How to fix this without unnecessary action

a1 = bytearray.fromhex(ice.get_sha256('test').hex())

I need a return in bytes

Fixed it ice.get_sha256(cpub)+b'\x00'
Added zero byte