# Kate libsodium Compatibility Tests This directory contains tests to verify that the `kate` package's `seal` and `open` functions are compatible with the real libsodium implementation. ## Why? The `kate` library is designed to be CGO-free to avoid the complexity and deployment challenges that come with C dependencies. Rather than requiring applications to link against libsodium, `kate` implements a pure Go version of the NaCl secretbox encryption scheme. This separate compatibility test project verifies that `kate`'s implementation produces ciphertext that is fully interoperable with libsodium while keeping the CGO dependency isolated from the main package. This way, applications get the benefits of a pure Go library while maintaining confidence in libsodium compatibility. ## Setup The tests require libsodium to be installed on your system. The project uses the `github.com/jamesruan/sodium` Go bindings for libsodium. ### Installing libsodium On macOS: ```bash brew install libsodium ``` On Ubuntu/Debian: ```bash sudo apt-get install libsodium-dev ``` On CentOS/RHEL: ```bash sudo yum install libsodium-devel ``` ## Running the Tests ```bash cd compat-test go test ``` ## Test Cases The test suite includes: 1. **KateEncrypt_LibsodiumDecrypt**: Encrypts data with kate's library and decrypts with libsodium 2. **LibsodiumEncrypt_KateDecrypt**: Encrypts data with libsodium and decrypts with kate's library