Guile: Fix `x509-certificate-dn-oid' and related functions.
[gnutls.git] / lib / gnutls_hash_int.h
blob41acf665da9d5f39f1309957abc42991f69870c1
1 /*
2 * Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation
4 * Author: Nikos Mavroyanopoulos
6 * This file is part of GNUTLS.
8 * The GNUTLS library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public License
10 * as published by the Free Software Foundation; either version 2.1 of
11 * the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
21 * USA
25 #ifndef GNUTLS_HASH_INT_H
26 # define GNUTLS_HASH_INT_H
28 #include <gnutls_int.h>
30 /* for message digests */
32 typedef struct
34 gc_hash_handle handle;
35 gnutls_mac_algorithm_t algorithm;
36 const void *key;
37 int keysize;
38 } mac_hd_st;
39 typedef mac_hd_st *mac_hd_t;
40 typedef mac_hd_t GNUTLS_HASH_HANDLE;
42 #define GNUTLS_HASH_FAILED NULL
43 #define GNUTLS_MAC_FAILED NULL
45 mac_hd_t _gnutls_hmac_init (gnutls_mac_algorithm_t algorithm,
46 const void *key, int keylen);
47 #define _gnutls_hmac_get_algo_len _gnutls_hash_get_algo_len
48 #define _gnutls_hmac _gnutls_hash
49 void _gnutls_hmac_deinit (mac_hd_t handle, void *digest);
51 mac_hd_t _gnutls_mac_init_ssl3 (gnutls_mac_algorithm_t algorithm, void *key,
52 int keylen);
53 void _gnutls_mac_deinit_ssl3 (mac_hd_t handle, void *digest);
55 GNUTLS_HASH_HANDLE _gnutls_hash_init (gnutls_mac_algorithm_t algorithm);
56 int _gnutls_hash_get_algo_len (gnutls_mac_algorithm_t algorithm);
57 int _gnutls_hash (GNUTLS_HASH_HANDLE handle, const void *text,
58 size_t textlen);
59 void _gnutls_hash_deinit (GNUTLS_HASH_HANDLE handle, void *digest);
61 int _gnutls_ssl3_generate_random (void *secret, int secret_len,
62 void *rnd, int random_len, int bytes,
63 opaque * ret);
64 int _gnutls_ssl3_hash_md5 (void *first, int first_len, void *second,
65 int second_len, int ret_len, opaque * ret);
67 void _gnutls_mac_deinit_ssl3_handshake (mac_hd_t handle, void *digest,
68 opaque * key, uint32_t key_size);
70 GNUTLS_HASH_HANDLE _gnutls_hash_copy (GNUTLS_HASH_HANDLE handle);
72 #endif /* GNUTLS_HASH_INT_H */