can you write something more about these calculation methods
in ecc secp256k1
1/2 = 57896044618658097711785492504343953926418782139537452191302581570759080747169
7/2 = 57896044618658097711785492504343953926418782139537452191302581570759080747172
57896044618658097711785492504343953926418782139537452191302581570759080747172 / 57896044618658097711785492504343953926418782139537452191302581570759080747169 = 7
So the above method from @sss555 is not work to define the pubkey is odd or even. I already try many use method to separate odd and even but pattern to cyclic odd and even is always same.
7/2 - 1/2 = 3,
7 -3 = odd

remember we just have the pubkey as known variable, no decimal or pvkey
I talk abot this
1/2 = 57896044618658097711785492504343953926418782139537452191302581570759080747169
7/2 = 57896044618658097711785492504343953926418782139537452191302581570759080747172
just run ecctools from @Alberto
I using ecctools
another situation:
x = 0x123456789
b = 1
c = 0x100000000
Xx = x + b
Xx = Xx - c
# = 0x2345678a
print(hex(x-Xx))
output:
0xffffffff
[Program finished]
if know range of pubkey after subtraction it is posible or not, verify with brute in range ffffff,like in scrypt , brute 0xffffffff
anyone try their examples and you get fffff too ffff will be know range
but what about if "c" in my code wrong ?
N = 115792089237316195423570985008687907852837564279074904382605163141518161494337
def inv(v): return pow(v, N-2, N)
def divnum(a, b): return ( (a * inv(b) ) % N )
x =0xfffffffffffff# 0x123456789
b = 1
c = (0x123456789 *
(-1%N)%N)%N
print("c",hex(c))
Xx =(x + b %N)%N
Xx = (Xx - c %N)%N
# = 0x2345678a
print("x+Xx",hex((x+Xx%N)%N))
res:
c 0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8bacf0d9b8
x+Xx
0x20000123456788 N = 115792089237316195423570985008687907852837564279074904382605163141518161494337
def inv(v): return pow(v, N-2, N)
def divnum(a, b): return ( (a * inv(b) ) % N )
x =0xfffffffffffff# 0x123456789
b = 1
c = (0x123456789 *
(1%N)%N)%N
print("c",hex(c))
Xx =(x + b %N)%N
Xx = (Xx - c %N)%N
# = 0x2345678a
print("x+Xx",hex((x+Xx%N)%N))
result:
c 0x123456789
x+Xx
0x1ffffedcba9876[Program finished]
edcba9876 !=0x123456789
[moderator's note: consecutive posts merged]