public static int getEncodedPrivateKeyLength(HpkeParameters.KemId kemId)
      throws GeneralSecurityException {
    if (kemId == HpkeParameters.KemId.DHKEM_X25519_HKDF_SHA256) {
      return 32;
    }
    if (kemId == HpkeParameters.KemId.DHKEM_P256_HKDF_SHA256) {
      return 32;
    }
    if (kemId == HpkeParameters.KemId.DHKEM_P384_HKDF_SHA384) {
      return 48;
    }
    if (kemId == HpkeParameters.KemId.DHKEM_P521_HKDF_SHA512) {
      return 66;
    }
    throw new GeneralSecurityException("Unrecognized HPKE KEM identifier");
  }
Lengths from 'Nsk' column in https://www.rfc-editor.org/rfc/rfc9180.html#table-2.
java_src/src/main/java/com/google/crypto/tink/hybrid/internal/HpkeUtil.java