1 /* ghmac.h - secure data hashing
3 * Copyright (C) 2011 Stef Walter <stefw@collabora.co.uk>
5 * SPDX-License-Identifier: LGPL-2.1-or-later
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public License
18 * along with this library; if not, see <http://www.gnu.org/licenses/>.
24 #if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
25 #error "Only <glib.h> can be included directly."
28 #include <glib/gtypes.h>
29 #include "gchecksum.h"
36 * An opaque structure representing a HMAC operation.
37 * To create a new GHmac, use g_hmac_new(). To free
38 * a GHmac, use g_hmac_unref().
42 typedef struct _GHmac GHmac;
44 GLIB_AVAILABLE_IN_2_30
45 GHmac * g_hmac_new (GChecksumType digest_type,
48 GLIB_AVAILABLE_IN_2_30
49 GHmac * g_hmac_copy (const GHmac *hmac);
50 GLIB_AVAILABLE_IN_2_30
51 GHmac * g_hmac_ref (GHmac *hmac);
52 GLIB_AVAILABLE_IN_2_30
53 void g_hmac_unref (GHmac *hmac);
54 GLIB_AVAILABLE_IN_2_30
55 void g_hmac_update (GHmac *hmac,
58 GLIB_AVAILABLE_IN_2_30
59 const gchar * g_hmac_get_string (GHmac *hmac);
60 GLIB_AVAILABLE_IN_2_30
61 void g_hmac_get_digest (GHmac *hmac,
65 GLIB_AVAILABLE_IN_2_30
66 gchar *g_compute_hmac_for_data (GChecksumType digest_type,
71 GLIB_AVAILABLE_IN_2_30
72 gchar *g_compute_hmac_for_string (GChecksumType digest_type,
77 GLIB_AVAILABLE_IN_2_50
78 gchar *g_compute_hmac_for_bytes (GChecksumType digest_type,
85 #endif /* __G_CHECKSUM_H__ */