// finds the curve
 private Curve findCurve(CurveId id, CurveGroup curveGroup)
 {
     return(curveGroup.findCurve(id.CurveName).orElseThrow(() => new System.ArgumentException(Messages.format("No curve found: {}", id.CurveName))));
 }