I have a script that does scalar multiplication of points on an Elliptic Curve.

```
class Point(object):
def __init__(self, _x, _y, _order = None): self.x, self.y, self.order = _x, _y, _order
def calc(self, top, bottom, other_x):
l = (top * inverse_mod(bottom)) % p
x3 = (l * l - self.x - other_x) % p
return Point(x3, (l * (self.x - x3) - self.y) % p)
def double(self):
if self == INFINITY: return INFINITY
return self.calc(3 * self.x * self.x, 2 * self.y, self.x)
def __add__(self, other):
if other == INFINITY: return self
if self == INFINITY: return other
if self.x == other.x:
if (self.y + other.y) % p == 0: return INFINITY
return self.double()
return self.calc(other.y - self.y, other.x - self.x, other.x)
def __mul__(self, e):
if self.order: e %= self.order
if e == 0 or self == INFINITY: return INFINITY
result, q = INFINITY, self
while e:
if e&1: result += q
e, q = e >> 1, q.double()
return result
def __str__(self):
if self == INFINITY: return "infinity"
return "%x %x" % (self.x, self.y)
def inverse_mod(a):
if a < 0 or a >= p: a = a % p
c, d, uc, vc, ud, vd = a, p, 1, 0, 0, 1
while c:
q, c, d = divmod(d, c) + (c,)
uc, vc, ud, vd = ud - q*uc, vd - q*vc, uc, vc
if ud > 0: return ud
return ud + p
p, INFINITY = 377, Point(None, None)
g = Point(18, 26)
EvenNumber = 2
result = ' Scalar: %xn Point: %s' % (EvenNumber, g*EvenNumber)
f = open('Result.txt', 'a')
f.write(result)
f.close()
```

I cannot understand in more detail the code itself. I need to change the algorithm of this script so that points on the plane of the curve are added only if an even number is specified.

```
I.e:
EvenNumber = 2
EvenNumber = 4
EvenNumber = 6
EvenNumber = 8
EvenNumber = 10
EvenNumber = 12
...
...
...
etc
```

Is it possible to do so to completely eliminate the odd numbers in scalar multiplication?