Post
Topic
Board Development & Technical Discussion
Re: sagemath script
by
mausuv
on 14/12/2022, 08:59:34 UTC

Code:
# div by scalar

P4= P2*modinv(2,n)
# 2*(1/2)=1
assert P4==P

#mul by scalar

P5=P1*2
assert P5==P2
1st question:

i am skip this part of line assert
assert is important or not ?

Code:
# div by scalar

P5= P2*modinv(0x2,n)
print(hex(P5[0]),hex(P5[1]))

#mul by scalar

P6=P2*0x2
print(hex(P6[0]),hex(P6[1]))

2nd question :

div is so hard P5= P2*modinv(0x2,n)
any easy to div like this P5 = P2/0x2