Skip to content

Commit

Permalink
Better ECDH-ES benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
csstaub committed Dec 25, 2014
1 parent 9e44da6 commit 78a6411
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion cipher/ecdh_es_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func TestVectorECDHES(t *testing.T) {
}
}

func BenchmarkECDHES_16b(b *testing.B) {
func BenchmarkECDHES_128(b *testing.B) {
apuData := []byte("APU")
apvData := []byte("APV")

Expand All @@ -76,3 +76,23 @@ func BenchmarkECDHES_16b(b *testing.B) {
DeriveECDHES("ID", apuData, apvData, bobKey, &aliceKey.PublicKey, 16)
}
}

func BenchmarkECDHES_192(b *testing.B) {
apuData := []byte("APU")
apvData := []byte("APV")

b.ResetTimer()
for i := 0; i < b.N; i++ {
DeriveECDHES("ID", apuData, apvData, bobKey, &aliceKey.PublicKey, 24)
}
}

func BenchmarkECDHES_256(b *testing.B) {
apuData := []byte("APU")
apvData := []byte("APV")

b.ResetTimer()
for i := 0; i < b.N; i++ {
DeriveECDHES("ID", apuData, apvData, bobKey, &aliceKey.PublicKey, 32)
}
}

0 comments on commit 78a6411

Please sign in to comment.