Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-06 08:41:17

0001 /* ghmac.h - secure data hashing
0002  *
0003  * Copyright (C) 2011  Stef Walter  <stefw@collabora.co.uk>
0004  *
0005  * SPDX-License-Identifier: LGPL-2.1-or-later
0006  *
0007  * This library is free software; you can redistribute it and/or
0008  * modify it under the terms of the GNU Lesser General Public
0009  * License as published by the Free Software Foundation; either
0010  * version 2.1 of the License, or (at your option) any later version.
0011  *
0012  * This library is distributed in the hope that it will be useful,
0013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0015  * Lesser General Public License for more details.
0016  *
0017  * You should have received a copy of the GNU Lesser General Public License
0018  * along with this library; if not, see <http://www.gnu.org/licenses/>.
0019  */
0020 
0021 #ifndef __G_HMAC_H__
0022 #define __G_HMAC_H__
0023 
0024 #if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
0025 #error "Only <glib.h> can be included directly."
0026 #endif
0027 
0028 #include <glib/gtypes.h>
0029 #include "gchecksum.h"
0030 
0031 G_BEGIN_DECLS
0032 
0033 typedef struct _GHmac       GHmac;
0034 
0035 GLIB_AVAILABLE_IN_2_30
0036 GHmac *               g_hmac_new                    (GChecksumType  digest_type,
0037                                                      const guchar  *key,
0038                                                      gsize          key_len);
0039 GLIB_AVAILABLE_IN_2_30
0040 GHmac *               g_hmac_copy                   (const GHmac   *hmac);
0041 GLIB_AVAILABLE_IN_2_30
0042 GHmac *               g_hmac_ref                    (GHmac         *hmac);
0043 GLIB_AVAILABLE_IN_2_30
0044 void                  g_hmac_unref                  (GHmac         *hmac);
0045 GLIB_AVAILABLE_IN_2_30
0046 void                  g_hmac_update                 (GHmac         *hmac,
0047                                                      const guchar  *data,
0048                                                      gssize         length);
0049 GLIB_AVAILABLE_IN_2_30
0050 const gchar *         g_hmac_get_string             (GHmac         *hmac);
0051 GLIB_AVAILABLE_IN_2_30
0052 void                  g_hmac_get_digest             (GHmac         *hmac,
0053                                                      guint8        *buffer,
0054                                                      gsize         *digest_len);
0055 
0056 GLIB_AVAILABLE_IN_2_30
0057 gchar                *g_compute_hmac_for_data       (GChecksumType  digest_type,
0058                                                      const guchar  *key,
0059                                                      gsize          key_len,
0060                                                      const guchar  *data,
0061                                                      gsize          length);
0062 GLIB_AVAILABLE_IN_2_30
0063 gchar                *g_compute_hmac_for_string     (GChecksumType  digest_type,
0064                                                      const guchar  *key,
0065                                                      gsize          key_len,
0066                                                      const gchar   *str,
0067                                                      gssize         length);
0068 GLIB_AVAILABLE_IN_2_50
0069 gchar               *g_compute_hmac_for_bytes       (GChecksumType  digest_type,
0070                                                      GBytes        *key,
0071                                                      GBytes        *data);
0072 
0073 
0074 G_END_DECLS
0075 
0076 #endif /* __G_CHECKSUM_H__ */