Skip to content

Commit

Permalink
Add compatibity test for chacha20.
Browse files Browse the repository at this point in the history
  • Loading branch information
cyfdecyf committed May 10, 2015
1 parent bd99354 commit 6b502a4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
1 change: 1 addition & 0 deletions script/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ test_server_local_pair() {
test_shadowsocks $url bf-cfb
test_shadowsocks $url des-cfb
test_shadowsocks $url cast5-cfb
test_shadowsocks $url chacha20
test_shadowsocks $url salsa20
}

Expand Down
17 changes: 12 additions & 5 deletions shadowsocks/encrypt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,10 @@ func BenchmarkRC4MD5Init(b *testing.B) {
benchmarkCipherInit(b, "rc4-md5")
}

func BenchmarkChaCha20Init(b *testing.B) {
benchmarkCipherInit(b, "chacha20")
}

func BenchmarkSalsa20Init(b *testing.B) {
benchmarkCipherInit(b, "salsa20")
}
Expand Down Expand Up @@ -253,6 +257,10 @@ func BenchmarkRC4MD5Encrypt(b *testing.B) {
benchmarkCipherEncrypt(b, "rc4-md5")
}

func BenchmarkChacha20Encrypt(b *testing.B) {
benchmarkCipherEncrypt(b, "chacha20")
}

func BenchmarkSalsa20Encrypt(b *testing.B) {
benchmarkCipherEncrypt(b, "salsa20")
}
Expand Down Expand Up @@ -306,11 +314,10 @@ func BenchmarkRC4MD5Decrypt(b *testing.B) {
benchmarkCipherDecrypt(b, "rc4-md5")
}

func BenchmarkSalsa20Decrypt(b *testing.B) {
benchmarkCipherDecrypt(b, "salsa20")
func BenchmarkChaCha20Decrypt(b *testing.B) {
benchmarkCipherDecrypt(b, "chacha20")
}

func BenchmarkChaCha20Init(b *testing.B) {
ci := cipherMethod["chacha20"]
benchmarkCipherInit(b, ci)
func BenchmarkSalsa20Decrypt(b *testing.B) {
benchmarkCipherDecrypt(b, "salsa20")
}

0 comments on commit 6b502a4

Please sign in to comment.