parse_ecc_curve (const unsigned char *buffer, size_t buflen)
{
  int curve;

  if (buflen == 5 && buffer[5] == 0x22)
    curve = CURVE_NIST_P384;
  else if (buflen == 5 && buffer[5] == 0x23)
    curve = CURVE_NIST_P521;
  else if (buflen == 8)
    curve = CURVE_NIST_P256;
  else if (buflen == 5 && buffer[5] == 0x0a)
    curve = CURVE_SEC_P256K1;
  else if (buflen == 9)
    curve = CURVE_ED25519;
  else
    curve = CURVE_UNKNOWN;

  return curve;
}
parse_ecc_curve (const unsigned char *buffer, size_t buflen)
{
  int curve;

  if (buflen == 5 && buffer[5] == 0x22)
    curve = CURVE_NIST_P384;
  else if (buflen == 5 && buffer[5] == 0x23)
    curve = CURVE_NIST_P521;
  else if (buflen == 8)
    curve = CURVE_NIST_P256;
  else if (buflen == 5 && buffer[5] == 0x0a)
    curve = CURVE_SEC_P256K1;
  else if (buflen == 9)
    curve = CURVE_ED25519;
  else
    curve = CURVE_UNKNOWN;

  return curve;
}