CatapultServer  v0.5.0.1 (Elephant)
LockHashUtils.h
Go to the documentation of this file.
1 
21 #pragma once
22 #include "LockHashAlgorithm.h"
23 #include "catapult/types.h"
24 
25 namespace catapult { namespace model {
26 
28  Hash256 CalculateHash(LockHashAlgorithm hashAlgorithm, const RawBuffer& data);
29 
31  Hash256 CalculateSecretLockInfoHash(const Hash256& secret, const Address& recipient);
32 }}
catapult::crypto::Sha256Double
void Sha256Double(const RawBuffer &dataBuffer, Hash256 &hash) noexcept
Calculates double sha256 hash of dataBuffer into hash.
Definition: Hashes.cpp:65
catapult::model::LockHashAlgorithm::Op_Hash_160
Input is hashed twice: first with SHA-256 and then with RIPEMD-160.
exceptions.h
catapult::model::LockHashAlgorithm::Op_Sha3_256
Input is hashed using Sha-3-256.
catapult::Hash256
utils::ByteArray< Hash256_Size, Hash256_tag > Hash256
Definition: src/catapult/types.h:47
catapult::crypto::Sha3_256
void Sha3_256(const RawBuffer &dataBuffer, Hash256 &hash) noexcept
Calculates the 256-bit SHA3 hash of dataBuffer into hash.
Definition: Hashes.cpp:81
catapult::crypto::KeccakBuilder
Builder for building a hash.
Definition: Hashes.h:61
catapult::utils::to_underlying_type
constexpr std::underlying_type_t< TEnum > to_underlying_type(TEnum value)
Converts a strongly typed enumeration value to its underlying integral value.
Definition: Casting.h:37
LockHashUtils.h
catapult::crypto::KeccakBuilder::final
void final(OutputType &output) noexcept
Finalize hash calculation. Returns result in output.
Definition: Hashes.cpp:145
Hashes.h
catapult::crypto::Bitcoin160
void Bitcoin160(const RawBuffer &dataBuffer, Hash160 &hash) noexcept
Calculates bitcoin's hash 160 of dataBuffer into hash (sha256 + ripemd).
Definition: Hashes.cpp:58
catapult::model::CalculateSecretLockInfoHash
Hash256 CalculateSecretLockInfoHash(const Hash256 &secret, const Address &recipient)
Calculates the secret lock info hash from secret and recipient.
Definition: LockHashUtils.cpp:64
catapult::crypto::KeccakBuilder::update
void update(const RawBuffer &dataBuffer) noexcept
Updates the state of hash with data inside dataBuffer.
Definition: Hashes.cpp:134
catapult::model::CalculateHash
Hash256 CalculateHash(LockHashAlgorithm hashAlgorithm, const RawBuffer &data)
Calculates hashAlgorithm hash of data.
Definition: LockHashUtils.cpp:46
CATAPULT_THROW_INVALID_ARGUMENT_1
#define CATAPULT_THROW_INVALID_ARGUMENT_1(MESSAGE, PARAM1)
Macro used to throw a catapult invalid argument with a single parameter.
Definition: exceptions.h:183
catapult::model::LockHashAlgorithm::Op_Hash_256
Input is hashed twice with SHA-256.
types.h
Casting.h
catapult
Definition: AddressExtractionExtension.cpp:28
catapult::utils::ByteArray< Hash256_Size, Hash256_tag >
catapult::model::LockHashAlgorithm
LockHashAlgorithm
Lock secret hash algorithm.
Definition: LockHashAlgorithm.h:27
catapult::model::LockHashAlgorithm::Op_Keccak_256
Input is hashed using Keccak-256.
catapult::crypto::Keccak_256
void Keccak_256(const RawBuffer &dataBuffer, Hash256 &hash) noexcept
Calculates the 256-bit Keccak hash of dataBuffer into hash.
Definition: Hashes.cpp:89
LockHashAlgorithm.h
catapult::utils::RawBuffer
BasicRawBuffer< const uint8_t > RawBuffer
A const binary buffer.
Definition: RawBuffer.h:62