From 2e9791b5b713120238ea95113537fa55ff49b95d Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Mon, 13 Sep 2010 03:18:26 +0000 Subject: new block lib --- src/include/gnunet_block_lib.h | 156 ----------------------------------------- 1 file changed, 156 deletions(-) (limited to 'src/include/gnunet_block_lib.h') 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 }; -/* **************** FIXME: move these to block_fs.h or so ***************** */ -/** - * @brief keyword block (advertising data under a keyword) - */ -struct KBlock -{ - - /** - * GNUNET_RSA_Signature using RSA-key generated from search keyword. - */ - struct GNUNET_CRYPTO_RsaSignature signature; - - /** - * What is being signed and why? - */ - struct GNUNET_CRYPTO_RsaSignaturePurpose purpose; - - /** - * Key generated (!) from the H(keyword) as the seed! - */ - struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded keyspace; - - /* 0-terminated URI here */ - - /* variable-size Meta-Data follows here */ - -}; - - -/** - * @brief namespace content block (advertising data under an identifier in a namespace) - */ -struct SBlock -{ - - /** - * GNUNET_RSA_Signature using RSA-key of the namespace - */ - struct GNUNET_CRYPTO_RsaSignature signature; - - /** - * What is being signed and why? - */ - struct GNUNET_CRYPTO_RsaSignaturePurpose purpose; - - /** - * Hash of the hash of the human-readable identifier used for - * this entry (the hash of the human-readable identifier is - * used as the key for decryption; the xor of this identifier - * and the hash of the "keyspace" is the datastore-query hash). - */ - GNUNET_HashCode identifier; - - /** - * Public key of the namespace. - */ - struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded subspace; - - /* 0-terminated update-identifier here */ - - /* 0-terminated URI here (except for NBlocks) */ - - /* variable-size Meta-Data follows here */ - -}; - - -/** - * @brief namespace advertisement block (advertising root of a namespace) - */ -struct NBlock -{ - - /** - * GNUNET_RSA_Signature using RSA-key generated from search keyword. - */ - struct GNUNET_CRYPTO_RsaSignature ksk_signature; - - /** - * What is being signed and why? - */ - struct GNUNET_CRYPTO_RsaSignaturePurpose ksk_purpose; - - /** - * Key generated (!) from the H(keyword) as the seed! - */ - struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded keyspace; - - /** - * GNUNET_RSA_Signature using RSA-key of the namespace - */ - struct GNUNET_CRYPTO_RsaSignature ns_signature; - - /** - * What is being signed and why? - */ - struct GNUNET_CRYPTO_RsaSignaturePurpose ns_purpose; - - /** - * Public key of the namespace. - */ - struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded subspace; - - /* from here on, data is encrypted with H(keyword) */ - - /* 0-terminated root identifier here */ - - /* variable-size Meta-Data follows here */ - -}; - - -/** - * @brief index block (indexing a DBlock that - * can be obtained directly from reading - * the plaintext file) - */ -struct OnDemandBlock -{ - /** - * Hash code of the entire content of the - * file that was indexed (used to uniquely - * identify the plaintext file). - */ - GNUNET_HashCode file_id; - - /** - * At which offset should we be able to find - * this on-demand encoded block? (in NBO) - */ - uint64_t offset GNUNET_PACKED; - -}; - - -/* **************** OLD API ***************** */ - -/** - * Check if the given block is well-formed (and of the given type). - * - * @param type type of the block - * @param block the block data (or at least "size" bytes claiming to be one) - * @param size size of "kb" in bytes; check that it is large enough - * @param query where to store the query that this block answers - * @return GNUNET_OK if this is actually a well-formed KBlock - * GNUNET_NO if we could not determine the query, - * GNUNET_SYSERR if the block is malformed - */ -int -GNUNET_BLOCK_check_block (enum GNUNET_BLOCK_Type type, - const void *block, - size_t size, - GNUNET_HashCode *query); - - -/* **************** NEW API ***************** */ /** * Possible ways for how a block may relate to a query. -- cgit v1.2.3