/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 |
30 | | int _gnutls_aead_cipher_init(gnutls_aead_cipher_hd_t handle, |
31 | | gnutls_cipher_algorithm_t cipher, |
32 | | const gnutls_datum_t * key) |
33 | 0 | { |
34 | 0 | const cipher_entry_st *e; |
35 | |
|
36 | 0 | e = cipher_to_entry(cipher); |
37 | 0 | if (e == NULL || e->type != CIPHER_AEAD) |
38 | 0 | return gnutls_assert_val(GNUTLS_E_INVALID_REQUEST); |
39 | | |
40 | 0 | return _gnutls_cipher_init(&handle->ctx_enc, e, key, NULL, 1); |
41 | 0 | } Unexecuted instantiation: constate.c:_gnutls_aead_cipher_init Unexecuted instantiation: crypto-api.c:_gnutls_aead_cipher_init Unexecuted instantiation: secrets.c:_gnutls_aead_cipher_init |
42 | | |
43 | | inline static |
44 | | void _gnutls_aead_cipher_deinit(gnutls_aead_cipher_hd_t handle) |
45 | 0 | { |
46 | 0 | api_aead_cipher_hd_st *h = handle; |
47 | |
|
48 | 0 | _gnutls_cipher_deinit(&h->ctx_enc); |
49 | 0 | } Unexecuted instantiation: constate.c:_gnutls_aead_cipher_deinit Unexecuted instantiation: crypto-api.c:_gnutls_aead_cipher_deinit Unexecuted instantiation: secrets.c:_gnutls_aead_cipher_deinit |
50 | | |
51 | | int |
52 | | _gnutls_hkdf_extract(gnutls_mac_algorithm_t mac, |
53 | | const gnutls_datum_t * key, |
54 | | const gnutls_datum_t * salt, void *output); |
55 | | |
56 | | int |
57 | | _gnutls_hkdf_expand(gnutls_mac_algorithm_t mac, |
58 | | const gnutls_datum_t * key, |
59 | | const gnutls_datum_t * info, void *output, size_t length); |
60 | | |
61 | | #endif /* GNUTLS_LIB_CRYPTO_API_H */ |