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_bytesto be the canonical unsigned little-endian encoding of , which is an integer mod .s_byteshas extra0x00bytes appended to reach a length of 32 bytes.