aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/kem.c14
-rw-r--r--common/util.h3
2 files changed, 11 insertions, 6 deletions
diff --git a/common/kem.c b/common/kem.c
index fc5575f4f..65e533a83 100644
--- a/common/kem.c
+++ b/common/kem.c
@@ -145,15 +145,20 @@ compute_kmac256 (void *digest, size_t digestlen,
/* Compute KEK for ECC with HASHALGO, ECDH result, ciphertext in
- ECC_CT (which is an ephemeral key), and public key in ECC_PK. */
+ * ECC_CT (which is an ephemeral key), and public key in ECC_PK.
+ *
+ * For traditional ECC (of v4), KDF_PARAMS is specified by upper layer
+ * and an ephemeral key and public key are not used for the
+ * computation.
+ */
gpg_error_t
gnupg_ecc_kem_kdf (void *kek, size_t kek_len,
int hashalgo, const void *ecdh, size_t ecdh_len,
const void *ecc_ct, size_t ecc_ct_len,
const void *ecc_pk, size_t ecc_pk_len,
- gcry_buffer_t *fixed_info)
+ unsigned char *kdf_params, size_t kdf_params_len)
{
- if (fixed_info)
+ if (kdf_params)
{
/* Traditional ECC */
gpg_error_t err;
@@ -163,8 +168,7 @@ gnupg_ecc_kem_kdf (void *kek, size_t kek_len,
param[0] = kek_len;
err = gcry_kdf_open (&hd, GCRY_KDF_ONESTEP_KDF, hashalgo, param, 1,
ecdh, ecdh_len, NULL, 0, NULL, 0,
- (char *)fixed_info->data+fixed_info->off,
- fixed_info->len);
+ kdf_params, kdf_params_len);
if (!err)
{
gcry_kdf_compute (hd, NULL);
diff --git a/common/util.h b/common/util.h
index cd5483a1a..20456349c 100644
--- a/common/util.h
+++ b/common/util.h
@@ -306,7 +306,8 @@ gpg_error_t gnupg_ecc_kem_kdf (void *kek, size_t kek_len,
int hashalgo, const void *ecdh, size_t ecdh_len,
const void *ecc_ct, size_t ecc_ct_len,
const void *ecc_pk, size_t ecc_pk_len,
- gcry_buffer_t *fixed_info);
+ unsigned char *kdf_params,
+ size_t kdf_params_len);
gpg_error_t gnupg_kem_combiner (void *kek, size_t kek_len,
const void *ecc_ss, size_t ecc_ss_len,