-snip-
Bro,
Bresult=addpt(result, (subptx,subpty), p)
print("result> 04%064x%064x"%Bresult)
aagain generate false result. This is not deducted pubkey+starting range, and I kan't understand what is it and why I can't get previous pubkey then I add range what I deleted early
How to minus range and add after and get result: startpubey=Q(pubkey-range)+range
?
1) You have pub key let`s call this point Pt
2) And you have startrange = 0x800000 for ex. Calculate point from startingrange: x,y = ptmul(g,startrange )
3) make y-coordinate negative using p-y, so you will have point with x,p-y
4) make point addition operation via your pubkey and point from step 3: myX,myY = addpt(Pt, (x,p-y), p)
myX,myY is equil to point Pt from which substract startrange.
If you need getback to Pt value just add to myX,myY point x,y: backX,backY = addpt((myX,myY) , (x,y), p)
backX,backY will equil to Pt.
Post here example where you have wrong result.
here is result from python console from example that you post above:
shifted result> 043aeb4f818ca91912a3e50d1b3db196696f82713bae00ba2b53c09a23f1d284a085b2197137256def6c05a0f105e1b1eee9c10d23b7a4911040a23e891ebb3dc9
result> 047e1238f7b1ce757df94faa9a2eb261bf0aeb9f84dbf81212104e78931c2a19dc625c7118f1c29cb92d28ce0dfd0dc58144fe5572effebc7fee54c4fce3333a6b
uncompressed 047e1238f7b1ce757df94faa9a2eb261bf0aeb9f84dbf81212104e78931c2a19dc625c7118f1c29
cb92d28ce0dfd0dc58144fe5572effebc7fee54c4fce3333a6b
is the same as compressed 037e1238f7b1ce757df94faa9a2eb261bf0aeb9f84dbf81212104e78931c2a19dc
Bro this is first step: ""-" range from Pt
#CHANGE HERE beginrange and pointstr
beginrange=0x80000000000000000000
pointstr = '037e1238f7b1ce757df94faa9a2eb261bf0aeb9f84dbf81212104e78931c2a19dc'
pt= getuncompressedpub(pointstr)
(subptx,subpty) = ptmul(g, beginrange, p)
result=addpt(pt, (subptx,p-subpty), p)
print("shifted result> 04%064x%064x"%result)
Bresult=addpt(result, (subptx,subpty), p)
print("result> 04%064x%064x"%Bresult)
shifted result> Call THIS POIT Presult - 043aeb4f818ca91912a3e50d1b3db196696f82713bae00ba2b53c09a23f1d284a085b2197137256def6c05a0f105e1b1eee9c10d23b7a4911040a23e891ebb3dc9
result> 047e1238f7b1ce757df94faa9a2eb261bf0aeb9f84dbf81212104e78931c2a19dc625c7118f1c29cb92d28ce0dfd0dc58144fe5572effebc7fee54c4fce3333a6b
After I was change "-" to "+" so : "result=addpt(pt, (subptx,p+subpty), p)" and add range to Presut:
pointstr = '043aeb4f818ca91912a3e50d1b3db196696f82713bae00ba2b53c09a23f1d284a085b2197137256def6c05a0f105e1b1eee9c10d23b7a4911040a23e891ebb3dc9'
pt= getuncompressedpub(pointstr)
(subptx,subpty) = ptmul(g, beginrange, p)
result=addpt(pt, (subptx,p+subpty), p)
print("shifted result> 04%064x%064x"%result)
Bresult=addpt(result, (subptx,subpty), p)
print("result> 04%064x%064x"%Bresult)
shifted result> CALL THIS POINT P-backresult 041e8e77439c921a460ce4185b864329dcba5960646e93c59d5e7bbbea8dd913fcd83777dec0468c76fdc5b0a4ce879086e66766f520386f9db6e1999d8b0e1ad0
result> 04a3bcf71ae6452d91247af4bd6df4e1fa116150d79535097dcc0a1c772e807ac7af30eb6e7bfad29f1df4664388e2c0900b5a90a5a119ee1dd2ee746c7d42bebe
But P-backresult+range NOT EQUAL(<>) Pt !!!
03
7e1238f7b1ce757df94faa9a2eb261bf0aeb9f84dbf81212104e78931c2a19dc
<>04
1e8e77439c921a460ce4185b864329dcba5960646e93c59d5e7bbbea8dd913fcd83777dec0468c76fdc5
b0a4ce879086e66766f520386f9db6e1999d8b0e1ad0
You see