Created
June 11, 2017 15:41
-
-
Save mimoo/62c400454cee863bfbe41bc34f3b286a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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