iceland2k14/secp256k1

not work on Linux 4.15.0-144-generic #148-Ubuntu SMP Sat May 8 02:33:43 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Goga0123 opened this issue · 3 comments

print(ice.scalar_multiplication(2))
: '\x04\xc6\x04\x7f\x94A\xed}m0E@n\x95\xc0|\xd8\w\x8eK\x8c\xef<\xa7\xab\xac\t\xb9\p\x9e\xe5\x1a\xe1h\xfe\xa6=\xc39\xa3\xc5\x84\x19Fl\xea\xee\xf7\xf62e2f\xd0\xe1#d1\xa9P\xcf\xe5*')

P = ice.scalar_multiplication(2)
print(type(P))
: <type 'str'>

P.hex()
: AttributeError: 'str' object has no attribute 'hex'

Are you trying it on Python 2 ?
Because you are missing b in the beginning. It is supposed to be b'\x04\xc6\x04\x7f\x94A\xed}m0E@n\x95\xc0|\xd8\w\x8eK\x8c\xef<\xa7\xab\xac\t\xb9\p\x9e\xe5\x1a\xe1h\xfe\xa6=\xc39\xa3\xc5\x84\x19Fl\xea\xee\xf7\xf62e2f\xd0\xe1#d1\xa9P\xcf\xe5*'

you are right, python2 was my problem
on python3 works good

can you add functionality create point object (P) from full pubkey(04)?
or tell me how to do it right now

It is nothing special. just a bytes form of correct length Full Pubkey. For example.
cpub = 030cabe03a609b39af406d7b29c8600a5b6f1704fcfdd5b5be56d152782c13fd65
upub = 040cabe03a609b39af406d7b29c8600a5b6f1704fcfdd5b5be56d152782c13fd65553675c3d71513cb35c8df9683fe16cf8d5af423e1a6bebe791e66a1c2c956a3
P = bytes.fromhex(upub)