This commit refactors the test suites for the `crypt` and `enchantrix` packages to follow the "Good, Bad, Ugly" testing methodology.
- `_Good` tests cover the ideal "happy path" scenarios.
- `_Bad` tests cover expected failure scenarios with well-formed but invalid inputs.
- `_Ugly` tests cover malicious or malformed inputs designed to cause crashes or panics.
This change improves test coverage and ensures that the codebase is more robust and resilient to unexpected inputs.
- Refactors `trix.Encode` and `trix.Decode` to allow for dependency injection, enabling the testing of I/O error paths.
- Adds comprehensive tests for the `trix` package to cover all error paths.
- Adds tests for the `Fletcher` checksums and `ensureRSA` function in the `crypt` package.
- Adds tests for the `lthn` package to cover the `SetKeyMap` and `GetKeyMap` functions.
- Adds tests for the `chachapoly` package to cover error paths.
- Adds tests for the `rsa` package to cover error paths.
Adds `_internal_test.go` files to test unexported functions in the `crypt` and `lthn` packages, improving overall test coverage.
- Adds tests for the `ensureRSA` private function in `pkg/crypt/crypt.go`.
- Adds tests for the `createSalt` private function in `pkg/crypt/std/lthn/lthn.go`.
These changes align with the project's TDD methodology and follow the `_Good`, `_Bad`, `_Ugly` testing structure.