Fix a layering issue: private EncryptBlock() should use a private key representation

This commit is contained in:
hashlag
2026-01-22 22:36:14 +03:00
parent fa042e7abf
commit 3a2a665031

View File

@@ -218,7 +218,8 @@ public:
block[i] = *in; block[i] = *in;
} }
Block encrypted = EncryptBlock(Inner_::Bitwise::PackUInt64(block.Begin(), block.End()), key); Inner_::KeySchedule schedule(key.Key_);
Block encrypted = EncryptBlock(Inner_::Bitwise::PackUInt64(block.Begin(), block.End()), schedule);
Inner_::Bitwise::CrunchUInt64(out, encrypted); Inner_::Bitwise::CrunchUInt64(out, encrypted);
} }
@@ -391,10 +392,8 @@ private:
FP_TABLE + std::size(FP_TABLE)); FP_TABLE + std::size(FP_TABLE));
} }
static Block EncryptBlock(Block block, const Key & key) static Block EncryptBlock(Block block, const Inner_::KeySchedule & schedule)
{ {
Inner_::KeySchedule schedule(key.Key_);
block = Ip(block); block = Ip(block);
uint32_t l32; uint32_t l32;