NaCl is one of the most widely used cryptography libraries currently available. Tweet-NaCl distills it into an entirely understandable, auditable and portable 100-tweets worth of C code (no really: it is even on Twitter).
Pure Java Tweet-NaCl
Java Tweet-NaCl is a pure Java port of the Tweet-NaCl cryptography library. The actual port was pretty easy except when it briefly turned into a regex-olympics competition to turn as much of the C to Java automatically.
To verify the correctness of our pure-Java port, we wrapped the pure-C Tweet-NaCl library in the Java Native Interface (JNI). This allowed us to directly test the various Tweet-NaCl API calls in the C-source and our Java port.
So there you go: three implementations of the Tweet-NaCl library running in the same JVM:
- The original C running in the JNI;
- Our new pure-Java port running directly.
And best of all, all tests are now passing!Go Top