]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
hpke: stop exposing gnutls_hpke_get_enc_size from public API
authorDaiki Ueno <ueno@gnu.org>
Mon, 20 Apr 2026 13:09:59 +0000 (22:09 +0900)
committerDaiki Ueno <ueno@gnu.org>
Sun, 26 Apr 2026 01:02:23 +0000 (10:02 +0900)
Given gnutls_hpke_encap allocates the "enc" anyway, having a special
function to get the size doesn't make much sense.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
NEWS
devel/symbols.last
doc/Makefile.am
doc/manpages/Makefile.am
lib/hpke/hpke.c
lib/includes/gnutls/hpke.h
lib/libgnutls.map

diff --git a/NEWS b/NEWS
index 696a608b0b2f8f7fc01a1a08eb8ee718e1c8fa58..3aea607e899b345699ec0bb2ee2cad5295c09ae1 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -36,7 +36,6 @@ gnutls_hpke_role_t: New enum
 gnutls_hpke_context_st: New context structure
 gnutls_hpke_init: New function
 gnutls_hpke_deinit: New function
-gnutls_hpke_get_enc_size: New function
 gnutls_hpke_encap: New function
 gnutls_hpke_seal: New function
 gnutls_hpke_decap: New function
index 3fcf1bd8f2267a00482271079d776bcf6480bfec..dec279292ec4182df6a8901cc951579b6fcdca84 100644 (file)
@@ -342,7 +342,6 @@ gnutls_hpke_deinit@GNUTLS_3_8_13
 gnutls_hpke_derive_keypair@GNUTLS_3_8_13
 gnutls_hpke_encap@GNUTLS_3_8_13
 gnutls_hpke_export@GNUTLS_3_8_13
-gnutls_hpke_get_enc_size@GNUTLS_3_8_13
 gnutls_hpke_init@GNUTLS_3_8_13
 gnutls_hpke_open@GNUTLS_3_8_13
 gnutls_hpke_seal@GNUTLS_3_8_13
index 041e73bf213fdf4b65ca207a1bfca765c31afdf7..9b3603d756077fb21efb84937a6429f08179d124 100644 (file)
@@ -1240,8 +1240,6 @@ FUNCS += functions/gnutls_hpke_encap
 FUNCS += functions/gnutls_hpke_encap.short
 FUNCS += functions/gnutls_hpke_export
 FUNCS += functions/gnutls_hpke_export.short
-FUNCS += functions/gnutls_hpke_get_enc_size
-FUNCS += functions/gnutls_hpke_get_enc_size.short
 FUNCS += functions/gnutls_hpke_init
 FUNCS += functions/gnutls_hpke_init.short
 FUNCS += functions/gnutls_hpke_open
index 0202694a5d0fe383da6ad363012ac03f13a1ea71..35a009ae6eb6d17949421253a77c877db68e5c3c 100644 (file)
@@ -451,7 +451,6 @@ APIMANS += gnutls_hpke_deinit.3
 APIMANS += gnutls_hpke_derive_keypair.3
 APIMANS += gnutls_hpke_encap.3
 APIMANS += gnutls_hpke_export.3
-APIMANS += gnutls_hpke_get_enc_size.3
 APIMANS += gnutls_hpke_init.3
 APIMANS += gnutls_hpke_open.3
 APIMANS += gnutls_hpke_seal.3
index 7683dac036c73cfffe314a1336cb50218c7b8cec..d0cd75f910231165df8aee9d49f0bf84e578d32b 100644 (file)
@@ -753,31 +753,6 @@ int gnutls_hpke_deinit(gnutls_hpke_context_t ctx)
        return 0;
 }
 
-/**
- * gnutls_hpke_get_enc_size:
- * @ctx: The HPKE context to get the encapsulated key size for.
- *
- * This function returns the size of the encapsulated key (enc) that will be generated by gnutls_hpke_encap() for the
- * given HPKE context. The size of the encapsulated key depends on the KEM algorithm used in the context. For example,
- * for DHKEM(X25519), the encapsulated key size will be 32 bytes.
- *
- * It returns the size of the encapsulated key in bytes, or 0 if the context is NULL or if there is an error determining
- * the size.
- */
-size_t gnutls_hpke_get_enc_size(const gnutls_hpke_context_t ctx)
-{
-       if (ctx == NULL) {
-               return 0;
-       }
-
-       gnutls_ecc_curve_t curve = _gnutls_hpke_kem_to_curve(ctx->kem);
-       if (curve == GNUTLS_ECC_CURVE_INVALID) {
-               return 0;
-       }
-
-       return gnutls_ecc_curve_get_size(curve);
-}
-
 /**
  * gnutls_hpke_encap:
  * @ctx: The HPKE context to use for encapsulation.
index 4a4b2dcd26ae13710c71276b9d0d3ffe40b47aeb..3bf980959eda819400f51c80b1758216295936c9 100644 (file)
@@ -110,8 +110,6 @@ int gnutls_hpke_init(gnutls_hpke_context_t *ctx, gnutls_hpke_mode_t mode,
 
 int gnutls_hpke_deinit(gnutls_hpke_context_t ctx);
 
-size_t gnutls_hpke_get_enc_size(const gnutls_hpke_context_t ctx);
-
 int gnutls_hpke_encap(gnutls_hpke_context_t ctx, const gnutls_datum_t *info,
                      gnutls_datum_t *enc,
                      const gnutls_pubkey_t receiver_pubkey,
index 6a71ac05fec823880bdf4df7878ec27bfbfa8377..7871d636d738dfce8eadc30f2ecc8abb65e8c297 100644 (file)
@@ -1472,7 +1472,6 @@ GNUTLS_3_8_13
     gnutls_hpke_decap;
     gnutls_hpke_init;
     gnutls_hpke_deinit;
-    gnutls_hpke_get_enc_size;
     gnutls_hpke_seal;
     gnutls_hpke_open;
     gnutls_hpke_derive_keypair;