From 7c6f4d7bff64b4b9f4a9c3d0a3176f0e88f50776 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Sat, 27 Jan 2024 20:24:53 +0100 Subject: [PATCH] feat: Added many new Hash algorithms --- plugins/hashes/romfs/lang/de_DE.json | 14 +- plugins/hashes/romfs/lang/en_US.json | 23 +- plugins/hashes/romfs/lang/es_ES.json | 14 +- plugins/hashes/romfs/lang/it_IT.json | 14 +- plugins/hashes/romfs/lang/ja_JP.json | 14 +- plugins/hashes/romfs/lang/ko_KR.json | 14 +- plugins/hashes/romfs/lang/pt_BR.json | 14 +- plugins/hashes/romfs/lang/zh_CN.json | 14 +- plugins/hashes/romfs/lang/zh_TW.json | 14 +- plugins/hashes/source/content/hashes.cpp | 292 ++++++++++++++++++----- 10 files changed, 241 insertions(+), 186 deletions(-) diff --git a/plugins/hashes/romfs/lang/de_DE.json b/plugins/hashes/romfs/lang/de_DE.json index ba330e021..d7c112013 100644 --- a/plugins/hashes/romfs/lang/de_DE.json +++ b/plugins/hashes/romfs/lang/de_DE.json @@ -19,18 +19,6 @@ "hex.hashes.hash.common.poly": "Polynom", "hex.hashes.hash.common.refl_in": "Reflect In", "hex.hashes.hash.common.refl_out": "Reflect Out", - "hex.hashes.hash.common.xor_out": "XOR Out", - "hex.hashes.hash.crc16": "CRC-16", - "hex.hashes.hash.crc32": "CRC-32", - "hex.hashes.hash.crc32c": "CRC-32C", - "hex.hashes.hash.crc32mpeg": "CRC-32/MPEG", - "hex.hashes.hash.crc32posix": "CRC-32/POSIX", - "hex.hashes.hash.crc8": "CRC-8", - "hex.hashes.hash.md5": "MD5", - "hex.hashes.hash.sha1": "SHA1", - "hex.hashes.hash.sha224": "SHA224", - "hex.hashes.hash.sha256": "SHA256", - "hex.hashes.hash.sha384": "SHA384", - "hex.hashes.hash.sha512": "SHA512" + "hex.hashes.hash.common.xor_out": "XOR Out" } } diff --git a/plugins/hashes/romfs/lang/en_US.json b/plugins/hashes/romfs/lang/en_US.json index b0fbfc8ca..28ba0d205 100644 --- a/plugins/hashes/romfs/lang/en_US.json +++ b/plugins/hashes/romfs/lang/en_US.json @@ -18,30 +18,15 @@ "hex.hashes.hash.common.iv": "Initial Value", "hex.hashes.hash.common.poly": "Polynomial", "hex.hashes.hash.common.key": "Key", + "hex.hashes.hash.common.security_level": "Security Level", "hex.hashes.hash.common.size": "Hash Size", "hex.hashes.hash.common.rounds": "Hash Rounds", "hex.hashes.hash.common.salt": "Salt", + "hex.hashes.hash.common.standard": "Standard", + "hex.hashes.hash.common.standard.custom": "Custom", "hex.hashes.hash.common.personalization": "Personalization", "hex.hashes.hash.common.refl_in": "Reflect In", "hex.hashes.hash.common.refl_out": "Reflect Out", - "hex.hashes.hash.common.xor_out": "XOR Out", - "hex.hashes.hash.crc16": "CRC-16", - "hex.hashes.hash.crc32": "CRC-32", - "hex.hashes.hash.crc32c": "CRC-32C", - "hex.hashes.hash.crc32mpeg": "CRC-32/MPEG", - "hex.hashes.hash.crc32posix": "CRC-32/POSIX", - "hex.hashes.hash.crc8": "CRC-8", - "hex.hashes.hash.md5": "MD5", - "hex.hashes.hash.sha1": "SHA1", - "hex.hashes.hash.sha224": "SHA224", - "hex.hashes.hash.sha256": "SHA256", - "hex.hashes.hash.sha384": "SHA384", - "hex.hashes.hash.sha512": "SHA512", - "hex.hashes.hash.sum": "Byte Sum", - "hex.hashes.hash.tiger": "Tiger", - "hex.hashes.hash.tiger2": "Tiger2", - "hex.hashes.hash.blake2b": "Blake2B", - "hex.hashes.hash.blake2s": "Blake2S" - + "hex.hashes.hash.common.xor_out": "XOR Out" } } diff --git a/plugins/hashes/romfs/lang/es_ES.json b/plugins/hashes/romfs/lang/es_ES.json index 9310619df..5091c0c75 100644 --- a/plugins/hashes/romfs/lang/es_ES.json +++ b/plugins/hashes/romfs/lang/es_ES.json @@ -19,18 +19,6 @@ "hex.hashes.hash.common.poly": "Polinomio", "hex.hashes.hash.common.refl_in": "Reflect In", "hex.hashes.hash.common.refl_out": "Reflect Out", - "hex.hashes.hash.common.xor_out": "XOR Out", - "hex.hashes.hash.crc16": "CRC-16", - "hex.hashes.hash.crc32": "CRC-32", - "hex.hashes.hash.crc32c": "CRC-32C", - "hex.hashes.hash.crc32mpeg": "CRC-32/MPEG", - "hex.hashes.hash.crc32posix": "CRC-32/POSIX", - "hex.hashes.hash.crc8": "CRC-8", - "hex.hashes.hash.md5": "MD5", - "hex.hashes.hash.sha1": "SHA1", - "hex.hashes.hash.sha224": "SHA224", - "hex.hashes.hash.sha256": "SHA256", - "hex.hashes.hash.sha384": "SHA384", - "hex.hashes.hash.sha512": "SHA512" + "hex.hashes.hash.common.xor_out": "XOR Out" } } diff --git a/plugins/hashes/romfs/lang/it_IT.json b/plugins/hashes/romfs/lang/it_IT.json index 124ac4c9d..5a0530708 100644 --- a/plugins/hashes/romfs/lang/it_IT.json +++ b/plugins/hashes/romfs/lang/it_IT.json @@ -19,18 +19,6 @@ "hex.hashes.hash.common.poly": "Polinomio", "hex.hashes.hash.common.refl_in": "", "hex.hashes.hash.common.refl_out": "", - "hex.hashes.hash.common.xor_out": "", - "hex.hashes.hash.crc16": "CRC16", - "hex.hashes.hash.crc32": "CRC32", - "hex.hashes.hash.crc32c": "", - "hex.hashes.hash.crc32mpeg": "", - "hex.hashes.hash.crc32posix": "", - "hex.hashes.hash.crc8": "CRC8", - "hex.hashes.hash.md5": "MD5", - "hex.hashes.hash.sha1": "SHA1", - "hex.hashes.hash.sha224": "SHA224", - "hex.hashes.hash.sha256": "SHA256", - "hex.hashes.hash.sha384": "SHA384", - "hex.hashes.hash.sha512": "SHA512" + "hex.hashes.hash.common.xor_out": "" } } diff --git a/plugins/hashes/romfs/lang/ja_JP.json b/plugins/hashes/romfs/lang/ja_JP.json index e96bb1952..f0104d920 100644 --- a/plugins/hashes/romfs/lang/ja_JP.json +++ b/plugins/hashes/romfs/lang/ja_JP.json @@ -19,18 +19,6 @@ "hex.hashes.hash.common.poly": "多項式", "hex.hashes.hash.common.refl_in": "入力を反映", "hex.hashes.hash.common.refl_out": "出力を反映", - "hex.hashes.hash.common.xor_out": "最終XOR値", - "hex.hashes.hash.crc16": "CRC16", - "hex.hashes.hash.crc32": "CRC32", - "hex.hashes.hash.crc32c": "", - "hex.hashes.hash.crc32mpeg": "", - "hex.hashes.hash.crc32posix": "", - "hex.hashes.hash.crc8": "CRC8", - "hex.hashes.hash.md5": "MD5", - "hex.hashes.hash.sha1": "SHA1", - "hex.hashes.hash.sha224": "SHA224", - "hex.hashes.hash.sha256": "SHA256", - "hex.hashes.hash.sha384": "SHA384", - "hex.hashes.hash.sha512": "SHA512" + "hex.hashes.hash.common.xor_out": "最終XOR値" } } diff --git a/plugins/hashes/romfs/lang/ko_KR.json b/plugins/hashes/romfs/lang/ko_KR.json index 06630059d..e865f1e1f 100644 --- a/plugins/hashes/romfs/lang/ko_KR.json +++ b/plugins/hashes/romfs/lang/ko_KR.json @@ -19,18 +19,6 @@ "hex.hashes.hash.common.poly": "다항식", "hex.hashes.hash.common.refl_in": "입력에 반영", "hex.hashes.hash.common.refl_out": "출력에 반영", - "hex.hashes.hash.common.xor_out": "XOR 출력", - "hex.hashes.hash.crc16": "CRC-16", - "hex.hashes.hash.crc32": "CRC-32", - "hex.hashes.hash.crc32c": "CRC-32C", - "hex.hashes.hash.crc32mpeg": "CRC-32/MPEG", - "hex.hashes.hash.crc32posix": "CRC-32/POSIX", - "hex.hashes.hash.crc8": "CRC-8", - "hex.hashes.hash.md5": "MD5", - "hex.hashes.hash.sha1": "SHA1", - "hex.hashes.hash.sha224": "SHA224", - "hex.hashes.hash.sha256": "SHA256", - "hex.hashes.hash.sha384": "SHA384", - "hex.hashes.hash.sha512": "SHA512" + "hex.hashes.hash.common.xor_out": "XOR 출력" } } diff --git a/plugins/hashes/romfs/lang/pt_BR.json b/plugins/hashes/romfs/lang/pt_BR.json index f52121f0c..641aee81e 100644 --- a/plugins/hashes/romfs/lang/pt_BR.json +++ b/plugins/hashes/romfs/lang/pt_BR.json @@ -19,18 +19,6 @@ "hex.hashes.hash.common.poly": "Polynomial", "hex.hashes.hash.common.refl_in": "Reflect In", "hex.hashes.hash.common.refl_out": "Reflect Out", - "hex.hashes.hash.common.xor_out": "XOR Out", - "hex.hashes.hash.crc16": "CRC16", - "hex.hashes.hash.crc32": "CRC32", - "hex.hashes.hash.crc32c": "", - "hex.hashes.hash.crc32mpeg": "", - "hex.hashes.hash.crc32posix": "", - "hex.hashes.hash.crc8": "CRC8", - "hex.hashes.hash.md5": "MD5", - "hex.hashes.hash.sha1": "SHA1", - "hex.hashes.hash.sha224": "SHA224", - "hex.hashes.hash.sha256": "SHA256", - "hex.hashes.hash.sha384": "SHA384", - "hex.hashes.hash.sha512": "SHA512" + "hex.hashes.hash.common.xor_out": "XOR Out" } } diff --git a/plugins/hashes/romfs/lang/zh_CN.json b/plugins/hashes/romfs/lang/zh_CN.json index 9052fdc88..ac4f48c64 100644 --- a/plugins/hashes/romfs/lang/zh_CN.json +++ b/plugins/hashes/romfs/lang/zh_CN.json @@ -19,18 +19,6 @@ "hex.hashes.hash.common.poly": "多项式", "hex.hashes.hash.common.refl_in": "输入值取反", "hex.hashes.hash.common.refl_out": "输出值取反", - "hex.hashes.hash.common.xor_out": "结果异或值", - "hex.hashes.hash.crc16": "CRC-16", - "hex.hashes.hash.crc32": "CRC-32", - "hex.hashes.hash.crc32c": "CRC-32C", - "hex.hashes.hash.crc32mpeg": "CRC-32/MPEG", - "hex.hashes.hash.crc32posix": "CRC-32/POSIX", - "hex.hashes.hash.crc8": "CRC-8", - "hex.hashes.hash.md5": "MD5", - "hex.hashes.hash.sha1": "SHA1", - "hex.hashes.hash.sha224": "SHA224", - "hex.hashes.hash.sha256": "SHA256", - "hex.hashes.hash.sha384": "SHA384", - "hex.hashes.hash.sha512": "SHA512" + "hex.hashes.hash.common.xor_out": "结果异或值" } } diff --git a/plugins/hashes/romfs/lang/zh_TW.json b/plugins/hashes/romfs/lang/zh_TW.json index 968e6cd72..86df5d50c 100644 --- a/plugins/hashes/romfs/lang/zh_TW.json +++ b/plugins/hashes/romfs/lang/zh_TW.json @@ -19,18 +19,6 @@ "hex.hashes.hash.common.poly": "多項式", "hex.hashes.hash.common.refl_in": "Reflect In", "hex.hashes.hash.common.refl_out": "Reflect Out", - "hex.hashes.hash.common.xor_out": "XOR Out", - "hex.hashes.hash.crc16": "CRC16", - "hex.hashes.hash.crc32": "CRC32", - "hex.hashes.hash.crc32c": "CRC-32C", - "hex.hashes.hash.crc32mpeg": "CRC-32/MPEG", - "hex.hashes.hash.crc32posix": "CRC-32/POSIX", - "hex.hashes.hash.crc8": "CRC8", - "hex.hashes.hash.md5": "MD5", - "hex.hashes.hash.sha1": "SHA1", - "hex.hashes.hash.sha224": "SHA224", - "hex.hashes.hash.sha256": "SHA256", - "hex.hashes.hash.sha384": "SHA384", - "hex.hashes.hash.sha512": "SHA512" + "hex.hashes.hash.common.xor_out": "XOR Out" } } diff --git a/plugins/hashes/source/content/hashes.cpp b/plugins/hashes/source/content/hashes.cpp index 2e0fd9651..b270b1a6c 100644 --- a/plugins/hashes/source/content/hashes.cpp +++ b/plugins/hashes/source/content/hashes.cpp @@ -134,14 +134,41 @@ namespace hex::plugin::hashes { void load(const nlohmann::json &) override {} }; - template class HashCRC : public ContentRegistry::Hashes::Hash { public: - using CRCFunction = T(*)(prv::Provider*&, u64, size_t, u32, u32, u32, bool, bool); - HashCRC(const std::string &name, const CRCFunction &crcFunction, u32 polynomial, u32 initialValue, u32 xorOut, bool reflectIn = false, bool reflectOut = false) - : Hash(name), m_crcFunction(crcFunction), m_polynomial(polynomial), m_initialValue(initialValue), m_xorOut(xorOut), m_reflectIn(reflectIn), m_reflectOut(reflectOut) {} + HashCRC() : Hash("Cyclic Redundancy Check (CRC)") { + m_crcs.push_back(HashFactory::Checksum::CreateCRC(3, 0, 0, false, false, 0, 0, { "hex.hashes.hash.common.standard.custom"_lang })); + + for (CRCStandard standard = CRC3_GSM; standard < CRC64_XZ; standard = CRCStandard(int(standard) + 1)) { + m_crcs.push_back(HashFactory::Checksum::CreateCRC(standard)); + } + } void draw() override { + if (ImGui::BeginCombo("hex.hashes.hash.common.standard"_lang, m_crcs[m_selectedCrc]->GetName().c_str())) { + for (size_t i = 0; i < m_crcs.size(); i++) { + const bool selected = m_selectedCrc == i; + if (ImGui::Selectable(m_crcs[i]->GetName().c_str(), selected)) + m_selectedCrc = i; + if (selected) + ImGui::SetItemDefaultFocus(); + } + + ImGui::EndCombo(); + } + + if (m_selectedCrc != 0) { + const auto crc = dynamic_cast(m_crcs[m_selectedCrc].get()); + m_width = crc->GetWidth(); + m_polynomial = crc->GetPolynomial(); + m_initialValue = crc->GetInit(); + m_xorOut = crc->GetXOROut(); + m_reflectIn = crc->GetReflectIn(); + m_reflectOut = crc->GetReflectOut(); + } + + ImGui::BeginDisabled(m_selectedCrc != 0); + ImGuiExt::InputHexadecimal("hex.hashes.hash.common.size"_lang, &m_width); ImGuiExt::InputHexadecimal("hex.hashes.hash.common.poly"_lang, &m_polynomial); ImGuiExt::InputHexadecimal("hex.hashes.hash.common.iv"_lang, &m_initialValue); ImGuiExt::InputHexadecimal("hex.hashes.hash.common.xor_out"_lang, &m_xorOut); @@ -150,17 +177,13 @@ namespace hex::plugin::hashes { ImGui::Checkbox("hex.hashes.hash.common.refl_in"_lang, &m_reflectIn); ImGui::Checkbox("hex.hashes.hash.common.refl_out"_lang, &m_reflectOut); + ImGui::EndDisabled(); } Function create(std::string name) override { return Hash::create(name, [hash = *this](const Region& region, prv::Provider *provider) -> std::vector { - auto result = hash.m_crcFunction(provider, region.address, region.size, hash.m_polynomial, hash.m_initialValue, hash.m_xorOut, hash.m_reflectIn, hash.m_reflectOut); - - std::vector bytes(sizeof(result), 0x00); - std::memcpy(bytes.data(), &result, bytes.size()); - - if constexpr (std::endian::native == std::endian::little) - std::reverse(bytes.begin(), bytes.end()); + auto crc = HashFactory::Checksum::CreateCRC(hash.m_width, hash.m_polynomial, hash.m_initialValue, hash.m_reflectIn, hash.m_reflectOut, hash.m_xorOut, 0, { "CRC" }); + auto bytes = hashProviderRegionWithHashLib(region, provider, crc); return bytes; }); @@ -189,11 +212,13 @@ namespace hex::plugin::hashes { } private: - CRCFunction m_crcFunction; + std::vector m_crcs; + size_t m_selectedCrc = 0; - u32 m_polynomial; - u32 m_initialValue; - u32 m_xorOut; + u32 m_width = 3; + u32 m_polynomial = 0; + u32 m_initialValue = 0; + u32 m_xorOut = 0; bool m_reflectIn = false, m_reflectOut = false; }; @@ -478,66 +503,207 @@ namespace hex::plugin::hashes { int m_size = 1; }; + class HashSnefru : public ContentRegistry::Hashes::Hash { + public: + using FactoryFunction = IHash(*)(Int32 a_security_level, const HashSize &a_hash_size); + + explicit HashSnefru(FactoryFunction function) : Hash("Snefru"), m_factoryFunction(function) {} + void draw() override { + ImGui::SliderInt("hex.hashes.hash.common.security_level"_lang, &m_securityLevel, 1, 1024); + ImGui::Combo("hex.hashes.hash.common.size"_lang, &m_hashSize, "128 Bits\0" "256 Bits\0"); + + } + + Function create(std::string name) override { + return Hash::create(name, [hash = *this](const Region& region, prv::Provider *provider) -> std::vector { + u32 hashSize = 16; + switch (hash.m_hashSize) { + case 0: hashSize = 16; break; + case 1: hashSize = 32; break; + } + + IHash hashFunction = hash.m_factoryFunction(hash.m_securityLevel, HashSize(hashSize)); + + hashFunction->Initialize(); + + return hashProviderRegionWithHashLib(region, provider, hashFunction); + }); + + } + + [[nodiscard]] nlohmann::json store() const override { + nlohmann::json result; + + result["securityLevel"] = m_securityLevel; + result["size"] = m_hashSize; + + return result; + } + + void load(const nlohmann::json &data) override { + try { + m_securityLevel = data.at("securityLevel").get(); + m_hashSize = data.at("size").get(); + } catch (std::exception&) { } + } + + private: + FactoryFunction m_factoryFunction; + int m_securityLevel = 8; + int m_hashSize = 0; + }; + + class HashHaval : public ContentRegistry::Hashes::Hash { + public: + using FactoryFunction = IHash(*)(const HashRounds& a_rounds, const HashSize& a_hash_size); + + explicit HashHaval(FactoryFunction function) : Hash("Haval"), m_factoryFunction(function) {} + void draw() override { + ImGui::Combo("hex.hashes.hash.common.rounds"_lang, &m_hashRounds, "3 Rounds\0" "4 Rounds\0" "5 Rounds\0"); + ImGui::Combo("hex.hashes.hash.common.size"_lang, &m_hashSize, "128 Bits\0" "160 Bits\0" "192 Bits\0" "224 Bits\0" "256 Bits\0"); + + } + + Function create(std::string name) override { + return Hash::create(name, [hash = *this](const Region& region, prv::Provider *provider) -> std::vector { + u32 hashSize = 16; + switch (hash.m_hashSize) { + case 0: hashSize = 16; break; + case 1: hashSize = 32; break; + } + + u32 hashRounds = 3; + switch (hash.m_hashRounds) { + case 0: hashRounds = 3; break; + case 1: hashRounds = 4; break; + case 2: hashRounds = 5; break; + } + + IHash hashFunction = hash.m_factoryFunction(HashRounds(hashRounds), HashSize(hashSize)); + + hashFunction->Initialize(); + + return hashProviderRegionWithHashLib(region, provider, hashFunction); + }); + + } + + [[nodiscard]] nlohmann::json store() const override { + nlohmann::json result; + + result["rounds"] = m_hashRounds; + result["size"] = m_hashSize; + + return result; + } + + void load(const nlohmann::json &data) override { + try { + m_hashRounds = data.at("rounds").get(); + m_hashSize = data.at("size").get(); + } catch (std::exception&) { } + } + + private: + FactoryFunction m_factoryFunction; + int m_hashRounds = 0; + int m_hashSize = 0; + }; + void registerHashes() { - ContentRegistry::Hashes::add(); - - ContentRegistry::Hashes::add(); - ContentRegistry::Hashes::add(); - ContentRegistry::Hashes::add(); - ContentRegistry::Hashes::add(); - ContentRegistry::Hashes::add(); - ContentRegistry::Hashes::add(); - ContentRegistry::Hashes::add>("hex.hashes.hash.crc8", crypt::crc8, 0x07, 0x0000, 0x0000); - ContentRegistry::Hashes::add>("hex.hashes.hash.crc16", crypt::crc16, 0x8005, 0x0000, 0x0000); - ContentRegistry::Hashes::add>("hex.hashes.hash.crc32", crypt::crc32, 0x04C1'1DB7, 0xFFFF'FFFF, 0xFFFF'FFFF, true, true); - ContentRegistry::Hashes::add>("hex.hashes.hash.crc32mpeg", crypt::crc32, 0x04C1'1DB7, 0xFFFF'FFFF, 0x0000'0000, false, false); - ContentRegistry::Hashes::add>("hex.hashes.hash.crc32posix", crypt::crc32, 0x04C1'1DB7, 0x0000'0000, 0xFFFF'FFFF, false, false); - ContentRegistry::Hashes::add>("hex.hashes.hash.crc32c", crypt::crc32, 0x1EDC'6F41, 0xFFFF'FFFF, 0xFFFF'FFFF, true, true); + ContentRegistry::Hashes::add(); + ContentRegistry::Hashes::add(HashFactory::Checksum::CreateAdler32); - hex::ContentRegistry::Hashes::add(HashFactory::Checksum::CreateAdler32); + ContentRegistry::Hashes::add(HashFactory::Crypto::CreateMD2); + ContentRegistry::Hashes::add(HashFactory::Crypto::CreateMD4); + ContentRegistry::Hashes::add(HashFactory::Crypto::CreateMD5); - hex::ContentRegistry::Hashes::add(HashFactory::Hash32::CreateAP); - hex::ContentRegistry::Hashes::add(HashFactory::Hash32::CreateBKDR); - hex::ContentRegistry::Hashes::add(HashFactory::Hash32::CreateBernstein); - hex::ContentRegistry::Hashes::add(HashFactory::Hash32::CreateBernstein1); - hex::ContentRegistry::Hashes::add(HashFactory::Hash32::CreateDEK); - hex::ContentRegistry::Hashes::add(HashFactory::Hash32::CreateDJB); - hex::ContentRegistry::Hashes::add(HashFactory::Hash32::CreateELF); - hex::ContentRegistry::Hashes::add(HashFactory::Hash32::CreateFNV1a_32); - hex::ContentRegistry::Hashes::add(HashFactory::Hash32::CreateFNV32); - hex::ContentRegistry::Hashes::add(HashFactory::Hash32::CreateJS); - hex::ContentRegistry::Hashes::add(HashFactory::Hash32::CreateOneAtTime); - hex::ContentRegistry::Hashes::add(HashFactory::Hash32::CreatePJW); - hex::ContentRegistry::Hashes::add(HashFactory::Hash32::CreateRotating); - hex::ContentRegistry::Hashes::add(HashFactory::Hash32::CreateRS); - hex::ContentRegistry::Hashes::add(HashFactory::Hash32::CreateSDBM); - hex::ContentRegistry::Hashes::add(HashFactory::Hash32::CreateShiftAndXor); - hex::ContentRegistry::Hashes::add(HashFactory::Hash32::CreateSuperFast); + ContentRegistry::Hashes::add(HashFactory::Crypto::CreateSHA0); + ContentRegistry::Hashes::add(HashFactory::Crypto::CreateSHA1); + ContentRegistry::Hashes::add(HashFactory::Crypto::CreateSHA2_224); + ContentRegistry::Hashes::add(HashFactory::Crypto::CreateSHA2_256); + ContentRegistry::Hashes::add(HashFactory::Crypto::CreateSHA2_384); + ContentRegistry::Hashes::add(HashFactory::Crypto::CreateSHA2_512); + ContentRegistry::Hashes::add(HashFactory::Crypto::CreateSHA2_512_224); + ContentRegistry::Hashes::add(HashFactory::Crypto::CreateSHA2_512_256); + ContentRegistry::Hashes::add(HashFactory::Crypto::CreateSHA3_224); + ContentRegistry::Hashes::add(HashFactory::Crypto::CreateSHA3_256); + ContentRegistry::Hashes::add(HashFactory::Crypto::CreateSHA3_384); + ContentRegistry::Hashes::add(HashFactory::Crypto::CreateSHA3_512); - hex::ContentRegistry::Hashes::add(HashFactory::Hash32::CreateMurmur2_32); - hex::ContentRegistry::Hashes::add(HashFactory::Hash32::CreateMurmurHash3_x86_32); - hex::ContentRegistry::Hashes::add(HashFactory::Hash32::CreateXXHash32); + ContentRegistry::Hashes::add(HashFactory::Crypto::CreateKeccak_224); + ContentRegistry::Hashes::add(HashFactory::Crypto::CreateKeccak_256); + ContentRegistry::Hashes::add(HashFactory::Crypto::CreateKeccak_288); + ContentRegistry::Hashes::add(HashFactory::Crypto::CreateKeccak_384); + ContentRegistry::Hashes::add(HashFactory::Crypto::CreateKeccak_512); - hex::ContentRegistry::Hashes::add(HashFactory::Hash32::CreateJenkins3); - hex::ContentRegistry::Hashes::add(HashFactory::Hash64::CreateFNV64); - hex::ContentRegistry::Hashes::add(HashFactory::Hash64::CreateFNV1a_64); + ContentRegistry::Hashes::add(HashFactory::Crypto::CreateGrindahl256); + ContentRegistry::Hashes::add(HashFactory::Crypto::CreateGrindahl512); - hex::ContentRegistry::Hashes::add(HashFactory::Hash64::CreateMurmur2_64); - hex::ContentRegistry::Hashes::add(HashFactory::Hash64::CreateSipHash64_2_4); - hex::ContentRegistry::Hashes::add(HashFactory::Hash64::CreateXXHash64); + ContentRegistry::Hashes::add(HashFactory::Crypto::CreatePanama); + ContentRegistry::Hashes::add(HashFactory::Crypto::CreateWhirlPool); - hex::ContentRegistry::Hashes::add(HashFactory::Hash128::CreateSipHash128_2_4); - hex::ContentRegistry::Hashes::add(HashFactory::Hash128::CreateMurmurHash3_x86_128); - hex::ContentRegistry::Hashes::add(HashFactory::Hash128::CreateMurmurHash3_x64_128); + ContentRegistry::Hashes::add(HashFactory::Crypto::CreateRadioGatun32); + ContentRegistry::Hashes::add(HashFactory::Crypto::CreateRadioGatun64); - hex::ContentRegistry::Hashes::add("hex.hashes.hash.tiger", HashFactory::Crypto::CreateTiger); - hex::ContentRegistry::Hashes::add("hex.hashes.hash.tiger2", HashFactory::Crypto::CreateTiger2); + ContentRegistry::Hashes::add(HashFactory::Crypto::CreateGost); + ContentRegistry::Hashes::add(HashFactory::Crypto::CreateGOST3411_2012_256); + ContentRegistry::Hashes::add(HashFactory::Crypto::CreateGOST3411_2012_512); - hex::ContentRegistry::Hashes::add>("hex.hashes.hash.blake2b", HashFactory::Crypto::CreateBlake2B); - hex::ContentRegistry::Hashes::add>("hex.hashes.hash.blake2s", HashFactory::Crypto::CreateBlake2S); + ContentRegistry::Hashes::add(HashFactory::Crypto::CreateHAS160); + + ContentRegistry::Hashes::add(HashFactory::Crypto::CreateRIPEMD); + ContentRegistry::Hashes::add(HashFactory::Crypto::CreateRIPEMD128); + ContentRegistry::Hashes::add(HashFactory::Crypto::CreateRIPEMD160); + ContentRegistry::Hashes::add(HashFactory::Crypto::CreateRIPEMD256); + ContentRegistry::Hashes::add(HashFactory::Crypto::CreateRIPEMD320); + + ContentRegistry::Hashes::add(HashFactory::Crypto::CreateSnefru); + ContentRegistry::Hashes::add(HashFactory::Crypto::CreateHaval); + + ContentRegistry::Hashes::add("Tiger", HashFactory::Crypto::CreateTiger); + ContentRegistry::Hashes::add("Tiger2", HashFactory::Crypto::CreateTiger2); + + ContentRegistry::Hashes::add>("Blake2b", HashFactory::Crypto::CreateBlake2B); + ContentRegistry::Hashes::add>("Blake2s", HashFactory::Crypto::CreateBlake2S); + + ContentRegistry::Hashes::add(HashFactory::Hash32::CreateAP); + ContentRegistry::Hashes::add(HashFactory::Hash32::CreateBKDR); + ContentRegistry::Hashes::add(HashFactory::Hash32::CreateBernstein); + ContentRegistry::Hashes::add(HashFactory::Hash32::CreateBernstein1); + ContentRegistry::Hashes::add(HashFactory::Hash32::CreateDEK); + ContentRegistry::Hashes::add(HashFactory::Hash32::CreateDJB); + ContentRegistry::Hashes::add(HashFactory::Hash32::CreateELF); + ContentRegistry::Hashes::add(HashFactory::Hash32::CreateFNV1a_32); + ContentRegistry::Hashes::add(HashFactory::Hash32::CreateFNV32); + ContentRegistry::Hashes::add(HashFactory::Hash32::CreateJS); + ContentRegistry::Hashes::add(HashFactory::Hash32::CreateOneAtTime); + ContentRegistry::Hashes::add(HashFactory::Hash32::CreatePJW); + ContentRegistry::Hashes::add(HashFactory::Hash32::CreateRotating); + ContentRegistry::Hashes::add(HashFactory::Hash32::CreateRS); + ContentRegistry::Hashes::add(HashFactory::Hash32::CreateSDBM); + ContentRegistry::Hashes::add(HashFactory::Hash32::CreateShiftAndXor); + ContentRegistry::Hashes::add(HashFactory::Hash32::CreateSuperFast); + + ContentRegistry::Hashes::add(HashFactory::Hash32::CreateMurmur2_32); + ContentRegistry::Hashes::add(HashFactory::Hash32::CreateMurmurHash3_x86_32); + ContentRegistry::Hashes::add(HashFactory::Hash32::CreateXXHash32); + + ContentRegistry::Hashes::add(HashFactory::Hash32::CreateJenkins3); + + ContentRegistry::Hashes::add(HashFactory::Hash64::CreateFNV64); + ContentRegistry::Hashes::add(HashFactory::Hash64::CreateFNV1a_64); + + ContentRegistry::Hashes::add(HashFactory::Hash64::CreateMurmur2_64); + ContentRegistry::Hashes::add(HashFactory::Hash64::CreateSipHash64_2_4); + ContentRegistry::Hashes::add(HashFactory::Hash64::CreateXXHash64); + + ContentRegistry::Hashes::add(HashFactory::Hash128::CreateSipHash128_2_4); + ContentRegistry::Hashes::add(HashFactory::Hash128::CreateMurmurHash3_x86_128); + ContentRegistry::Hashes::add(HashFactory::Hash128::CreateMurmurHash3_x64_128); } } \ No newline at end of file