Implements ChaChaPolySigil that applies pre-obfuscation before sending
data to CPU encryption routines. This ensures raw plaintext is never
passed directly to encryption functions.
Key improvements:
- XORObfuscator and ShuffleMaskObfuscator for pre-encryption transforms
- Nonce is now properly embedded in ciphertext, not stored separately
in headers (production-ready, not demo-style)
- Trix crypto integration with EncryptPayload/DecryptPayload methods
- Comprehensive test coverage following Good/Bad/Ugly pattern
- Add `SymmetricallyDecrypt` to `pkg/crypt/std/pgp`.
- Add validation for empty passphrases in `SymmetricallyEncrypt` and `SymmetricallyDecrypt`.
- Refactor `pkg/crypt/std/pgp/pgp.go` to use package-level variables for `openpgp` functions to enable mocking.
- Add comprehensive tests in `pkg/crypt/std/pgp/pgp_test.go` to cover error paths using mocks, achieving 100% coverage.
- Remove practically unreachable error check in `GenerateKeyPair` for `SignUserId` (as `NewEntity` guarantees validity).
Adds comprehensive docstrings and runnable examples to all public APIs in the `crypt`, `enchantrix`, and `trix` packages. This change is intended to bring the project's documentation to a production-ready standard and to provide high-quality, verifiable examples for the official Go documentation website.
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.
Increases the test coverage of the project to over 90%.
- Increases the test coverage of the `cmd/trix` package from 82.3% to 83.3%.
- Increases the test coverage of the `pkg/crypt/std/pgp` package from 84.0% to over 90%.
- Adds tests for error paths and edge cases in `cmd/trix` and `pkg/crypt/std/pgp`.
Increases the test coverage of the project.
- Increases the test coverage of the `cmd/trix` package from 78.1% to 82.3%.
- Increases the test coverage of the `pkg/crypt/std/pgp` package from 76.5% to 84.0%.
- Adds tests for error paths and edge cases in `cmd/trix` and `pkg/crypt/std/pgp`.
Improves the test coverage of the project and adds examples for coverage reports.
- Increases the test coverage of the `cmd/trix` package from 67.7% to 78.1%.
- Increases the test coverage of the `pkg/crypt` package from 96.2% to 98.7%.
- Adds tests for the `examples` to ensure they run without errors.
- Adds a new example that demonstrates how to generate and interpret a coverage report.
Adds a comprehensive set of examples to demonstrate the library's features.
- Breaks out the existing `examples/main.go` into separate, well-named files.
- Adds new examples for hashing, checksums, RSA, and PGP.
- The PGP examples cover key generation, encryption/decryption, signing/verification, and symmetric encryption.
- Removes the old `examples/main.go` file and formats the new example files.
Increases the test coverage of the project from 85.5% to 89.2%.
- Adds tests for the `IsHashAlgo` function and PGP functions in `pkg/crypt`.
- Adds tests for the `main` function and command handlers in `cmd/trix`.
- Improves the overall test coverage of the `cmd/trix` package from 26.0% to 67.7%.
- Improves the overall test coverage of the `pkg/crypt` package from 78.2% to 96.2%.
Expands the existing OpenPGP implementation to include a more complete set of features for handling PGP data.
- Adds support for signing and verifying detached signatures.
- Adds support for symmetric encryption using a passphrase.
- Includes tests for all new functionality.
Adds a full implementation of OpenPGP features using ProtonMail's go-crypto fork.
- Implements PGP key generation, encryption, and decryption.
- Exposes PGP functionality through the crypt.Service.
- Adds tests for the PGP implementation.
This commit fixes the fuzz test in the GitHub Actions workflow by correctly scoping it to the `pkg/trix` package. The `go test -fuzz` command can only be run on a single package at a time.
This also corrects the `-run` flag to ensure the fuzz test is executed correctly.
Adds `go vet` to the test procedures in both the local `Taskfile.yml` and the GitHub Actions workflow.
Also includes the following changes:
- Refactors the `trix` CLI to use the `cobra` library to improve testability.
- Adds comprehensive tests for the `trix` CLI, achieving 100% test coverage.
- Fixes a closure bug in the sigil command creation loop.
- Refactors the CLI to use Cobra's I/O writers, making the output testable.
This commit adds a new documentation website built with MkDocs and the Material theme.
The website includes pages for:
- Trix & Sigil Chaining
- Hashing
- Checksums
- RSA
- Standalone Sigils
A GitHub Actions workflow is also included to automatically build and deploy the site to GitHub Pages when changes are merged into the main branch.
- 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.
- Fixes the example in `examples/main.go` to work with the refactored `trix` package.
- Refactors the `lthn` keymap test to be thread-safe by using a mutex and `t.Cleanup` to ensure state is properly restored.
- Corrects the `mockReader` implementation in the `trix` tests to adhere to the `io.Reader` interface contract.
- Removes dead code from `pkg/trix/trix.go`.
- 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.
- Fixes the example in `examples/main.go` to work with the refactored `trix` package.
- Refactors the `lthn` keymap test to be thread-safe by using a mutex and `t.Cleanup` to ensure state is properly restored.
- Corrects the `mockReader` implementation in the `trix` tests to adhere to the `io.Reader` interface contract.
- Refactors the `lthn` keymap test to be thread-safe by using a mutex and `t.Cleanup` to ensure state is properly restored.
- Corrects the `mockReader` implementation in the `trix` tests to adhere to the `io.Reader` interface contract.
- 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.
- Refactors sigil tests into a dedicated `sigils_test.go` file.
- Adds a comprehensive data-driven test for all hash sigils.
- Adds a test for error handling in the `HashSigil`.
- Adds a test for the `JSONSigil.Out` method.
- Adds tests for the error paths in the `GzipSigil.In` method.
- Fixes a bug in `GzipSigil.In` that was introduced while adding tests.
- Refactors sigil tests into a dedicated `sigils_test.go` file.
- Adds a comprehensive data-driven test for all hash sigils.
- Adds a test for error handling in the `HashSigil`.
Moves all test files from the `tdd/` directory to their corresponding `pkg/` subdirectories. This aligns with standard Go project structure and simplifies the test coverage workflow.
- Moves `tdd/crypt/crypt_test.go` to `pkg/crypt/`
- Moves `tdd/enchantrix/enchantrix_test.go` to `pkg/enchantrix/`
- Moves `tdd/trix/trix_test.go` to `pkg/trix/`
- Simplifies the `Taskfile.yml` to use a standard `go test` command.
- Removes the now-obsolete `tdd/` directory.
- Adds generated coverage files to `.gitignore`.