Skip to content

Commit

Permalink
fix formating
Browse files Browse the repository at this point in the history
  • Loading branch information
olga24912 committed Nov 17, 2023
1 parent 90cb55f commit e47f922
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions neps/nep-0488.md
Original file line number Diff line number Diff line change
Expand Up @@ -727,6 +727,7 @@ Note: we take as input any points on the curve, not only from $G_1$
***Input:*** the sequence of pairs $(p_i, s_i)$, where $p_i \in E(F_p)$ is point and $s_i \in \textbraceleft 0, 1 \textbraceright$ is sign, each point encoded in decompress form as $(x\colon F_p, y\colon F_p)$ and sign encoded in one byte with only two allowed values: 0, 1. Expected `97*k` bytes as an input that is interpreted as byte concatenation of `k` slices, each slice is the uncompressed point from $E(F_p)$ and a bool value for point sign. More details are in the Curve Points Encoding section.

***Output:*** the ERROR_CODE is returned.

- If the input is correct: ERROR_CODE = 0, the output is 96 bytes — the one point $\in E(F_p)$ in decompressed form. For empty input it returns point on infinity (see Curve Points Encoding section).
- If the field elements encoded incorrectly (see Curve points encoded section): ERROR_CODE = 1, the output is empty
- If point not on the curve: ERROR_CODE = 2, the output is empty
Expand Down Expand Up @@ -822,6 +823,7 @@ Note: we take as input any points on the curve, not only from $G_2$

***Output:***
the ERROR_CODE is returned.

- If the input is correct: ERROR_CODE = 0, the output is 192 bytes — the one point $\in E'(F_{p^2})$ in decompressed form. For empty input it returns point on infinity(see Curve Points Encoding section).
- If extension field elements encoded incorrectly (see Curve points encoded section): ERROR_CODE = 1, the output is empty
- If point not on the curve: ERROR_CODE = 2, the output is empty
Expand Down Expand Up @@ -909,6 +911,7 @@ Note:

***Output:***
the ERROR_CODE is returned.

- If the input is correct: ERROR_CODE = 0, the output is 96 bytes — the one point $\in E(F_p)$ in decompressed form. For empty input it returns point on infinity (see Curve Points Encoding section).
- If field elements encoded incorrectly (see Curve points encoded section): ERROR_CODE = 1, the output is empty
- If point not on the curve: ERROR_CODE = 2, the output is empty
Expand Down Expand Up @@ -1011,6 +1014,7 @@ Each point is encoded in decompress form as $(x\colon F_{p^2}, y\colon F_{p^2})$
***Output:***

the ERROR_CODE is returned.

- If the input is correct: ERROR_CODE = 0, the output is 96 bytes — the one point $\in E(F_p)$ in decompressed form. For empty input it returns point on infinity (see Curve Points Encoding section).
- If field elements encoded incorrectly (see Curve points encoded section): ERROR_CODE = 1, the output is empty
- If point not on the curve: ERROR_CODE = 2, the output is empty
Expand Down Expand Up @@ -1093,8 +1097,9 @@ The function takes the element $a \in F_p$ and maps it to the $G_1 \subset E(F_p
***Output:***

the ERROR_CODE is returned.
* If the input is correct: ERROR_CODE = 0, the output is 96 bytes — the one point $\in E(F_p)$ in decompressed form. For empty input it returns point on infinity (see Curve Points Encoding section).
* $a \ge p$: ERROR_CODE = 1, the output is empty

- If the input is correct: ERROR_CODE = 0, the output is 96 bytes — the one point $\in E(F_p)$ in decompressed form. For empty input it returns point on infinity (see Curve Points Encoding section).
- $a \ge p$: ERROR_CODE = 1, the output is empty

the output is `96 bytes` — one point $\in G_1 \subset E(F_p)$ in decompressed format. More details are in the Curve Points Encoding section.

Expand Down Expand Up @@ -1155,6 +1160,7 @@ The function takes the element $a \in F_{p^2}$ and maps it to the $G_2 \subset E
***Output:***

the ERROR_CODE is returned.

- If the input is correct: ERROR_CODE = 0, the output is 96 bytes — the one point $\in E(F_p)$ in decompressed form. For empty input it returns point on infinity (see Curve Points Encoding section).
- If value is not a valid extension field $F_{p^2}$ element: ERROR_CODE = 1, the output is empty

Expand Down Expand Up @@ -1232,7 +1238,9 @@ We don’t calculate the pairing function itself: the result will be in the huge
***Input:*** the sequence of pairs $(p_i, q_i)$, where $p_i \in G_1 \subset E(F_{p})$ and $q_i \in G_2 \subset E'(F_{p^2})$. Each point is encoded in decompressed form. Expected `288*k` bytes as an input that is interpreted as byte concatenation of `k` slices, each slice is the concatenation of uncompressed point from $G_1 \subset E(F_p)$ — `96 bytes` and point from $G_2 \subset E'(F_{p^2})$ — `192 bytes`. More details are in the Curve Points Encoding section.

***Output:***

the ERROR_CODE is returned.

- If the input is correct and the pairing result is equal to multiplicative identity : ERROR_CODE = 0
- If field elements encoded incorrectly (see Curve points encoded section): ERROR_CODE = 1
- If point not on the curve: ERROR_CODE = 2
Expand Down Expand Up @@ -1313,7 +1321,9 @@ pub fn bls12381_pairing_check(&mut self, value_len: u64, value_ptr: u64) -> Resu
***Input:*** the sequence of point $p_i \in E(F_p)$, each point encoded in compressed form. Expected `48*k` bytes as an input that is interpreted as byte concatenation of `k` slices, each slice is the compressed point from $E(F_p)$. More details are in the Curve Points Encoding section.

***Output:***

the ERROR_CODE is returned.

- If the input is correct: ERROR_CODE = 0, the output is the sequence of point $p_i \in E(F_p)$, each point encoded in decompressed form. Expected `96*k` bytes as an output that is interpreted as byte concatenation of `k` slices, each slice is the decompressed point from $E(F_p)$. `k` the same as in input. More details are in the Curve Points Encoding section.
- If field elements encoded incorrectly (see Curve points encoded section): ERROR_CODE = 1, the output is empty
- If point not on the curve: ERROR_CODE = 2, the output is empty
Expand Down Expand Up @@ -1386,7 +1396,9 @@ pub fn bls12381_decompress_g1(&mut self,
***Input:*** the sequence of point $p_i \in E'(F_{p^2})$, each point encoded in compressed form. Expected `96*k` bytes as an input that is interpreted as byte concatenation of `k` slices, each slice is the compressed point from $E'(F_{p^2})$. More details are in the Curve Points Encoding section.

***Output:***

the ERROR_CODE is returned.

- If the input is correct: ERROR_CODE = 0, the output is the sequence of point $p_i \in E'(F_{p^2})$, each point encoded in decompressed form. Expected `192*k` bytes as an output that is interpreted as byte concatenation of `k` slices, each slice is the decompressed point from $E'(F_{p^2})$. `k` the same as in input. More details are in the Curve Points Encoding section.
- If field elements encoded incorrectly (see Curve points encoded section): ERROR_CODE = 1, the output is empty
- If point not on the curve: ERROR_CODE = 2, the output is empty
Expand Down

0 comments on commit e47f922

Please sign in to comment.