#pragma once #include #include #include #include #include namespace hex::prv { class Provider; } namespace hex::crypt { void initialize(); void exit(); u16 crc8(prv::Provider* &data, u64 offset, size_t size, u32 polynomial, u32 init, u32 xorout, bool reflectIn, bool reflectOut); u16 crc16(prv::Provider* &data, u64 offset, size_t size, u32 polynomial, u32 init, u32 xorout, bool reflectIn, bool reflectOut); u32 crc32(prv::Provider* &data, u64 offset, size_t size, u32 polynomial, u32 init, u32 xorout, bool reflectIn, bool reflectOut); std::array md5(prv::Provider* &data, u64 offset, size_t size); std::array sha1(prv::Provider* &data, u64 offset, size_t size); std::array sha224(prv::Provider* &data, u64 offset, size_t size); std::array sha256(prv::Provider* &data, u64 offset, size_t size); std::array sha384(prv::Provider* &data, u64 offset, size_t size); std::array sha512(prv::Provider* &data, u64 offset, size_t size); std::array md5(const std::vector &data); std::array sha1(const std::vector &data); std::array sha224(const std::vector &data); std::array sha256(const std::vector &data); std::array sha384(const std::vector &data); std::array sha512(const std::vector &data); std::vector decode64(const std::vector &input); std::vector encode64(const std::vector &input); std::vector decode16(const std::string &input); std::string encode16(const std::vector &input); enum class AESMode : u8 { ECB = 0, CBC = 1, CFB128 = 2, CTR = 3, GCM = 4, CCM = 5, OFB = 6, XTS = 7 }; enum class KeyLength : u8 { Key128Bits = 0, Key192Bits = 1, Key256Bits = 2 }; std::vector aesDecrypt(AESMode mode, KeyLength keyLength, const std::vector &key, std::array nonce, std::array iv, const std::vector &input); }