Skip to content

Commit

Permalink
ObfusString: Do at least a single LCG step before using its state
Browse files Browse the repository at this point in the history
  • Loading branch information
Sainan committed Jan 17, 2025
1 parent b644a4a commit 343313c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions soup/ObfusString.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ NAMESPACE_SOUP
for (size_t i = 0; i != Len; ++i)
{
const auto m = i % 8;
m_data[i] ^= rng.state >> (m * 8);
if (m == 7)
if (m == 0)
{
rng.skip();
}
m_data[i] ^= rng.state >> (m * 8);
}

// mirror
Expand Down Expand Up @@ -86,11 +86,11 @@ NAMESPACE_SOUP
for (size_t i = 0; i != Len; ++i)
{
const auto m = i % 8;
m_data[i] ^= rng.state >> (m * 8);
if (m == 7)
if (m == 0)
{
rng.skip();
}
m_data[i] ^= rng.state >> (m * 8);
}

// rot13
Expand Down

0 comments on commit 343313c

Please sign in to comment.