Using Clojure with C APIs for crypto and more
summary
Binding C libraries from Clojure using cesium (Clojure binding of libsodium) and jnr-ffi proves practical: a working crypto binding is built with zero Java sources, uses direct ByteBuffers and pinned memory for no-copy in-place APIs, and reduces a potential 12,000-symbol explosion with macros including the Sparkles macro. JNA shows 10–1000x overhead, jnr approaches JNI performance (penalty is tiny in practice), toolchain and packaging (.deb/.rpm) work for production deployment.
AI-written summary · about
chapters (9)
- 0:00Start
- 1:44Why crypto?
- 3:11Why C?
- 17:18Return type?
- 18:35Getting the right types
- 20:23Pick a type
- 22:25Asymmetry
- 36:10Expose every byte type
- 39:36Future work
related talks
31mclojure.web/with-security
47mClojail: Life in a Clojure Prison
30mAre we using Java Crypto API Securely ?
36mKrypt. Semper Pi.
24mApache Commons Crypto: Another Wheel of Apache Commons
46mSecure Web Applications with Clojure
41mJNI, czyli Java i C w jednym projekcie
44mTheory to Practice: Real-World Lessons in Post-Quantum Cryptography Migration
