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