Skip to content

Instantly share code, notes, and snippets.

@mimoo
Created June 11, 2017 15:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mimoo/62c400454cee863bfbe41bc34f3b286a to your computer and use it in GitHub Desktop.
Save mimoo/62c400454cee863bfbe41bc34f3b286a to your computer and use it in GitHub Desktop.
package main
import (
"github.com/mimoo/GoKangarooTwelve/K12"
"golang.org/x/crypto/sha3"
"testing"
"bytes"
)
var out [32]byte
var customString = []byte("")
var payload = bytes.Repeat([]byte("a"), 10000)
func BenchmarkK12(b *testing.B) {
for n := 0; n < b.N; n++ {
K12.K12Sum(customString, payload, out[:])
}
}
func BenchmarkSHA3(b *testing.B) {
for n := 0; n < b.N; n++ {
sha3.Sum256(payload)
}
}
func BenchmarkSHAKE128(b *testing.B) {
for n := 0; n < b.N; n++ {
sha3.ShakeSum128(out[:], payload)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment