TweetNaCl crypto library port to the Go language
Go C Makefile
Permalink
Failed to load latest commit information.
.gitignore crypto_hash: added example for crypto_hash_blocks Apr 8, 2016
LICENSE Initial commit Mar 31, 2016
Makefile Moved unit tests back into main directory May 6, 2016
README.md Updated README for version 1.00.0 May 6, 2016
crypto_auth.go crypto_auth: added unit tests for crypto_auth_verify argument validation Apr 25, 2016
crypto_auth_test.go Moved unit tests back into main directory May 6, 2016
crypto_box.go README: updated (and other minor cleanups) May 3, 2016
crypto_box_test.go Moved unit tests back into main directory May 6, 2016
crypto_core.go crypto_core: added argument validation to CryptoCoreSalsa20 Apr 22, 2016
crypto_core_test.go Moved unit tests back into main directory May 6, 2016
crypto_hash.go crypto_hash: removed CryptoHashBlocks May 4, 2016
crypto_hash_test.go Moved unit tests back into main directory May 6, 2016
crypto_secretbox.go README: updated (and other minor cleanups) May 3, 2016
crypto_secretbox_test.go Moved unit tests back into main directory May 6, 2016
crypto_sign.go crypto_stream: added argument validation to crypto_sign and crypto_si… Apr 29, 2016
crypto_sign_test.go Moved unit tests back into main directory May 6, 2016
crypto_stream.go crypto_stream: added argument validation to crypto_stream_salsa20_xor Apr 28, 2016
crypto_stream_test.go Moved unit tests back into main directory May 6, 2016
crypto_verify.go crypto_verify: added argument validation to crypto_verify_32 Apr 29, 2016
crypto_verify_test.go Moved unit tests back into main directory May 6, 2016
devurandom.c crypto_box_open: implemented Apr 2, 2016
devurandom.h crypto_box_open: implemented Apr 2, 2016
doc.go Moved unit tests back into main directory May 6, 2016
scalarmult.go scalarmult: added argument validation and corresponding unit tests Apr 26, 2016
scalarmult_test.go Moved unit tests back into main directory May 6, 2016
sign.input Moved unit tests back into main directory May 6, 2016
testutil.go Moved unit tests back into main directory May 6, 2016
tweetnacl.c crypto_box_open: implemented Apr 2, 2016
tweetnacl.h crypto_box_open: implemented Apr 2, 2016
util.go makePtr: added handling for zero-length byte arrays Apr 11, 2016

README.md

tweetnacl-go: version 1.00.0

TweetNaCl - GO port

tweetnacl-go is a port of Dan Bernstein's TweetNaCl "crypto library in a 100 tweets" code to the Go language. It is implemented as a wrapper around the original code to preserve the design and timing characteristics of the original implementation.

Version Info

tweetnacl: 20140427

tweetnacl-go: 1.00.0

Disclaimer

The Go wrapper has been kept as 'thin' as possible to avoid compromising the careful design and coding of the original TweetNaCl implementation. However, cryptography being what it is, the wrapper may have (entirely inadvertently) introduced non-obvious vulnerabilities (for instance How to zero a buffer). So ....

USE ENTIRELY AT YOUR OWN RISK !

Notes

  1. There is an existing port of TweetNaCl to Go (go-tweetnacl) which reimplements the C code in Go.
  2. The cgo FFI doesn't handle zero length byte arrays particularly elegantly (see discussion at Passing zero length Go byte array to a C function). The conversion to a (*C.uchar) pointer has been abstracted into a convenience function makePtr, which includes a commented out version that returns nil for a zero length array if you prefer not to use the esoteric 'unsafe' version.

TODO

  1. Fork go-tweetnacl and merge code

References

  1. TweetNaCl
  2. TweetNaCl: A crypto library in 100 tweets
  3. Cryptography in NaCl
  4. TweetNaCl: How cr.yp.to’s developers got carried away by the carry bit
  5. NaCl: Cryptography for the Internet
  6. On NaCl: Undefined Behaviour
  7. Safe, Efficient, and Portable Rotate in C/C++
  8. How to zero a buffer
  9. Zeroing buffers is insufficient
  10. How to zero a buffer: Erratum
  11. go-tweetnacl
  12. On the Impending Crypto Monoculture
  13. Passing zero length Go byte array to a C function