]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
hpke: shorten function names by stripping _context_
authorDaiki Ueno <ueno@gnu.org>
Mon, 20 Apr 2026 03:57:32 +0000 (12:57 +0900)
committerDaiki Ueno <ueno@gnu.org>
Sat, 25 Apr 2026 01:31:03 +0000 (10:31 +0900)
Signed-off-by: Daiki Ueno <ueno@gnu.org>
NEWS
devel/libgnutls.abignore
devel/symbols.last
doc/Makefile.am
doc/manpages/Makefile.am
lib/hpke/hpke.c
lib/includes/gnutls/hpke.h
lib/libgnutls.map
tests/hpke-tests.c

diff --git a/NEWS b/NEWS
index e819b8791206edbe2a07683d42d813d23e6e8d3d..4d94730808462fe0714749c2b40dba9ac37e3136 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -34,17 +34,17 @@ gnutls_hpke_aead_t: New enum
 gnutls_hpke_mode_t: New enum
 gnutls_hpke_role_t: New enum
 gnutls_hpke_context_st: New context structure
-gnutls_hpke_context_init: New function
-gnutls_hpke_context_deinit: New function
-gnutls_hpke_context_set_psk: New function
-gnutls_hpke_context_set_sender_privkey: New function
-gnutls_hpke_context_set_sender_pubkey: New function
-gnutls_hpke_context_get_enc_size: New function
+gnutls_hpke_init: New function
+gnutls_hpke_deinit: New function
+gnutls_hpke_set_psk: New function
+gnutls_hpke_set_sender_privkey: New function
+gnutls_hpke_set_sender_pubkey: New function
+gnutls_hpke_get_enc_size: New function
 gnutls_hpke_encap: New function
 gnutls_hpke_seal: New function
 gnutls_hpke_decap: New function
 gnutls_hpke_open: New function
-gnutls_hpke_context_set_ikme: New function
+gnutls_hpke_set_ikme: New function
 gnutls_hpke_generate_keypair: New function
 gnutls_hpke_get_seq: New function
 gnutls_hpke_set_seq: New function
index e3dc01455fb51e999c0e9888e8b7f8bd8c22a5b7..88ca01b338c45b40be02f27c05a42d84730f9dc6 100644 (file)
@@ -77,22 +77,22 @@ name = gnutls_hpke_encap
 name = gnutls_hpke_decap
 
 [suppress_function]
-name = gnutls_hpke_context_init
+name = gnutls_hpke_init
 
 [suppress_function]
-name = gnutls_hpke_context_deinit
+name = gnutls_hpke_deinit
 
 [suppress_function]
-name = gnutls_hpke_context_set_psk
+name = gnutls_hpke_set_psk
 
 [suppress_function]
-name = gnutls_hpke_context_set_sender_privkey
+name = gnutls_hpke_set_sender_privkey
 
 [suppress_function]
-name = gnutls_hpke_context_set_sender_pubkey
+name = gnutls_hpke_set_sender_pubkey
 
 [suppress_function]
-name = gnutls_hpke_context_get_enc_size
+name = gnutls_hpke_get_enc_size
 
 [suppress_function]
 name = gnutls_hpke_seal
@@ -101,7 +101,7 @@ name = gnutls_hpke_seal
 name = gnutls_hpke_open
 
 [suppress_function]
-name = gnutls_hpke_context_set_ikme
+name = gnutls_hpke_set_ikme
 
 [suppress_function]
 name = gnutls_hpke_generate_keypair
index 7ba362a6077607c295ff52506e056958ccdbe0b2..766a8da0296966ca3188231c0f1be3c4839fd502 100644 (file)
@@ -337,13 +337,13 @@ gnutls_hmac_get_len@GNUTLS_3_4
 gnutls_hmac_init@GNUTLS_3_4
 gnutls_hmac_output@GNUTLS_3_4
 gnutls_hmac_set_nonce@GNUTLS_3_4
-gnutls_hpke_context_deinit@GNUTLS_3_8_13
-gnutls_hpke_context_get_enc_size@GNUTLS_3_8_13
-gnutls_hpke_context_init@GNUTLS_3_8_13
-gnutls_hpke_context_set_ikme@GNUTLS_3_8_13
-gnutls_hpke_context_set_psk@GNUTLS_3_8_13
-gnutls_hpke_context_set_sender_privkey@GNUTLS_3_8_13
-gnutls_hpke_context_set_sender_pubkey@GNUTLS_3_8_13
+gnutls_hpke_deinit@GNUTLS_3_8_13
+gnutls_hpke_get_enc_size@GNUTLS_3_8_13
+gnutls_hpke_init@GNUTLS_3_8_13
+gnutls_hpke_set_ikme@GNUTLS_3_8_13
+gnutls_hpke_set_psk@GNUTLS_3_8_13
+gnutls_hpke_set_sender_privkey@GNUTLS_3_8_13
+gnutls_hpke_set_sender_pubkey@GNUTLS_3_8_13
 gnutls_hpke_decap@GNUTLS_3_8_13
 gnutls_hpke_encap@GNUTLS_3_8_13
 gnutls_hpke_export@GNUTLS_3_8_13
index 3edcb2d1919ee374aaded34f96f9353b937db585..8b6cc9658738fd152a51992677174b77f0999549 100644 (file)
@@ -1225,20 +1225,20 @@ FUNCS += functions/gnutls_hmac_output
 FUNCS += functions/gnutls_hmac_output.short
 FUNCS += functions/gnutls_hmac_set_nonce
 FUNCS += functions/gnutls_hmac_set_nonce.short
-FUNCS += functions/gnutls_hpke_context_deinit
-FUNCS += functions/gnutls_hpke_context_deinit.short
-FUNCS += functions/gnutls_hpke_context_get_enc_size
-FUNCS += functions/gnutls_hpke_context_get_enc_size.short
-FUNCS += functions/gnutls_hpke_context_init
-FUNCS += functions/gnutls_hpke_context_init.short
-FUNCS += functions/gnutls_hpke_context_set_ikme
-FUNCS += functions/gnutls_hpke_context_set_ikme.short
-FUNCS += functions/gnutls_hpke_context_set_psk
-FUNCS += functions/gnutls_hpke_context_set_psk.short
-FUNCS += functions/gnutls_hpke_context_set_sender_privkey
-FUNCS += functions/gnutls_hpke_context_set_sender_privkey.short
-FUNCS += functions/gnutls_hpke_context_set_sender_pubkey
-FUNCS += functions/gnutls_hpke_context_set_sender_pubkey.short
+FUNCS += functions/gnutls_hpke_deinit
+FUNCS += functions/gnutls_hpke_deinit.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_set_ikme
+FUNCS += functions/gnutls_hpke_set_ikme.short
+FUNCS += functions/gnutls_hpke_set_psk
+FUNCS += functions/gnutls_hpke_set_psk.short
+FUNCS += functions/gnutls_hpke_set_sender_privkey
+FUNCS += functions/gnutls_hpke_set_sender_privkey.short
+FUNCS += functions/gnutls_hpke_set_sender_pubkey
+FUNCS += functions/gnutls_hpke_set_sender_pubkey.short
 FUNCS += functions/gnutls_hpke_decap
 FUNCS += functions/gnutls_hpke_decap.short
 FUNCS += functions/gnutls_hpke_encap
index 0e53c3625e0bccf7a4e72b6bea115ea95b3ffafd..a01de8cc8738f64bc8bc250cdf55da0aedbe79cb 100644 (file)
@@ -446,13 +446,13 @@ APIMANS += gnutls_hmac_get_len.3
 APIMANS += gnutls_hmac_init.3
 APIMANS += gnutls_hmac_output.3
 APIMANS += gnutls_hmac_set_nonce.3
-APIMANS += gnutls_hpke_context_deinit.3
-APIMANS += gnutls_hpke_context_get_enc_size.3
-APIMANS += gnutls_hpke_context_init.3
-APIMANS += gnutls_hpke_context_set_ikme.3
-APIMANS += gnutls_hpke_context_set_psk.3
-APIMANS += gnutls_hpke_context_set_sender_privkey.3
-APIMANS += gnutls_hpke_context_set_sender_pubkey.3
+APIMANS += gnutls_hpke_deinit.3
+APIMANS += gnutls_hpke_get_enc_size.3
+APIMANS += gnutls_hpke_init.3
+APIMANS += gnutls_hpke_set_ikme.3
+APIMANS += gnutls_hpke_set_psk.3
+APIMANS += gnutls_hpke_set_sender_privkey.3
+APIMANS += gnutls_hpke_set_sender_pubkey.3
 APIMANS += gnutls_hpke_decap.3
 APIMANS += gnutls_hpke_encap.3
 APIMANS += gnutls_hpke_export.3
index 8f58081e664789da1e78fa1ecf20f79ba9f61ee1..f713553b93c63f34cdee2e8a576aa7b34240a2d5 100644 (file)
@@ -658,7 +658,7 @@ cleanup:
 }
 
 /**
- * gnutls_hpke_context_init:
+ * gnutls_hpke_init:
  * @ctx: A pointer to the HPKE context to initialize.
  * @mode: The HPKE mode to use (Base, PSK, Auth, or AuthPSK).
  * @role: The role of the context (Sender or Receiver).
@@ -667,16 +667,13 @@ cleanup:
  * @aead: The AEAD algorithm to use (e.g., AES-128-GCM).
  * This function initializes the HPKE context with the specified parameters.
  * It allocates memory for the context and sets the initial values for the fields based on the provided parameters.
- * The context must be deinitialized using gnutls_hpke_context_deinit() when it
+ * The context must be deinitialized using gnutls_hpke_deinit() when it
  * is no longer needed to free any allocated resources and securely erase sensitive information.
  * Returns: 0 on success, or a negative error code on failure
  */
-int gnutls_hpke_context_init(gnutls_hpke_context_t *ctx,
-                            const gnutls_hpke_mode_t mode,
-                            const gnutls_hpke_role_t role,
-                            const gnutls_hpke_kem_t kem,
-                            const gnutls_hpke_kdf_t kdf,
-                            const gnutls_hpke_aead_t aead)
+int gnutls_hpke_init(gnutls_hpke_context_t *ctx, const gnutls_hpke_mode_t mode,
+                    const gnutls_hpke_role_t role, const gnutls_hpke_kem_t kem,
+                    const gnutls_hpke_kdf_t kdf, const gnutls_hpke_aead_t aead)
 {
        if (ctx == NULL) {
                return gnutls_assert_val(GNUTLS_E_INVALID_REQUEST);
@@ -714,7 +711,7 @@ int gnutls_hpke_context_init(gnutls_hpke_context_t *ctx,
 }
 
 /**
- * gnutls_hpke_context_deinit:
+ * gnutls_hpke_deinit:
  * @ctx: The HPKE context to deinitialize.
  *
  * This function deinitializes the HPKE context and securely erases any
@@ -723,7 +720,7 @@ int gnutls_hpke_context_init(gnutls_hpke_context_t *ctx,
  * to prevent sensitive data from lingering in memory.
  * Returns: 0 on success, or a negative error code on failure.
  */
-int gnutls_hpke_context_deinit(gnutls_hpke_context_t ctx)
+int gnutls_hpke_deinit(gnutls_hpke_context_t ctx)
 {
        if (ctx == NULL) {
                return 0;
@@ -756,21 +753,20 @@ int gnutls_hpke_context_deinit(gnutls_hpke_context_t ctx)
 }
 
 /**
- * gnutls_hpke_context_set_psk:
+ * gnutls_hpke_set_psk:
  * @ctx: The HPKE context to set the PSK for.
  * @psk: A pointer to a gnutls_datum_t structure containing the PSK value and its size.
  * @psk_id: A pointer to a gnutls_datum_t structure containing the PSK identifier and its size.
  *
- * This function sets the PSK and its identifier in the HPKE context. 
+ * This function sets the PSK and its identifier in the HPKE context.
  * It securely erases any existing PSK and PSK identifier in the context before setting the new values.
  * The function checks that the provided PSK and PSK identifier are valid and that the context is in
  * a mode that supports PSKs.
  *
  * It returns 0 on success, or a negative error code on failure.
  */
-int gnutls_hpke_context_set_psk(gnutls_hpke_context_t ctx,
-                               const gnutls_datum_t *psk,
-                               const gnutls_datum_t *psk_id)
+int gnutls_hpke_set_psk(gnutls_hpke_context_t ctx, const gnutls_datum_t *psk,
+                       const gnutls_datum_t *psk_id)
 {
        if (ctx == NULL || psk == NULL || psk_id == NULL) {
                return gnutls_assert_val(GNUTLS_E_INVALID_REQUEST);
@@ -849,7 +845,7 @@ error:
 }
 
 /**
- * gnutls_hpke_context_set_sender_privkey:
+ * gnutls_hpke_set_sender_privkey:
  * @ctx: The HPKE context to set the sender's private key for.
  * @sender_privkey: The sender's private key to set in the context.
  *
@@ -862,8 +858,8 @@ error:
  *
  * It returns 0 on success, or a negative error code on failure.
  */
-int gnutls_hpke_context_set_sender_privkey(gnutls_hpke_context_t ctx,
-                                          gnutls_privkey_t sender_privkey)
+int gnutls_hpke_set_sender_privkey(gnutls_hpke_context_t ctx,
+                                  gnutls_privkey_t sender_privkey)
 {
        if (ctx == NULL || sender_privkey == NULL) {
                return gnutls_assert_val(GNUTLS_E_INVALID_REQUEST);
@@ -884,7 +880,7 @@ int gnutls_hpke_context_set_sender_privkey(gnutls_hpke_context_t ctx,
 }
 
 /**
- * gnutls_hpke_context_set_sender_pubkey:
+ * gnutls_hpke_set_sender_pubkey:
  * @ctx: The HPKE context to set the sender's public key for.
  * @sender_pubkey: The sender's public key to set in the context.
  *
@@ -897,8 +893,8 @@ int gnutls_hpke_context_set_sender_privkey(gnutls_hpke_context_t ctx,
  *
  * It returns 0 on success, or a negative error code on failure.
  */
-int gnutls_hpke_context_set_sender_pubkey(gnutls_hpke_context_t ctx,
-                                         gnutls_pubkey_t sender_pubkey)
+int gnutls_hpke_set_sender_pubkey(gnutls_hpke_context_t ctx,
+                                 gnutls_pubkey_t sender_pubkey)
 {
        if (ctx == NULL || sender_pubkey == NULL) {
                return gnutls_assert_val(GNUTLS_E_INVALID_REQUEST);
@@ -919,7 +915,7 @@ int gnutls_hpke_context_set_sender_pubkey(gnutls_hpke_context_t ctx,
 }
 
 /**
- * gnutls_hpke_context_get_enc_size:
+ * 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
@@ -929,7 +925,7 @@ int gnutls_hpke_context_set_sender_pubkey(gnutls_hpke_context_t ctx,
  * 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_context_get_enc_size(const gnutls_hpke_context_t ctx)
+size_t gnutls_hpke_get_enc_size(const gnutls_hpke_context_t ctx)
 {
        if (ctx == NULL) {
                return 0;
@@ -1364,7 +1360,7 @@ cleanup:
 }
 
 /**
- * gnutls_hpke_context_set_ikme:
+ * gnutls_hpke_set_ikme:
  * @ctx: The HPKE context to set the IKME for.
  * @ikme: A pointer to a gnutls_datum_t structure containing the IKME value and its size.
  *
@@ -1374,8 +1370,7 @@ cleanup:
  *
  * It returns 0 on success, or a negative error code on failure.
  */
-int gnutls_hpke_context_set_ikme(gnutls_hpke_context_t ctx,
-                                const gnutls_datum_t *ikme)
+int gnutls_hpke_set_ikme(gnutls_hpke_context_t ctx, const gnutls_datum_t *ikme)
 {
        if (ctx == NULL || ikme == NULL || ikme->data == NULL) {
                return gnutls_assert_val(GNUTLS_E_INVALID_REQUEST);
@@ -1498,7 +1493,7 @@ int gnutls_hpke_set_seq(gnutls_hpke_context_t ctx, uint64_t seq)
  * gnutls_hpke_export:
  * @ctx: The HPKE context to use for exporting the secret.
  * @exporter_context: A pointer to a gnutls_datum_t structure containing the application-specific context to be included
- * in the export. 
+ * in the export.
  * @L: The length in bytes of the secret to be exported. This should be a positive integer that does not exceed the
  * maximum allowed size for HPKE exports.
  * @secret: A pointer to a gnutls_datum_t structure where the exported secret will be stored. The function will allocate
index 047147578b67921a58cf8aed0eecca4cac9b8ce3..2c028746727a1cea20a5529edb8bc69e864141b4 100644 (file)
@@ -16,9 +16,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public License
-
  * along with this program.  If not, see <https://www.gnu.org/licenses/>
-
  *
  */
 
@@ -104,26 +102,23 @@ typedef enum gnutls_hpke_role_t {
 
 typedef struct gnutls_hpke_context_st *gnutls_hpke_context_t;
 
-int gnutls_hpke_context_init(gnutls_hpke_context_t *ctx,
-                            const gnutls_hpke_mode_t mode,
-                            const gnutls_hpke_role_t role,
-                            const gnutls_hpke_kem_t kem,
-                            const gnutls_hpke_kdf_t kdf,
-                            const gnutls_hpke_aead_t aead);
+int gnutls_hpke_init(gnutls_hpke_context_t *ctx, const gnutls_hpke_mode_t mode,
+                    const gnutls_hpke_role_t role, const gnutls_hpke_kem_t kem,
+                    const gnutls_hpke_kdf_t kdf,
+                    const gnutls_hpke_aead_t aead);
 
-int gnutls_hpke_context_deinit(gnutls_hpke_context_t ctx);
+int gnutls_hpke_deinit(gnutls_hpke_context_t ctx);
 
-int gnutls_hpke_context_set_psk(gnutls_hpke_context_t ctx,
-                               const gnutls_datum_t *psk,
-                               const gnutls_datum_t *psk_id);
+int gnutls_hpke_set_psk(gnutls_hpke_context_t ctx, const gnutls_datum_t *psk,
+                       const gnutls_datum_t *psk_id);
 
-int gnutls_hpke_context_set_sender_privkey(gnutls_hpke_context_t ctx,
-                                          gnutls_privkey_t sender_privkey);
+int gnutls_hpke_set_sender_privkey(gnutls_hpke_context_t ctx,
+                                  gnutls_privkey_t sender_privkey);
 
-int gnutls_hpke_context_set_sender_pubkey(gnutls_hpke_context_t ctx,
-                                         gnutls_pubkey_t sender_pubkey);
+int gnutls_hpke_set_sender_pubkey(gnutls_hpke_context_t ctx,
+                                 gnutls_pubkey_t sender_pubkey);
 
-size_t gnutls_hpke_context_get_enc_size(const 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, gnutls_pubkey_t receiver_pubkey);
@@ -140,8 +135,7 @@ int gnutls_hpke_open(gnutls_hpke_context_t ctx, const gnutls_datum_t *aad,
                     const gnutls_datum_t *ciphertext,
                     gnutls_datum_t *plaintext);
 
-int gnutls_hpke_context_set_ikme(gnutls_hpke_context_t ctx,
-                                const gnutls_datum_t *ikme);
+int gnutls_hpke_set_ikme(gnutls_hpke_context_t ctx, const gnutls_datum_t *ikme);
 
 int gnutls_hpke_generate_keypair(const gnutls_hpke_kem_t kem,
                                 const gnutls_datum_t *ikm,
@@ -159,4 +153,4 @@ int gnutls_hpke_export(gnutls_hpke_context_t ctx,
 }
 #endif
 
-#endif // GNUTLS_HPKE_H
+#endif /* GNUTLS_HPKE_H */
index 7f646dccab102c2ea1dac70f327ff4bae267fe7a..b901bad4883ac3f3e71c18b5acc381f029111849 100644 (file)
@@ -1470,15 +1470,15 @@ GNUTLS_3_8_13
     gnutls_pkcs11_obj_get_pk_algorithm;
     gnutls_hpke_encap;
     gnutls_hpke_decap;
-    gnutls_hpke_context_init;
-    gnutls_hpke_context_deinit;
-    gnutls_hpke_context_set_psk;
-    gnutls_hpke_context_set_sender_privkey;
-    gnutls_hpke_context_set_sender_pubkey;
-    gnutls_hpke_context_get_enc_size;
+    gnutls_hpke_init;
+    gnutls_hpke_deinit;
+    gnutls_hpke_set_psk;
+    gnutls_hpke_set_sender_privkey;
+    gnutls_hpke_set_sender_pubkey;
+    gnutls_hpke_get_enc_size;
     gnutls_hpke_seal;
     gnutls_hpke_open;
-    gnutls_hpke_context_set_ikme;
+    gnutls_hpke_set_ikme;
     gnutls_hpke_generate_keypair;
     gnutls_hpke_get_seq;
     gnutls_hpke_set_seq;
index 8162e842463bcb4c7891d7cae0cc2072775a0525..d8af3ff28b6270396501518588f689ff0dd0eb22 100644 (file)
@@ -117,29 +117,29 @@ static void test_hpke(const hpke_test_parameters_st *params)
        gnutls_datum_t ciphertext_out = { NULL, 0 };
        gnutls_datum_t exporter_out = { NULL, 0 };
 
-       ret = gnutls_hpke_context_init(&sender_ctx, params->mode,
-                                      GNUTLS_HPKE_ROLE_SENDER, params->kem,
-                                      params->kdf, params->aead);
+       ret = gnutls_hpke_init(&sender_ctx, params->mode,
+                              GNUTLS_HPKE_ROLE_SENDER, params->kem,
+                              params->kdf, params->aead);
        if (ret < 0) {
-               fail("gnutls_hpke_context_init (mode: %d, kem: %d, kdf: %d, aead: %d) failed: %s\n",
+               fail("gnutls_hpke_init (mode: %d, kem: %d, kdf: %d, aead: %d) failed: %s\n",
                     params->mode, params->kem, params->kdf, params->aead,
                     gnutls_strerror(ret));
                goto cleanup;
        }
 
-       ret = gnutls_hpke_context_set_ikme(sender_ctx, &params->ikmE);
+       ret = gnutls_hpke_set_ikme(sender_ctx, &params->ikmE);
        if (ret < 0) {
-               fail("gnutls_hpke_context_set_ikme (mode %d, kem: %d, kdf: %d, aead: %d) failed: %s\n",
+               fail("gnutls_hpke_set_ikme (mode %d, kem: %d, kdf: %d, aead: %d) failed: %s\n",
                     params->mode, params->kem, params->kdf, params->aead,
                     gnutls_strerror(ret));
                goto cleanup;
        }
 
        if (params->psk != NULL && params->psk_id != NULL) {
-               ret = gnutls_hpke_context_set_psk(sender_ctx, params->psk,
-                                                 params->psk_id);
+               ret = gnutls_hpke_set_psk(sender_ctx, params->psk,
+                                         params->psk_id);
                if (ret < 0) {
-                       fail("gnutls_hpke_context_set_psk (mode %d, kem: %d, kdf: %d, aead: %d) failed: %s\n",
+                       fail("gnutls_hpke_set_psk (mode %d, kem: %d, kdf: %d, aead: %d) failed: %s\n",
                             params->mode, params->kem, params->kdf,
                             params->aead, gnutls_strerror(ret));
                        goto cleanup;
@@ -156,9 +156,9 @@ static void test_hpke(const hpke_test_parameters_st *params)
                        goto cleanup;
                }
 
-               ret = gnutls_hpke_context_set_sender_privkey(sender_ctx, skS);
+               ret = gnutls_hpke_set_sender_privkey(sender_ctx, skS);
                if (ret < 0) {
-                       fail("gnutls_hpke_context_set_sender_privkey (mode %d, kem: %d, kdf: %d, aead: %d) failed: %s\n",
+                       fail("gnutls_hpke_set_sender_privkey (mode %d, kem: %d, kdf: %d, aead: %d) failed: %s\n",
                             params->mode, params->kem, params->kdf,
                             params->aead, gnutls_strerror(ret));
                        goto cleanup;
@@ -189,9 +189,9 @@ static void test_hpke(const hpke_test_parameters_st *params)
                goto cleanup;
        }
 
-       ret = gnutls_hpke_context_init(&receiver_ctx, params->mode,
-                                      GNUTLS_HPKE_ROLE_RECEIVER, params->kem,
-                                      params->kdf, params->aead);
+       ret = gnutls_hpke_init(&receiver_ctx, params->mode,
+                              GNUTLS_HPKE_ROLE_RECEIVER, params->kem,
+                              params->kdf, params->aead);
        if (ret < 0) {
                fail("gnutls_context_init (mode %d, kem: %d, kdf: %d, aead: %d) failed: %s\n",
                     params->mode, params->kem, params->kdf, params->aead,
@@ -200,10 +200,10 @@ static void test_hpke(const hpke_test_parameters_st *params)
        }
 
        if (params->psk != NULL && params->psk_id != NULL) {
-               ret = gnutls_hpke_context_set_psk(receiver_ctx, params->psk,
-                                                 params->psk_id);
+               ret = gnutls_hpke_set_psk(receiver_ctx, params->psk,
+                                         params->psk_id);
                if (ret < 0) {
-                       fail("gnutls_hpke_context_set_psk (mode %d, kem: %d, kdf: %d, aead: %d) failed: %s\n",
+                       fail("gnutls_hpke_set_psk (mode %d, kem: %d, kdf: %d, aead: %d) failed: %s\n",
                             params->mode, params->kem, params->kdf,
                             params->aead, gnutls_strerror(ret));
                        goto cleanup;
@@ -211,9 +211,9 @@ static void test_hpke(const hpke_test_parameters_st *params)
        }
 
        if (params->ikmS != NULL) {
-               ret = gnutls_hpke_context_set_sender_pubkey(receiver_ctx, pkS);
+               ret = gnutls_hpke_set_sender_pubkey(receiver_ctx, pkS);
                if (ret < 0) {
-                       fail("gnutls_hpke_context_set_sender_pubkey (mode %d, kem: %d, kdf: %d, aead: %d) failed: %s\n",
+                       fail("gnutls_hpke_set_sender_pubkey (mode %d, kem: %d, kdf: %d, aead: %d) failed: %s\n",
                             params->mode, params->kem, params->kdf,
                             params->aead, gnutls_strerror(ret));
                        goto cleanup;
@@ -322,8 +322,8 @@ cleanup:
        gnutls_pubkey_deinit(pkR);
        gnutls_privkey_deinit(skS);
        gnutls_pubkey_deinit(pkS);
-       gnutls_hpke_context_deinit(sender_ctx);
-       gnutls_hpke_context_deinit(receiver_ctx);
+       gnutls_hpke_deinit(sender_ctx);
+       gnutls_hpke_deinit(receiver_ctx);
 
        if (enc.data != NULL) {
                gnutls_free(enc.data);