G2AffinePoint.fromBytes constructor
Creates a G2 affine point from bytes, validating that it is on-curve and in the correct subgroup.
Implementation
factory G2AffinePoint.fromBytes(List<int> bytes) {
final affine = G2AffinePoint.fromBytesUnchecked(bytes);
if (affine.isOnCurve() && affine.isTorsionFree()) {
return affine;
}
throw ArgumentException.invalidOperationArguments(
"fromBytes",
reason: "Invalid G2 encoding.",
);
}