Commit graph

11 commits

Author SHA1 Message Date
google-labs-jules[bot]
fca2880355 feat: add 100% docstring coverage
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.
2025-11-14 14:39:45 +00:00
google-labs-jules[bot]
e112ec363d feat: Add Good, Bad, and Ugly tests
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.
2025-11-13 21:27:38 +00:00
google-labs-jules[bot]
b6b526bcf7 feat: Expand OpenPGP implementation
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.
2025-11-13 19:06:20 +00:00
google-labs-jules[bot]
a46477c8fd feat: Add OpenPGP implementation
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.
2025-11-13 19:02:03 +00:00
google-labs-jules[bot]
695fe6dfeb feat: Add go vet to test procedures and fix issues
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.
2025-11-03 20:30:34 +00:00
Snider
0ca908f434 style: format code for consistency and readability 2025-11-03 00:13:13 +00:00
google-labs-jules[bot]
e7aeb3c8b8 Refactor(crypt): Improve RSA safety and flexibility
This commit introduces several improvements to the RSA implementation:

- Preserves zero-value service safety by lazily initializing the RSA service in `pkg/crypt/crypt.go`.
- Enforces a minimum RSA key size of 2048 bits in `pkg/crypt/std/rsa/rsa.go` to prevent the generation of insecure keys.
- Exposes the OAEP label parameter in `Encrypt` and `Decrypt` functions, allowing for more advanced use cases.
- Adds a test case to verify that `GenerateKeyPair` correctly rejects key sizes below the new minimum.
2025-11-02 03:06:04 +00:00
coderabbitai[bot]
186b75c402
📝 Add docstrings to feature-openpgp-implementation
Docstrings generation was requested by @Snider.

* https://github.com/Snider/Enchantrix/pull/17#issuecomment-3473285782

The following files were modified:

* `pkg/crypt/crypt.go`
* `pkg/crypt/std/rsa/rsa.go`
2025-10-31 19:59:43 +00:00
google-labs-jules[bot]
83e8174634 feat: Implement RSA service
This commit introduces a standard RSA implementation in `pkg/crypt/std/rsa`.

The new `rsa.Service` provides a clean API for RSA operations, including:
- Key pair generation
- Encryption and decryption of data

The implementation uses the standard `crypto/rsa` package and follows best practices, including OAEP padding. The main `crypt.Service` has been updated to integrate and expose this new functionality.

This work was done to validate the build environment, and the tests for this implementation pass successfully, confirming that the previous testing issues were isolated to the OpenPGP library.
2025-10-31 14:46:28 +00:00
google-labs-jules[bot]
52aa833a2f feat: Implement OpenPGP service
This commit introduces a full OpenPGP implementation in `pkg/crypt/std/openpgp`, using the ProtonMail `go-crypto` library.

The new `openpgp.Service` provides a clean, Web3-friendly API for PGP operations, including:
- Key pair generation
- Subkey management
- Encryption and decryption of messages
- Signing and verification of messages

The implementation is based on the user's `Core` repository and uses file-based key management. The main `crypt.Service` has been updated to integrate and expose this new functionality.
2025-10-31 14:13:57 +00:00
google-labs-jules[bot]
d5ae9a44e1 feat: Implement 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.
2025-10-31 02:03:33 +00:00
Renamed from crypt.go (Browse further)