/**
   * Returns the bit size of a given curve. TODO(bleichen): add all curves that
   * are tested.
   */
public static int getCurveSize(String name) throws NoSuchAlgorithmException {
    name = name.toLowerCase();
    if (name.equals("secp224r1")) {
      return 224;
    } else if (name.equals("secp256r1")) {
      return 256;
    } else if (name.equals("secp384r1")) {
      return 384;
    } else if (name.equals("secp521r1")) {
      return 521;
    } else if (name.equals("secp256k1")) {
      return 256;
    } else if (name.equals("brainpoolp224r1")) {
      return 224;
    } else if (name.equals("brainpoolp224t1")) {
      return 224;
    } else if (name.equals("brainpoolp256r1")) {
      return 256;
    } else if (name.equals("brainpoolp256t1")) {
      return 256;
    } else if (name.equals("brainpoolp320r1")) {
      return 320;
    } else if (name.equals("brainpoolp320t1")) {
      return 320;
    } else if (name.equals("brainpoolp384r1")) {
      return 384;
    } else if (name.equals("brainpoolp384t1")) {
      return 384;
    } else if (name.equals("brainpoolp512r1")) {
      return 512;
    } else if (name.equals("brainpoolp512t1")) {
      return 512;
    } else {
      throw new NoSuchAlgorithmException("Curve not implemented:" + name);
    }
  }
public static int getCurveSize(String name) throws NoSuchAlgorithmException {
name = name.toLowerCase();
if (name.equals("secp224r1")) {
return 224;
} else if (name.equals("secp256r1")) {
return 256;
} else if (name.equals("secp384r1")) {
return 384;
} else if (name.equals("secp521r1")) {
return 521;
} else if (name.equals("secp256k1")) {
return 256;
} else if (name.equals("brainpoolp224r1")) {
return 224;
} else if (name.equals("brainpoolp224t1")) {
return 224;
} else if (name.equals("brainpoolp256r1")) {
return 256;
} else if (name.equals("brainpoolp256t1")) {
return 256;
} else if (name.equals("brainpoolp320r1")) {
return 320;
} else if (name.equals("brainpoolp320t1")) {
return 320;
} else if (name.equals("brainpoolp384r1")) {
return 384;
} else if (name.equals("brainpoolp384t1")) {
return 384;
} else if (name.equals("brainpoolp512r1")) {
return 512;
} else if (name.equals("brainpoolp512t1")) {
return 512;
} else {
throw new NoSuchAlgorithmException("Curve not implemented:" + name);
}
}
public static int getCurveSize(String name) throws NoSuchAlgorithmException {
name = name.toLowerCase();
if (name.equals("secp224r1")) {
return 224;
} else if (name.equals("secp256r1")) {
return 256;
} else if (name.equals("secp384r1")) {
return 384;
} else if (name.equals("secp521r1")) {
return 521;
} else if (name.equals("secp256k1")) {
return 256;
} else if (name.equals("brainpoolp224r1")) {
return 224;
} else if (name.equals("brainpoolp224t1")) {
return 224;
} else if (name.equals("brainpoolp256r1")) {
return 256;
} else if (name.equals("brainpoolp256t1")) {
return 256;
} else if (name.equals("brainpoolp320r1")) {
return 320;
} else if (name.equals("brainpoolp320t1")) {
return 320;
} else if (name.equals("brainpoolp384r1")) {
return 384;
} else if (name.equals("brainpoolp384t1")) {
return 384;
} else if (name.equals("brainpoolp512r1")) {
return 512;
} else if (name.equals("brainpoolp512t1")) {
return 512;
} else {
throw new NoSuchAlgorithmException("Curve not implemented:" + name);
}
}
public static int getCurveSize(String name) throws NoSuchAlgorithmException {
name = name.toLowerCase();
if (name.equals("secp224r1")) {
return 224;
} else if (name.equals("secp256r1")) {
return 256;
} else if (name.equals("secp384r1")) {
return 384;
} else if (name.equals("secp521r1")) {
return 521;
} else if (name.equals("secp256k1")) {
return 256;
} else if (name.equals("brainpoolp224r1")) {
return 224;
} else if (name.equals("brainpoolp224t1")) {
return 224;
} else if (name.equals("brainpoolp256r1")) {
return 256;
} else if (name.equals("brainpoolp256t1")) {
return 256;
} else if (name.equals("brainpoolp320r1")) {
return 320;
} else if (name.equals("brainpoolp320t1")) {
return 320;
} else if (name.equals("brainpoolp384r1")) {
return 384;
} else if (name.equals("brainpoolp384t1")) {
return 384;
} else if (name.equals("brainpoolp512r1")) {
return 512;
} else if (name.equals("brainpoolp512t1")) {
return 512;
} else {
throw new NoSuchAlgorithmException("Curve not implemented:" + name);
}
}