In the current implementation of the toAffine method within the @noble-ed25519 library, there is an incorrect handling of the point at infinity O when transforming from projective to affine coordinates. Specifically, the point at infinity is incorrectly encoded as (0, 0) for the ed25519 curve.
if (this.is0()) return { x: 0n, y: 0n };
However, for the ed25519 curve, the point at infinity should be represented by (0, 1) in affine coordinates to satisfy the curve equation and ensure correct computations during export and import operations.
In the current implementation of the
toAffine
method within the@noble-ed25519
library, there is an incorrect handling of the point at infinity O when transforming from projective to affine coordinates. Specifically, the point at infinity is incorrectly encoded as(0, 0)
for the ed25519 curve.However, for the ed25519 curve, the point at infinity should be represented by (0, 1) in affine coordinates to satisfy the curve equation and ensure correct computations during export and import operations.
We can fix it by doing this :
Solved with @Elli610