aboutsummaryrefslogtreecommitdiff
path: root/src/include/block_fs.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/block_fs.h')
-rw-r--r--src/include/block_fs.h98
1 files changed, 14 insertions, 84 deletions
diff --git a/src/include/block_fs.h b/src/include/block_fs.h
index 0b77adc49..6f37dcf0e 100644
--- a/src/include/block_fs.h
+++ b/src/include/block_fs.h
@@ -28,119 +28,49 @@
28 28
29#include "gnunet_util_lib.h" 29#include "gnunet_util_lib.h"
30 30
31/**
32 * @brief keyword block (advertising data under a keyword)
33 */
34struct KBlock
35{
36
37 /**
38 * GNUNET_RSA_Signature using RSA-key generated from search keyword.
39 */
40 struct GNUNET_CRYPTO_RsaSignature signature;
41
42 /**
43 * What is being signed and why?
44 */
45 struct GNUNET_CRYPTO_RsaSignaturePurpose purpose;
46
47 /**
48 * Key generated (!) from the H(keyword) as the seed!
49 */
50 struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded keyspace;
51
52 /* 0-terminated URI here */
53
54 /* variable-size Meta-Data follows here */
55
56};
57
58 31
59/** 32/**
60 * @brief namespace content block (advertising data under an identifier in a namespace) 33 * Maximum legal size for a ublock.
61 */ 34 */
62struct SBlock 35#define MAX_UBLOCK_SIZE (60 * 1024)
63{
64 36
65 /**
66 * GNUNET_RSA_Signature using RSA-key of the namespace
67 */
68 struct GNUNET_CRYPTO_RsaSignature signature;
69 37
70 /**
71 * What is being signed and why?
72 */
73 struct GNUNET_CRYPTO_RsaSignaturePurpose purpose;
74
75 /**
76 * Hash of the hash of the human-readable identifier used for
77 * this entry (the hash of the human-readable identifier is
78 * used as the key for decryption; the xor of this identifier
79 * and the hash of the "keyspace" is the datastore-query hash).
80 */
81 struct GNUNET_HashCode identifier;
82
83 /**
84 * Public key of the namespace.
85 */
86 struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded subspace;
87
88 /* 0-terminated update-identifier here */
89
90 /* 0-terminated URI here (except for NBlocks) */
91
92 /* variable-size Meta-Data follows here */
93
94};
95 38
39GNUNET_NETWORK_STRUCT_BEGIN
96 40
97/** 41/**
98 * @brief namespace advertisement block (advertising root of a namespace) 42 * @brief universal block for keyword and namespace search results
99 */ 43 */
100struct NBlock 44struct UBlock
101{ 45{
102 46
103 /** 47 /**
104 * GNUNET_RSA_Signature using RSA-key generated from search keyword. 48 * Signature using pseudonym and search keyword / identifier.
105 */ 49 */
106 struct GNUNET_CRYPTO_RsaSignature ksk_signature; 50 struct GNUNET_PseudonymSignature signature;
107 51
108 /** 52 /**
109 * What is being signed and why? 53 * What is being signed and why?
110 */ 54 */
111 struct GNUNET_CRYPTO_RsaSignaturePurpose ksk_purpose; 55 struct GNUNET_PseudonymSignaturePurpose purpose;
112 56
113 /** 57 /**
114 * Key generated (!) from the H(keyword) as the seed! 58 * Public key used to sign this block. Hash of this value
59 * is the query.
115 */ 60 */
116 struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded keyspace; 61 struct GNUNET_PseudonymIdentifier verification_key;
117 62
118 /** 63 /* rest of the data is encrypted */
119 * GNUNET_RSA_Signature using RSA-key of the namespace
120 */
121 struct GNUNET_CRYPTO_RsaSignature ns_signature;
122
123 /**
124 * What is being signed and why?
125 */
126 struct GNUNET_CRYPTO_RsaSignaturePurpose ns_purpose;
127 64
128 /** 65 /* 0-terminated update-identifier here (ignored for keyword results) */
129 * Public key of the namespace.
130 */
131 struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded subspace;
132
133 /* from here on, data is encrypted with H(keyword) */
134 66
135 /* 0-terminated root identifier here */ 67 /* 0-terminated URI here */
136 68
137 /* variable-size Meta-Data follows here */ 69 /* variable-size Meta-Data follows here */
138 70
139}; 71};
140 72
141 73
142GNUNET_NETWORK_STRUCT_BEGIN
143
144/** 74/**
145 * @brief index block (indexing a DBlock that 75 * @brief index block (indexing a DBlock that
146 * can be obtained directly from reading 76 * can be obtained directly from reading