Skip to content
TweetNaCl crypto library port to the Go language
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
LICENSE
Makefile
README.md
crypto_auth.go
crypto_auth_test.go
crypto_box.go
crypto_box_test.go
crypto_core.go
crypto_core_test.go
crypto_hash.go
crypto_hash_test.go
crypto_secretbox.go
crypto_secretbox_test.go
crypto_sign.go
crypto_sign_test.go
crypto_stream.go
crypto_stream_test.go
crypto_verify.go
crypto_verify_test.go
devurandom.c
devurandom.h
doc.go
scalarmult.go
scalarmult_test.go
sign.input
testutil.go
tweetnacl.c
tweetnacl.h
util.go

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] tweetnacl-pdf
  3. [Cryptography in NaCl] nacl-pdf
  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
You can’t perform that action at this time.