summaryrefslogtreecommitdiffstats
path: root/common/util.h
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2024-04-10 04:09:29 +0200
committerNIIBE Yutaka <gniibe@fsij.org>2024-04-10 04:09:29 +0200
commit04b81ec236cf66987a77e0aaafd9f2363daac60c (patch)
tree2c9450ae19a95cb66ea4fa12fd3fdf1460205e21 /common/util.h
parentgpg: Some support to allow Kyber decryption. (diff)
downloadgnupg2-04b81ec236cf66987a77e0aaafd9f2363daac60c.tar.xz
gnupg2-04b81ec236cf66987a77e0aaafd9f2363daac60c.zip
common,agent: Factor out KEM functions into common/kem.c.
* common/util.h (compute_kmac256): Remove. (gnupg_ecc_kem_kdf, gnupg_kem_combiner): New. * common/kmac.c (compute_kmac256): Don't expose. (gnupg_ecc_kem_kdf, gnupg_kem_combiner): New. * agent/pkdecrypt.c (agent_hybrid_pgp_kem_decrypt): Use gnupg_ecc_kem_kdf and gnupg_kem_combiner. -- Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
Diffstat (limited to 'common/util.h')
-rw-r--r--common/util.h17
1 files changed, 12 insertions, 5 deletions
diff --git a/common/util.h b/common/util.h
index 7b2601db1..5c953a8a1 100644
--- a/common/util.h
+++ b/common/util.h
@@ -299,11 +299,18 @@ char *gnupg_get_help_string (const char *key, int only_current_locale);
/*-- localename.c --*/
const char *gnupg_messages_locale_name (void);
-/*-- kmac.c --*/
-gpg_error_t compute_kmac256 (void *digest, size_t digestlen,
- const void *key, size_t keylen,
- const void *custom, size_t customlen,
- gcry_buffer_t *data_iov, int data_iovlen);
+/*-- kem.c --*/
+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);
+
+gpg_error_t gnupg_kem_combiner (void *kek, size_t kek_len,
+ const void *ecc_ss, size_t ecc_ss_len,
+ const void *ecc_ct, size_t ecc_ct_len,
+ const void *mlkem_ss, size_t mlkem_ss_len,
+ const void *mlkem_ct, size_t mlkem_ct_len,
+ const void *fixedinfo, size_t fixedinfo_len);
/*-- miscellaneous.c --*/