#nacl #cryptography #ffi #no_std

sys no-std tweetnacl-sys

tweetnacl & FFI bindings to it

4 releases

0.1.3 Sep 29, 2017
0.1.2 Jan 19, 2017
0.1.1 Mar 19, 2016
0.1.0 Feb 28, 2016

#5 in #nacl

38 downloads per month
Used in 2 crates (1 directly)


750 lines


An implimentation of tweetnacl in pure rust. Originally generated by manually translating tweetnacl.c into rust. Tested by verifying outputs match those of tweetnacl.


  • provide additional APIs:
  • rather than take bare mutable references, use wrapper types around the refs to capture the underlying type (ie: prevent mixing keys between primitives)
  • add a buffer and/or "set-only" abstraction to prevent unsafety wrt uninitialized values (also should allow some internal optimization).
  • sodiumoxide style API that returns values rather than taking mutable refs
  • Use namespacing to seperate different APIs and backend impls
  • start testing against sodiumoxide as well
  • Provide some of the API impovements from libsodium that are missing nacl (disjoint signatures, not requiring special extra space in buffers)


Licensed under either of


Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.