This commit introduces the initial implementation of the xmrig-proxy functionality.
It includes:
- A new `proxy` command to the CLI to start the proxy.
- A new `pkg/proxy` package to encapsulate the core proxy logic.
- A mock proxy service that simulates workers connecting.
- The initial implementation of the XMRig Proxy API, with the `/` and `/workers.json` endpoints.
This commit introduces a more secure sigil workflow by separating the transformation logic from the serialization logic.
- The `Trix` struct now has `Pack()` and `Unpack()` methods to apply sigil transformations directly to the payload.
- The `Encode()` and `Decode()` functions are now solely responsible for serialization, no longer handling sigil logic.
- The recommended workflow is to `Pack()` the data (obfuscating it), then encrypt it, and finally `Encode()` the container. This prevents cleartext from being sent to the CPU's encryption instructions.
This change enhances security by adding a user-defined obfuscation layer before the encryption process begins, true to the spirit of Enchantrix.
This commit introduces the concept of "sigils," which are programmable, pure-function transformers that can be applied to a Trix container's payload.
- A `Sigil` interface with `In` and `Out` methods is defined in the `trix` package.
- The `Trix` struct now includes a `Sigils` field to attach a chain of transformers.
- The `Encode` function applies the `In` transformations before encoding the payload.
- The caller is responsible for applying the `Out` transformations after decoding.
This new feature provides a flexible and extensible data pipeline for `Trix` containers.
The implementation is fully tested with the Good, Bad, and Ugly testing strategy.
This commit refactors the test suites for the `crypt` and `trix` packages to follow the Good, Bad, and Ugly testing strategy.
- `_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 new testing structure makes the test suite more organized, comprehensive, and robust.
Additionally, this commit includes a bug fix for the `Luhn` function, which now correctly handles empty and single-digit strings.
This commit makes the magic number in the trix file format configurable.
- The `Encode` and `Decode` functions in the `trix` package now accept a `magicNumber` string as a parameter.
- The example in `examples/main.go` has been updated to demonstrate the use of the new configurable magic number.
- The tests for the `trix` package have been updated to verify the new functionality, including tests for invalid magic numbers.
This commit finalizes the project restructuring into a Core-compatible service.
- The `crypt` package is now a service with methods instead of standalone functions.
- Cryptographic implementations (`lthn`, `chachapoly`, `rsa`) are now in `pkg/crypt/std`.
- The `trix` package has been moved to `pkg/trix`.
- The `rootfs` components have been removed to decouple the library from storage.
- All import paths have been updated to reflect the new structure.
- A `Taskfile.yml` has been added for managing common tasks.
This commit restructures the `crypt` service to be more modular and decoupled from storage concerns.
- The standard cryptographic implementations (`lthn`, `chachapoly`, `rsa`) have been moved to the `pkg/crypt/std` directory.
- The `rootfs` components have been removed to decouple the library from storage.
- Import paths have been updated to reflect the new structure.
This commit introduces a new, generic `.trix` file format, which is decoupled from any specific encryption algorithm.
The format is defined in `docs/trix_format.md` and consists of a magic number, version, a flexible JSON header, and a raw data payload.
A new `trix` Go package is implemented to handle the encoding and decoding of this format. Unit tests are included to verify the implementation.
An example file, `examples/main.go`, is also added to demonstrate how to use the `.trix` container to store data encrypted with the `chachapoly` package, showcasing the intended decoupled design.
This commit introduces a new `rootfs` package that provides an encrypted passthrough storage system. The `LocalStorage` implementation uses the local file system as its backing store and encrypts all data at rest using the `chachapoly` package.
The functionality is exposed through the main `crypt` package, providing a clean and simple API for creating and interacting with encrypted file-based storage.
This commit enhances the `README.md` file with more detailed information about the project, including a usage example and a development philosophy section. It also adds a new file, `.ideas/future_improvements.md`, to log out-of-scope ideas for future development.
This commit introduces ChaCha20-Poly1305 encryption functionality. It includes the following changes:
- A new `chachapoly` package has been added.
- The `chachapoly` package contains `Encrypt` and `Decrypt` functions.
- The functionality is fully tested.
- An `.ideas` directory has been created.
This commit adds a step to the GitHub Actions workflow to generate and upload a test coverage report. It also renames the `Verifyf` function in the `lthn` package to `Verify` to match the Core repository.
This commit updates the Go version to 1.25 in the `go.mod` and `go.work` files. It also updates the GitHub Actions workflow to use the `go.work` file to determine the Go version and adds a step to set up `task`.
This commit adds a GitHub Actions workflow to build and test the Go code on every push and pull request. It also corrects the Go version in the `go.mod` file to `1.22`.
This commit ports the crypt library from the Core repository to the Enchantrix repository. It includes the following changes:
- The project is now a Go module.
- The `lthn` and `crypt` packages have been ported from the Core repository.
- The PGP functionality has been commented out pending resolution of dependency issues.
- The old Deno project has been moved to the `vault` directory.
- The README has been updated to reflect the new project structure.