Encoding
Given a representative in extended coordinates , encoding works as follows where and are the curve parameters as described here.
-
.
-
(_ignored, v) = sqrt_ratio_zeta(1, u_1 * (a - d) * X^2)
. -
(sign check 1).
-
.
-
.
-
Set
s_bytes
to be the canonical unsigned little-endian encoding of , which is an integer mod .s_bytes
has extra0x00
bytes appended to reach a length of 32 bytes.