CatapultServer  v0.5.0.1 (Elephant)
EntityHasher.h
Go to the documentation of this file.
1 
21 #pragma once
22 #include "Block.h"
23 
24 namespace catapult {
25  namespace model {
26  struct TransactionElement;
27  class TransactionRegistry;
28  }
29 }
30 
31 namespace catapult { namespace model {
32 
34  Hash256 CalculateHash(const Block& block);
35 
37  Hash256 CalculateHash(const Transaction& transaction, const GenerationHash& generationHash);
38 
41  Hash256 CalculateHash(const Transaction& transaction, const GenerationHash& generationHash, const RawBuffer& buffer);
42 
46  const Transaction& transaction,
47  const Hash256& transactionHash,
48  const TransactionRegistry& transactionRegistry);
49 
51  std::vector<Hash256> CalculateMerkleTree(const std::vector<TransactionElement>& transactionElements);
52 
55  void UpdateHashes(
56  const TransactionRegistry& transactionRegistry,
57  const GenerationHash& generationHash,
58  TransactionElement& transactionElement);
59 }}
Block.h
catapult::Hash256
utils::ByteArray< Hash256_Size, Hash256_tag > Hash256
Definition: src/catapult/types.h:47
catapult::model::TransactionPlugin::merkleSupplementaryBuffers
virtual std::vector< RawBuffer > merkleSupplementaryBuffers(const Transaction &transaction) const =0
MerkleHashBuilder.h
catapult::crypto::KeccakBuilder
Builder for building a hash.
Definition: Hashes.h:61
catapult::model::BlockHeader
Binary layout for a block header.
Definition: Block.h:34
catapult::model::VerifiableEntityHeader::Header_Size
static constexpr size_t Header_Size
Size of the VerifiableEntity part that can be skipped when signing/verifying.
Definition: VerifiableEntity.h:38
catapult::crypto::Sha3_256_Builder
KeccakBuilder< Sha3ModeTag, Hash256_tag > Sha3_256_Builder
Sha3_256_Builder.
Definition: Hashes.h:85
catapult::Signature_Size
constexpr size_t Signature_Size
Definition: src/catapult/types.h:31
catapult::model::CalculateMerkleComponentHash
Hash256 CalculateMerkleComponentHash(const Transaction &transaction, const Hash256 &transactionHash, const TransactionRegistry &transactionRegistry)
Definition: EntityHasher.cpp:65
catapult::model::TransactionElement::Transaction
const model::Transaction & Transaction
Transaction entity.
Definition: Elements.h:41
catapult::model::PluginRegistry::findPlugin
const TPlugin * findPlugin(TPluginKey type) const
Finds the plugin corresponding to type or nullptr if none is registered.
Definition: PluginRegistry.h:38
catapult::model::UpdateHashes
void UpdateHashes(const TransactionRegistry &transactionRegistry, const GenerationHash &generationHash, TransactionElement &transactionElement)
Definition: EntityHasher.cpp:95
Elements.h
catapult::crypto::MerkleHashBuilder
Builder for creating a merkle hash.
Definition: MerkleHashBuilder.h:28
catapult::crypto::KeccakBuilder::final
void final(OutputType &output) noexcept
Finalize hash calculation. Returns result in output.
Definition: Hashes.cpp:145
Hashes.h
catapult::model::TransactionElement::EntityHash
Hash256 EntityHash
Entity hash.
Definition: Elements.h:44
catapult::crypto::KeccakBuilder::update
void update(const RawBuffer &dataBuffer) noexcept
Updates the state of hash with data inside dataBuffer.
Definition: Hashes.cpp:134
catapult::crypto::MerkleHashBuilder::update
void update(const Hash256 &hash)
Adds hash to the merkle hash.
Definition: MerkleHashBuilder.cpp:72
catapult::model::TransactionElement::MerkleComponentHash
Hash256 MerkleComponentHash
Modified hash that should be used as a hash in the merkle tree.
Definition: Elements.h:47
TransactionPlugin.h
catapult::model::CalculateHash
Hash256 CalculateHash(LockHashAlgorithm hashAlgorithm, const RawBuffer &data)
Calculates hashAlgorithm hash of data.
Definition: LockHashUtils.cpp:46
catapult::model::CalculateMerkleTree
std::vector< Hash256 > CalculateMerkleTree(const BlockStatement &statement)
Calculates the merkle tree for statement.
Definition: BlockStatement.cpp:89
catapult::model::TransactionElement
Processing element for a transaction composed of a transaction and metadata.
Definition: Elements.h:33
catapult::model::Block
Binary layout for a block.
Definition: Block.h:69
catapult
Definition: AddressExtractionExtension.cpp:28
catapult::GenerationHash
utils::ByteArray< Hash256_Size, GenerationHash_tag > GenerationHash
Definition: src/catapult/types.h:53
catapult::model::TransactionRegistry
A registry of transaction plugins.
Definition: TransactionPlugin.h:98
EntityHasher.h
catapult::utils::ByteArray< Hash256_Size, Hash256_tag >
catapult::crypto::MerkleHashBuilder::final
void final(Hash256 &hash)
Finalizes the merkle hash into hash.
Definition: MerkleHashBuilder.cpp:76
catapult::model::SizePrefixedEntity::Size
uint32_t Size
Entity size.
Definition: SizePrefixedEntity.h:33
catapult::utils::RawBuffer
BasicRawBuffer< const uint8_t > RawBuffer
A const binary buffer.
Definition: RawBuffer.h:62
catapult::model::Transaction
Binary layout for a transaction.
Definition: Transaction.h:32
catapult::model::EntityBody::Type
EntityType Type
Entity type.
Definition: EntityBody.h:42