<p>My point was that regardless of whether you do a modulo operation or not, you'll end up with the same point - if you treat differences of a multiple of 11 as &quot;identical&quot;.</p>
<p>If of course you <em>do</em> a modulo operation, then clearly you cannot end up with a difference of 11 anymore. The modulo operation is exactly what removes all multiples of 11, and maps all field elements to <em>[0, 1, 2, ..., 10]</em>.</p>
<p>You have to remember that what you're really calculating is elements of the &quot;integers modulo 11&quot; field. Since computers (and people) can't natively deal with these, we instead <em>represent</em> the field elements as integers. But as pointed out in your earlier question, it does not matter what representation you use as long as the operations keep the same meaning.</p>
<p>In practice, for addition, subtraction, and multiplication, the modulo operation at the end is optional. If you don't, you'll just end up with another representation for the same field element. The same is not true for division and equality checking. Field division is nothing like integer division at all; it requires multiplication with the modular inverse (and again, the modulo reduction after that is optional). For equality checking you must treat a difference of a multiple of 11 as equality.</p>

CC BY-SA 4.0
2023-11-13T19:13:01.480Z
Thanks, and just one (out of context) question. Can we have 2 points on EC with the same Y coo?
LeaBit
CC BY-SA 4.0
2023-11-13T19:16:51.963Z
@LeaBit Yes, 3 in fact. See https://bitcoin.stackexchange.com/q/120050/208 (but this results only holds for curves with a=0, and when p%3 = 1).
Pieter Wuille
CC BY-SA 4.0
2023-11-13T18:33:57.487Z
2023-11-13T19:15:32.340Z
2023-11-13T19:15:32.340Z
Pieter Wuille
<p>First of all, just to note that I am having trouble with this MOD math, so for some this question might be basic, but in my case it caused a lot of confusion.</p>
<p>Just for the context. In my previous <a href="https://bitcoin.stackexchange.com/questions/120444/what-is-the-relationship-between-parity-and-the-sign-of-the-points-on-the-ellipt/120445">question</a> Pieter Wuille and I had a discussion in the comments (we've deleted them so you won't find them anymore) about points in a finite field and he said that it's just a convention to represent a point as a &quot;<em>direct</em>&quot; value of some field. For example, in a curve where <code>p = 11</code>, the direct values are <code>[0, 1, 2, ..., 10]</code> (I randomly denoted them as a &quot;<em>direct</em>&quot; values). He said that we can represent, for example, value of <code>3</code> also as <code>14</code>, <code>-8</code> and <code>-19</code> etc, since using <code>mod 11</code> on them they all denote the same value and it is just a convention to represent them as &quot;<em>direct</em>&quot; values. I totally agree with that.</p>
<p>He also said that we can do EC arithmetic (addition) with, for example, <code>(3, 9)</code> as well as with <code>(3, -2)</code> or <code>(3, 20)</code> (since <code>-2 mod 11</code>, <code>9 mod 11</code> and <code>20 mod 11</code> are all the same values) and we will end up with the same point/result after arithmetic operation. What he specifically drew my attention to is the following (I'm paraphrasing): &quot;<strong>as long as you realize that the output points whose coordinates differ by multiple of 11 are the SAME POINTS</strong>). This seems totally logical to me and I agree with that, but...</p>
<p>What confuses me is that I always end up with the exactly same point regardless of the input point values. For example, in case of <code>(3, 2) + (9, 5) = (8, 2)</code>, according to what he says, if I use <code>14</code>, <code>-8</code> or <code>-19</code> in place of <code>3</code> it need to end up with some X coordinate that differ by a multiple of <code>11</code> to <code>8</code>. However, I always end up with the <code>(8, 2)</code> regardless of what are the initial coordinates.</p>
<p>I know that the formula for adding points in EC is as follows (taken from <a href="https://jun-wang-2018.github.io/MyBlog/en/ECDSA-and-Bitcoin-I/" rel="nofollow noreferrer">here</a>). I have given it as a picture.</p>
<p><a href="https://i.sstatic.net/ccmpZ.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/ccmpZ.png" alt="enter image description here" /></a></p>
<p>Since we work with the EC over finite field, we must take MOD operation into account , so the modificated formulas are as the following (taken from <a href="https://jun-wang-2018.github.io/MyBlog/en/ECDSA-and-Bitcoin-I/" rel="nofollow noreferrer">the same site</a>):</p>
<p><a href="https://i.sstatic.net/220Gl.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/220Gl.png" alt="enter image description here" /></a></p>
<p><strong>Using these formulas I always end up with the exact same point (in my example <code>(8, 2)</code>), regardless of inputs. So there are no points on output whose coordinates differ by a multiple of 11.</strong></p>
<p>I assume that there is something redundant in this formula, which consistently returns values in the set, as I previously referred, of &quot;<em>direct</em>&quot; values. I assume some MOD is redundant, or do I even need any of these MOD (although when I do not use MOD I and up with totally wrong points).</p>
<p>What am I doing wrong? What is redundant in the formula?</p>
<p>Thanks to all!</p>

<math><elliptic-curve>
What am I doing wrong in calculating point addition? Is something redundant in the formula I am using?
LeaBit
# What am I doing wrong in calculating point addition? Is something redundant in the formula I am using?

(Asked by: username_0 on 2023-11-13)

First of all, just to note that I am having trouble with this MOD math, so for some this question might be basic, but in my case it caused a lot of confusion.

Just for the context. In my previous [question](https://bitcoin.stackexchange.com/questions/120444/what-is-the-relationship-between-parity-and-the-sign-of-the-points-on-the-ellipt/120445) username_1 username_1 and I had a discussion in the comments (we've deleted them so you won't find them anymore) about points in a finite field and he said that it's just a convention to represent a point as a "*direct*" value of some field. For example, in a curve where `p = 11`, the direct values are `[0, 1, 2, ..., 10]` (I randomly denoted them as a "*direct*" values). He said that we can represent, for example, value of `3` also as `14`, `-8` and `-19` etc, since using `mod 11` on them they all denote the same value and it is just a convention to represent them as "*direct*" values. I totally agree with that.

He also said that we can do EC arithmetic (addition) with, for example, `(3, 9)` as well as with `(3, -2)` or `(3, 20)` (since `-2 mod 11`, `9 mod 11` and `20 mod 11` are all the same values) and we will end up with the same point/result after arithmetic operation. What he specifically drew my attention to is the following (I'm paraphrasing): "**as long as you realize that the output points whose coordinates differ by multiple of 11 are the SAME POINTS**). This seems totally logical to me and I agree with that, but...

What confuses me is that I always end up with the exactly same point regardless of the input point values. For example, in case of `(3, 2) + (9, 5) = (8, 2)`, according to what he says, if I use `14`, `-8` or `-19` in place of `3` it need to end up with some X coordinate that differ by a multiple of `11` to `8`. However, I always end up with the `(8, 2)` regardless of what are the initial coordinates.

I know that the formula for adding points in EC is as follows (taken from [here](https://jun-wang-2018.github.io/MyBlog/en/ECDSA-and-Bitcoin-I/)). I have given it as a picture.

[![enter image description here](https://i.sstatic.net/ccmpZ.png)](https://i.sstatic.net/ccmpZ.png)

Since we work with the EC over finite field, we must take MOD operation into account , so the modificated formulas are as the following (taken from [the same site](https://jun-wang-2018.github.io/MyBlog/en/ECDSA-and-Bitcoin-I/)):

[![enter image description here](https://i.sstatic.net/220Gl.png)](https://i.sstatic.net/220Gl.png)

**Using these formulas I always end up with the exact same point (in my example `(8, 2)`), regardless of inputs. So there are no points on output whose coordinates differ by a multiple of 11.**

I assume that there is something redundant in this formula, which consistently returns values in the set, as I previously referred, of "*direct*" values. I assume some MOD is redundant, or do I even need any of these MOD (although when I do not use MOD I and up with totally wrong points).

What am I doing wrong? What is redundant in the formula?

Thanks to all!

**Tags:** math, elliptic-curve


---

## 1 answers

### Answer by username_1 on 2023-11-13. Score: 1 | Accepted answer

My point was that regardless of whether you do a modulo operation or not, you'll end up with the same point - if you treat differences of a multiple of 11 as "identical".

If of course you *do* a modulo operation, then clearly you cannot end up with a difference of 11 anymore. The modulo operation is exactly what removes all multiples of 11, and maps all field elements to *[0, 1, 2, ..., 10]*.

You have to remember that what you're really calculating is elements of the "integers modulo 11" field. Since computers (and people) can't natively deal with these, we instead *represent* the field elements as integers. But as pointed out in your earlier question, it does not matter what representation you use as long as the operations keep the same meaning.

In practice, for addition, subtraction, and multiplication, the modulo operation at the end is optional. If you don't, you'll just end up with another representation for the same field element. The same is not true for division and equality checking. Field division is nothing like integer division at all; it requires multiplication with the modular inverse (and again, the modulo reduction after that is optional). For equality checking you must treat a difference of a multiple of 11 as equality.

> **Comments:**
> **username_0**: Thanks, and just one (out of context) question. Can we have 2 points on EC with the same Y coo?  
> **username_1**: @username_0 Yes, 3 in fact. See https://bitcoin.stackexchange.com/q/120050/208 (but this results only holds for curves with a=0, and when p%3 = 1).  

---

