h */
    GCRY_KDF_ONESTEP_KDF_MAC = 97, /* One-Step Key Derivation with MAC */
    GCRY_KDF_HKDF = 98,
    /* Two-Step Key Derivation with HMAC */
    /* Two-Step Key Derivation with CMAC */
    /* KDF PRF in SP 800-108r1 */
    GCRY_KDF_X963_KDF = 101
  };

enum gcry_kdf_subalgo_argon2
  {
    GCRY_KDF_ARGON2D  = 0,
    GCRY_KDF_ARGON2I  = 1,
    GCRY_KDF_ARGON2ID = 2
  };

/* Derive a key from a passphrase.  */
gpg_error_t gcry_kdf_derive (const void *passphrase, size_t passphraselen,
                             int algo, int subalgo,
                             const void *salt, size_t saltlen,
                             unsigned long iterations,
                             size_t keysize, void *keybuffer);

/* Another API to derive a key from a passphrase.  */
typedef struct gcry_kdf_handle *gcry_kdf_hd_t;

typedef void (*gcry_kdf_job_fn_t) (void *priv);
typedef int (*gcry_kdf_dispatch_job_fn_t) (void *jobs_context,
                                           gcry_kdf_job_fn_t job_fn,
                                           void *job_priv);
typedef int (*gcry_kdf_wait_all_jobs_fn_t) (void *jobs_context);

/* Exposed structure for KDF computation to decouple thread functionality.  */
typedef struct gcry_kdf_thread_ops
{
  void *jobs_context;
  gcry_kdf_dispatch_job_fn_t dispatch_job;
  gcry_kdf_wait_all_jobs_fn_t wait_all_jobs;
} gcry_kdf_thread_ops_t;

gcry_error_t gcry_kdf_open (gcry_kdf_hd_t *hd, int algo, int subalgo,
                            const unsigned long *param, unsigned int paramlen,
                            const void *passphrase, size_t passphraselen,
                            const void *salt, size_t saltlen,
                            const void *key, size_t keylen,
                            const void *ad, size_t adlen);
gcry_error_t gcry_kdf_compute (gcry_kdf_hd_t h,
                               const gcry_kdf_thread_ops_t *ops);
gcry_error_t gcry_kdf_final (gcry_kdf_hd_t h, size_t resultlen, void *result);
void gcry_kdf_close (gcry_kdf_hd_t h);

