rodecomp/Source/Archive/PakCipher.h
ragnarok-clanker fd30814c59 Decompile 3 functions in Source/Archive/PakCipher.cpp, Source/Archive/PakCipher.h
Batch #14650 by Yommy: 0 byte-identical, 3 confirmed by peer review.

- fn_18099 myGPack::PakCipher::Decode: logic confirmed by peer review
- fn_18101 myGPack::PakCipher::DecodeBlock: logic confirmed by peer review
- fn_18102 myGPack::PakCipher::EncodeBlock: logic confirmed by peer review

Peer-reviewed-by: secret, Tanke, codeplay
Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
2026-11-07 12:37:29 +00:00

30 lines
1,020 B
C++

#ifndef RAGNAROK_SOURCE_ARCHIVE_PAKCIPHER_H
#define RAGNAROK_SOURCE_ARCHIVE_PAKCIPHER_H
#include <cstdint>
namespace myGPack {
class PakCipher {
public:
PakCipher();
explicit PakCipher(const std::uint8_t* key);
~PakCipher();
int DecodeBlock(int rounds, const std::uint8_t (*roundKeys)[8], std::uint32_t inputLow, std::uint32_t inputHigh, std::uint8_t* output) const;
int EncodeBlock(int rounds, const std::uint8_t (*roundKeys)[8], std::uint32_t inputLow, std::uint32_t inputHigh, std::uint8_t* output) const;
int Decode(const std::uint8_t* input, int length, std::uint8_t* output, int* outputLength, int cycle) const;
int DecodePrefix(const std::uint8_t* input, int length, std::uint8_t* output, int* outputLength) const;
private:
/* 0000 */ std::uint8_t m_roundKeys[16][8];
void BuildRoundKeys(const std::uint8_t* key);
};
static_assert(sizeof(PakCipher) == 128);
int InitialPermutation(std::uint8_t* block);
int FinalPermutation(std::uint8_t* block);
}
#endif