Go Assembly
Switch branches/tags
Nothing to show
Clone or download
mimoo Merge pull request #2 from Scratch-net/read_write_fix
Fix for multiple reads and writes
Latest commit f494cd8 Feb 11, 2018
Failed to load latest commit information.
README.md fix Jun 16, 2017


Kangaroo Twelve Implementation in Go

This is an implementation of KangarooTwelve in Go.

It is heavily based on the official Go's x/crypto/sha3 library. But because of minor implementation details the relevant files have been copied and modified here so you do not need Go's SHA-3 implementation to run this package. Hopefully one day Go's SHA-3 library will be more flexible to allow other keccak construction to rely on it.

I have tested this implementation with different test vectors and it works fine. Note that it has not received proper peer review. If you look at the code and find issues (or not) please let me know!

See here why you should use KangarooTwelve instead of SHA-3. But see here first why you should still not skip SHA-3.


go get github.com/mimoo/GoKangarooTwelve/K12


package main


func main(){
    // custom string allows you to customize your hash function 🙃
    customString = []byte("davidwong.fr")
    hash := K12.NewK12(customString)

	// we absorb the payload
    payload := []byte("salut!")

	// we squeeze a 32 output
    out := make([]byte, 32)


    // or simpler with K12Sum()
    K12Sum(customString, payload, out)


Other Keccak-based things

I've implemented a few other constructions that might be helpful: