I wrote an algorithm for decrypting/encrypting files from SII10thAnni for modding.
I went from c to c++ and now to rust. This is my first time writing rust.
I tried to use clippy and I only get errors from thiserror (how ironic) and crates being not compatible to rustc 1.82.
I don't have unit test but a test that tries to encrypt and decrypt all files from the game. If you want to test it, you can just try to encrypt a random file.
The algorithm relies on a variation of the lzss compression, a variation of the crc and a random wich does a mod 2^31 multiplication.
Code (everything is in this one 500 line file)