aboutsummaryrefslogtreecommitdiff
path: root/src/gnsrecord/gnsrecord_crypto.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gnsrecord/gnsrecord_crypto.h')
-rw-r--r--src/gnsrecord/gnsrecord_crypto.h87
1 files changed, 0 insertions, 87 deletions
diff --git a/src/gnsrecord/gnsrecord_crypto.h b/src/gnsrecord/gnsrecord_crypto.h
deleted file mode 100644
index 79a7e6fb9..000000000
--- a/src/gnsrecord/gnsrecord_crypto.h
+++ /dev/null
@@ -1,87 +0,0 @@
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 * Information we have in an encrypted block with record data (i.e. in the DHT).
39 */
40struct GNRBlockPS
41{
42 /**
43 * Number of bytes signed; also specifies the number of bytes
44 * of encrypted data that follow.
45 */
46 struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
47
48 /**
49 * Expiration time of the block.
50 */
51 struct GNUNET_TIME_AbsoluteNBO expiration_time;
52
53 /* followed by encrypted data */
54};
55
56
57/**
58 * Derive session key and iv from label and public key.
59 *
60 * @param iv initialization vector to initialize
61 * @param skey session key to initialize
62 * @param label label to use for KDF
63 * @param pub public key to use for KDF
64 */
65void
66GNR_derive_block_aes_key (unsigned char *ctr,
67 unsigned char *key,
68 const char *label,
69 uint64_t exp,
70 const struct GNUNET_CRYPTO_EcdsaPublicKey *pub);
71
72
73/**
74 * Derive session key and iv from label and public key.
75 *
76 * @param nonce initialization vector to initialize
77 * @param skey session key to initialize
78 * @param label label to use for KDF
79 * @param pub public key to use for KDF
80 */
81void
82GNR_derive_block_xsalsa_key (unsigned char *nonce,
83 unsigned char *key,
84 const char *label,
85 uint64_t exp,
86 const struct GNUNET_CRYPTO_EddsaPublicKey *pub);
87