aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Schanzenbach <schanzen@gnunet.org>2022-01-31 16:07:51 +0100
committerMartin Schanzenbach <schanzen@gnunet.org>2022-01-31 16:07:51 +0100
commitff4f990b11c7da2ef082aee3be9bea3957abe8e5 (patch)
tree51e9ee79a5638f392594c9275bdb84bb9dd06eea
parentadbb9ce3f1f77d812686ef001cfa8e1d0c137fd8 (diff)
downloadgnunet-ff4f990b11c7da2ef082aee3be9bea3957abe8e5.tar.gz
gnunet-ff4f990b11c7da2ef082aee3be9bea3957abe8e5.zip
-ftbfs
-rw-r--r--src/gnsrecord/gnsrecord_crypto.h67
1 files changed, 67 insertions, 0 deletions
diff --git a/src/gnsrecord/gnsrecord_crypto.h b/src/gnsrecord/gnsrecord_crypto.h
new file mode 100644
index 000000000..be762f1b5
--- /dev/null
+++ b/src/gnsrecord/gnsrecord_crypto.h
@@ -0,0 +1,67 @@
1/*
2 This file is part of GNUnet.
3 Copyright (C) 2009-2013, 2018 GNUnet e.V.
4
5 GNUnet is free software: you can redistribute it and/or modify it
6 under the terms of the GNU Affero General Public License as published
7 by the Free Software Foundation, either version 3 of the License,
8 or (at your option) any later version.
9
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details.
14
15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 SPDX-License-Identifier: AGPL3.0-or-later
19 */
20
21/**
22 * @file gnsrecord/gnsrecord_crypto.h
23 * @brief API for GNS record-related crypto
24 * @author Martin Schanzenbach
25 * @author Matthias Wachs
26 * @author Christian Grothoff
27 */
28#include "platform.h"
29#include "gnunet_util_lib.h"
30#include "gnunet_constants.h"
31#include "gnunet_signatures.h"
32#include "gnunet_arm_service.h"
33#include "gnunet_gnsrecord_lib.h"
34#include "gnunet_dnsparser_lib.h"
35#include "gnunet_tun_lib.h"
36
37/**
38 * Derive session key and iv from label and public key.
39 *
40 * @param iv initialization vector to initialize
41 * @param skey session key to initialize
42 * @param label label to use for KDF
43 * @param pub public key to use for KDF
44 */
45void
46GNR_derive_block_aes_key (unsigned char *ctr,
47 unsigned char *key,
48 const char *label,
49 uint64_t exp,
50 const struct GNUNET_CRYPTO_EcdsaPublicKey *pub);
51
52
53/**
54 * Derive session key and iv from label and public key.
55 *
56 * @param nonce initialization vector to initialize
57 * @param skey session key to initialize
58 * @param label label to use for KDF
59 * @param pub public key to use for KDF
60 */
61void
62GNR_derive_block_xsalsa_key (unsigned char *nonce,
63 unsigned char *key,
64 const char *label,
65 uint64_t exp,
66 const struct GNUNET_CRYPTO_EddsaPublicKey *pub);
67