blob: a439d35396fed5c8eedf541cd7678984579b6a4d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
> [Index](../README.md)
# Torsion
One important gotcha for elliptic curves with a cofactor, is that it is possible to find points which satisfy the curve equation, but that are not part of the subgroup defined by the generator point (i.e., a point that cannot be expressed as `n * G` for some scalar `n` and the generator point `G`). This is referred to as "torsion".
It is important to check that points are part of the main subgroup when they are constructed from coordinates, as points with torsion can be used in various attacks. The simplest way to check that a point is part of the main subgroup is to multiply it by the curve order. If the result is the point at infinity, then the point is part of the main subgroup, otherwise it is not (as the other subgroup orders are coprime with the main subgroup order; _I think_).
There are more performant methods to check for subgroup membership using endomorphisms (an endomorphism in this context is a "trick"/optimization for computing very specific scalar multiplication on points - using a specific endomorphism, you can more quickly check subgroup inclusion - for more details, see links in resources). Since this is not particularly interesting in the context of PLONK, I decided no to implement this and simply use the scalar multiplication with the group order check for subgroup membership.
# Resources
- [Faster Subgroup Checks for BLS12-381](https://eprint.iacr.org/2019/814.pdf)
- [A note on group membership tests for G1, G2 and GT on BLS pairing-friendly curves](https://eprint.iacr.org/2021/1130.pdf)
- [blst](https://github.com/supranational/blst/blob/52cc60d78591a56abb2f3d0bd1cdafc6ba242997/src/map_to_g1.c#L512-L544)
> [Index](../README.md)
|