aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_block_lib.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/gnunet_block_lib.h')
-rw-r--r--src/include/gnunet_block_lib.h156
1 files changed, 0 insertions, 156 deletions
diff --git a/src/include/gnunet_block_lib.h b/src/include/gnunet_block_lib.h
index ace4f23bb..7d06d592f 100644
--- a/src/include/gnunet_block_lib.h
+++ b/src/include/gnunet_block_lib.h
@@ -83,163 +83,7 @@ enum GNUNET_BLOCK_Type
83 }; 83 };
84 84
85 85
86/* **************** FIXME: move these to block_fs.h or so ***************** */
87 86
88/**
89 * @brief keyword block (advertising data under a keyword)
90 */
91struct KBlock
92{
93
94 /**
95 * GNUNET_RSA_Signature using RSA-key generated from search keyword.
96 */
97 struct GNUNET_CRYPTO_RsaSignature signature;
98
99 /**
100 * What is being signed and why?
101 */
102 struct GNUNET_CRYPTO_RsaSignaturePurpose purpose;
103
104 /**
105 * Key generated (!) from the H(keyword) as the seed!
106 */
107 struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded keyspace;
108
109 /* 0-terminated URI here */
110
111 /* variable-size Meta-Data follows here */
112
113};
114
115
116/**
117 * @brief namespace content block (advertising data under an identifier in a namespace)
118 */
119struct SBlock
120{
121
122 /**
123 * GNUNET_RSA_Signature using RSA-key of the namespace
124 */
125 struct GNUNET_CRYPTO_RsaSignature signature;
126
127 /**
128 * What is being signed and why?
129 */
130 struct GNUNET_CRYPTO_RsaSignaturePurpose purpose;
131
132 /**
133 * Hash of the hash of the human-readable identifier used for
134 * this entry (the hash of the human-readable identifier is
135 * used as the key for decryption; the xor of this identifier
136 * and the hash of the "keyspace" is the datastore-query hash).
137 */
138 GNUNET_HashCode identifier;
139
140 /**
141 * Public key of the namespace.
142 */
143 struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded subspace;
144
145 /* 0-terminated update-identifier here */
146
147 /* 0-terminated URI here (except for NBlocks) */
148
149 /* variable-size Meta-Data follows here */
150
151};
152
153
154/**
155 * @brief namespace advertisement block (advertising root of a namespace)
156 */
157struct NBlock
158{
159
160 /**
161 * GNUNET_RSA_Signature using RSA-key generated from search keyword.
162 */
163 struct GNUNET_CRYPTO_RsaSignature ksk_signature;
164
165 /**
166 * What is being signed and why?
167 */
168 struct GNUNET_CRYPTO_RsaSignaturePurpose ksk_purpose;
169
170 /**
171 * Key generated (!) from the H(keyword) as the seed!
172 */
173 struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded keyspace;
174
175 /**
176 * GNUNET_RSA_Signature using RSA-key of the namespace
177 */
178 struct GNUNET_CRYPTO_RsaSignature ns_signature;
179
180 /**
181 * What is being signed and why?
182 */
183 struct GNUNET_CRYPTO_RsaSignaturePurpose ns_purpose;
184
185 /**
186 * Public key of the namespace.
187 */
188 struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded subspace;
189
190 /* from here on, data is encrypted with H(keyword) */
191
192 /* 0-terminated root identifier here */
193
194 /* variable-size Meta-Data follows here */
195
196};
197
198
199/**
200 * @brief index block (indexing a DBlock that
201 * can be obtained directly from reading
202 * the plaintext file)
203 */
204struct OnDemandBlock
205{
206 /**
207 * Hash code of the entire content of the
208 * file that was indexed (used to uniquely
209 * identify the plaintext file).
210 */
211 GNUNET_HashCode file_id;
212
213 /**
214 * At which offset should we be able to find
215 * this on-demand encoded block? (in NBO)
216 */
217 uint64_t offset GNUNET_PACKED;
218
219};
220
221
222/* **************** OLD API ***************** */
223
224/**
225 * Check if the given block is well-formed (and of the given type).
226 *
227 * @param type type of the block
228 * @param block the block data (or at least "size" bytes claiming to be one)
229 * @param size size of "kb" in bytes; check that it is large enough
230 * @param query where to store the query that this block answers
231 * @return GNUNET_OK if this is actually a well-formed KBlock
232 * GNUNET_NO if we could not determine the query,
233 * GNUNET_SYSERR if the block is malformed
234 */
235int
236GNUNET_BLOCK_check_block (enum GNUNET_BLOCK_Type type,
237 const void *block,
238 size_t size,
239 GNUNET_HashCode *query);
240
241
242/* **************** NEW API ***************** */
243 87
244/** 88/**
245 * Possible ways for how a block may relate to a query. 89 * Possible ways for how a block may relate to a query.