Skip to content

Commit

Permalink
negative numbers explanation
Browse files Browse the repository at this point in the history
  • Loading branch information
olga24912 committed Dec 21, 2023
1 parent f9343c8 commit b8be6e5
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions neps/nep-0488.md
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ The $y$ coordinate is determined by the formula: $y = \pm \sqrt{x^3 + 4}$.
- The second-highest bit marks the point at infinity (if set to 1).
- For the point at infinity, all bits except the first two should be set to 0; other encodings should be considered as incorrect.
- To represent the sign of $y$, the third-highest bit in the x encoding is utilized.
- If the bit is 0, $y$ is positive; if 1, $y$ is negative. We'll consider the number positive by taking the smallest value between $y$ and $-y$.
- If the bit is 0, $y$ is positive; if 1, $y$ is negative. We'll consider the number positive by taking the smallest value between $y$ and $-y$, after reducing them to $[0, p)$.

The encoding for $x \in F_p$ as `[u8; 48]` bytes follows the rules described in the section "Extension fields elements $F_{p}$".

Expand Down Expand Up @@ -463,7 +463,6 @@ x[0] = x[0] | 0x40;
```

#### ERROR_CODE

Check failure on line 465 in neps/nep-0488.md

View workflow job for this annotation

GitHub Actions / markdown-lint

Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "#### ERROR_CODE"]

neps/nep-0488.md:465 MD022/blanks-around-headings/blanks-around-headers Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "#### ERROR_CODE"]

Validating the input for the host functions within the contract can consume significant gas.
For instance, verifying if a point belongs to the subgroup is gas-consuming.
If an error is returned by the near host function, the entire execution is reverted.
Expand Down

0 comments on commit b8be6e5

Please sign in to comment.