Coverage Report

Created: 2024-06-20 06:28

/src/gnutls/lib/crypto-api.h
Line
Count
Source (jump to first uncovered line)
1
/*
2
 * Copyright (C) 2000-2016 Free Software Foundation, Inc.
3
 * Copyright (C) 2016-2017 Red Hat, Inc.
4
 *
5
 * Author: Nikos Mavrogiannopoulos
6
 *
7
 * This file is part of GnuTLS.
8
 *
9
 * The GnuTLS is free software; you can redistribute it and/or
10
 * modify it under the terms of the GNU Lesser General Public License
11
 * as published by the Free Software Foundation; either version 2.1 of
12
 * the License, or (at your option) any later version.
13
 *
14
 * This library is distributed in the hope that it will be useful, but
15
 * WITHOUT ANY WARRANTY; without even the implied warranty of
16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17
 * Lesser General Public License for more details.
18
 *
19
 * You should have received a copy of the GNU Lesser General Public License
20
 * along with this program.  If not, see <https://www.gnu.org/licenses/>
21
 *
22
 */
23
24
#ifndef GNUTLS_LIB_CRYPTO_API_H
25
#define GNUTLS_LIB_CRYPTO_API_H
26
27
#include "gnutls_int.h"
28
29
inline static int _gnutls_aead_cipher_init(gnutls_aead_cipher_hd_t handle,
30
             gnutls_cipher_algorithm_t cipher,
31
             const gnutls_datum_t *key)
32
0
{
33
0
  const cipher_entry_st *e;
34
35
0
  e = cipher_to_entry(cipher);
36
0
  if (e == NULL || e->type != CIPHER_AEAD)
37
0
    return gnutls_assert_val(GNUTLS_E_INVALID_REQUEST);
38
39
0
  return _gnutls_cipher_init(&handle->ctx_enc, e, key, NULL, 1);
40
0
}
Unexecuted instantiation: crypto-api.c:_gnutls_aead_cipher_init
Unexecuted instantiation: secrets.c:_gnutls_aead_cipher_init
Unexecuted instantiation: constate.c:_gnutls_aead_cipher_init
41
42
inline static void _gnutls_aead_cipher_deinit(gnutls_aead_cipher_hd_t handle)
43
0
{
44
0
  api_aead_cipher_hd_st *h = handle;
45
46
0
  _gnutls_cipher_deinit(&h->ctx_enc);
47
0
}
Unexecuted instantiation: crypto-api.c:_gnutls_aead_cipher_deinit
Unexecuted instantiation: secrets.c:_gnutls_aead_cipher_deinit
Unexecuted instantiation: constate.c:_gnutls_aead_cipher_deinit
48
49
int _gnutls_hkdf_extract(gnutls_mac_algorithm_t mac, const gnutls_datum_t *key,
50
       const gnutls_datum_t *salt, void *output);
51
52
int _gnutls_hkdf_expand(gnutls_mac_algorithm_t mac, const gnutls_datum_t *key,
53
      const gnutls_datum_t *info, void *output,
54
      size_t length);
55
56
#endif /* GNUTLS_LIB_CRYPTO_API_H */