diff options
author | mrb0nk500 <b0nk@b0nk.xyz> | 2023-02-28 09:24:05 -0400 |
---|---|---|
committer | mrb0nk500 <b0nk@b0nk.xyz> | 2023-02-28 09:26:35 -0400 |
commit | 9326e63440b08f877302a87afbe1ef82d5cd2c76 (patch) | |
tree | 842adf8c9f9b1b99813d30e58631308514fbc9f4 /src/pso | |
parent | 8453a85359ef9dca831f78d56e56da8eb8415707 (diff) |
PSOV3Encryption: Make `update_stream()` a lot cleaner
Diffstat (limited to 'src/pso')
-rw-r--r-- | src/pso/PSOV3Encryption.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/pso/PSOV3Encryption.cpp b/src/pso/PSOV3Encryption.cpp index 30c5586..38225bf 100644 --- a/src/pso/PSOV3Encryption.cpp +++ b/src/pso/PSOV3Encryption.cpp @@ -13,17 +13,17 @@ u32 PSOV3Encryption::next() { void PSOV3Encryption::update_stream() { u32 *ptr; - u32 *first_end; - u32 *start; + u32 *part1; + u32 *part2; - start = m_buffer.start(); + part2 = m_buffer.start(); m_buffer_start = m_buffer.start(); + ptr = m_buffer.start(); + part1 = &ptr[489]; - for (ptr = m_buffer.start(), first_end = &ptr[489]; first_end != m_buffer_end;) { - *ptr++ ^= *first_end++; - } + for (; part1 != m_buffer_end; *ptr++ ^= *part1++); + for (; ptr != m_buffer_end; *ptr++ ^= *part2++); - for (u32 *p = ptr; p != m_buffer_end; *p++ ^= *start++); } void PSOV3Encryption::init(u32 seed) { |