Skip to content

Commit

Permalink
change point, sign order
Browse files Browse the repository at this point in the history
  • Loading branch information
olga24912 committed Nov 17, 2023
1 parent e47f922 commit d9b039a
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions neps/nep-0488.md
Original file line number Diff line number Diff line change
Expand Up @@ -718,13 +718,13 @@ ERROR_CODEs consistent with blst errors[^58].

***Description:***

The function computes the sum of the signed elements of the BLS12-381 curve. The input is an arbitrary number of pairs $(p_i, s_i)$, where $p_i \in E(F_p)$ is point on elliptic curve and $s_i \in \textbraceleft 0, 1 \textbraceright$ is the point sign. The output is one point from $E(F_p)$ equal to $\sum (-1)^{s_i}p_i$.
The function computes the sum of the signed elements of the BLS12-381 curve. The input is an arbitrary number of pairs $(s_i, p_i)$, where $p_i \in E(F_p)$ is point on elliptic curve and $s_i \in \textbraceleft 0, 1 \textbraceright$ is the point sign. The output is one point from $E(F_p)$ equal to $\sum (-1)^{s_i}p_i$.

The $E(F_p)$ curve, points on the curve, multiplication on -1, and the addition operation are defined in the BLS12-381 Curve Specification section.

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.
***Input:*** the sequence of pairs $(s_i, p_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.

Expand Down Expand Up @@ -785,11 +785,11 @@ We can use all the tests for addition for Ethereum[^47],[^48] to check the case
///
/// # Arguments
///
/// * `value` - sequence of (pi, si) where pi is point(x:Fp, y:Fp) on BLS-381 curve and si is sign (0 for +, and 1 for -)
/// * `value` - sequence of (si, pi) where pi is point(x:Fp, y:Fp) on BLS-381 curve and si is sign (0 for +, and 1 for -)
/// BLS12-381 is Y^2 = X^3 + 4 curve over Fp.
///
/// `value` is encoded as packed, big-endian
/// `[(([u8; 48], [u8; 48]), u8)]` slice.
/// `[(u8, ([u8; 48], [u8; 48]))]` slice.
///
/// # Errors
///
Expand All @@ -813,13 +813,13 @@ pub fn bls12381_g1_sum(&mut self,

***Description:***

The function computes the sum of the signed elements of the BLS12-381 curve. The input is an arbitrary number of pairs $(p_i, s_i)$, where $p_i \in E'(F_{p^2})$ is point on elliptic curve and $s_i \in \textbraceleft 0, 1 \textbraceright$ is the point sign. The output is one point from $E'(F_{p^2})$ equal to $\sum (-1)^{s_i}p_i$.
The function computes the sum of the signed elements of the BLS12-381 curve. The input is an arbitrary number of pairs $(s_i, p_i)$, where $p_i \in E'(F_{p^2})$ is point on elliptic curve and $s_i \in \textbraceleft 0, 1 \textbraceright$ is the point sign. The output is one point from $E'(F_{p^2})$ equal to $\sum (-1)^{s_i}p_i$.

The $E'(F_{p^2})$ curve, points on the curve, multiplication on -1, and the addition operation are defined in the BLS12-381 Curve Specification section.

Note: we take as input any points on the curve, not only from $G_2$

***Input:*** the sequence of pairs $(p_i, s_i)$, where $p_i \in E'(F_{p^2})$ is point and $s_i \in \textbraceleft 0, 1 \textbraceright$ is sign, each point encoded in decompress form as $(x\colon F_{p^2}, y\colon F_{p^2})$ and sign encoded in one byte. Expected `193*k` bytes as an input that is interpreted as byte concatenation of `k` slices, each slice is the uncompressed point from $E'(F_{p^2})$ and the point sign. More details are in the Curve Points Encoding section.
***Input:*** the sequence of pairs $(s_i, p_i)$, where $p_i \in E'(F_{p^2})$ is point and $s_i \in \textbraceleft 0, 1 \textbraceright$ is sign, each point encoded in decompress form as $(x\colon F_{p^2}, y\colon F_{p^2})$ and sign encoded in one byte. Expected `193*k` bytes as an input that is interpreted as byte concatenation of `k` slices, each slice is the uncompressed point from $E'(F_{p^2})$ and the point sign. More details are in the Curve Points Encoding section.

***Output:***
the ERROR_CODE is returned.
Expand Down Expand Up @@ -864,11 +864,11 @@ We can use all the tests for addition for Ethereum[^47],[^48] to check the case
///
/// # Arguments
///
/// * `value` - sequence of (pi, si), where pi is point(x:Fp^2, y:Fp^2) on BLS-381 curve and si is sign (0 for +, 1 for -)
/// * `value` - sequence of (si, pi), where pi is point(x:Fp^2, y:Fp^2) on BLS-381 curve and si is sign (0 for +, 1 for -)
/// BLS12-381 is Y^2 = X^3 + 4(i + 1) curve over Fp^2.
///
/// `value` is encoded as packed, big-endian
/// `[(([u8; 96], [u8; 96]), u8)]` slice.
/// `[(u8, ([u8; 96], [u8; 96]))]` slice.
///
/// # Errors
///
Expand Down

0 comments on commit d9b039a

Please sign in to comment.