Skip to content

Commit

Permalink
remove some useless tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dev committed Jan 24, 2024
1 parent 4e8f293 commit 952b420
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 23 deletions.
12 changes: 6 additions & 6 deletions encryption_aead/encryption_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,16 @@ func BenchmarkEncryptAEAD(b *testing.B) {
aes256GcmKey := utils.RandBytes(b, 32)
aes256GcmNonce := utils.RandBytes(b, 12)

aes128GcmKey := utils.RandBytes(b, 16)
aes128GcmNonce := utils.RandBytes(b, 12)
// aes128GcmKey := utils.RandBytes(b, 16)
// aes128GcmNonce := utils.RandBytes(b, 12)

for _, size := range BENCHMARKS {
benchmarkEncrypt(b, size, "XChaCha20_BLAKE3", newXChaCha20Blake3Cipher(b, xChaCha20Key), xChaCha20Nonce, additionalData)
benchmarkEncrypt(b, size, "XChaCha12_BLAKE3", newXChaCha12Blake3Cipher(b, xChaCha20Key), xChaCha20Nonce, additionalData)
benchmarkEncrypt(b, size, "XChaCha20_Poly1305", newXChaCha20Poly1305Cipher(b, xChaCha20Key), xChaCha20Nonce, additionalData)
benchmarkEncrypt(b, size, "ChaCha20_Poly1305", newChaCha20Poly1305Cipher(b, chaCha20Key), chaCha20Nonce, additionalData)
benchmarkEncrypt(b, size, "AES_256_GCM", newAesGcmCipher(b, aes256GcmKey), aes256GcmNonce, additionalData)
benchmarkEncrypt(b, size, "AES_128_GCM", newAesGcmCipher(b, aes128GcmKey), aes128GcmNonce, additionalData)
// benchmarkEncrypt(b, size, "AES_128_GCM", newAesGcmCipher(b, aes128GcmKey), aes128GcmNonce, additionalData)
benchmarkEncrypt(b, size, "XChaCha20_SHA256", newXChaCha20Sha256Cipher(b, xChaCha20Key), xChaCha20Nonce, additionalData)
}
}
Expand All @@ -70,16 +70,16 @@ func BenchmarkDecryptAEAD(b *testing.B) {
aes256GcmKey := utils.RandBytes(b, 32)
aes256GcmNonce := utils.RandBytes(b, 12)

aes128GcmKey := utils.RandBytes(b, 16)
aes128GcmNonce := utils.RandBytes(b, 12)
// aes128GcmKey := utils.RandBytes(b, 16)
// aes128GcmNonce := utils.RandBytes(b, 12)

for _, size := range BENCHMARKS {
benchmarkDecrypt(b, size, "XChaCha20_BLAKE3", newXChaCha20Blake3Cipher(b, xChaCha20Key), xChaCha20Nonce, additionalData)
benchmarkDecrypt(b, size, "XChaCha12_BLAKE3", newXChaCha12Blake3Cipher(b, xChaCha20Key), xChaCha20Nonce, additionalData)
benchmarkDecrypt(b, size, "XChaCha20_Poly1305", newXChaCha20Poly1305Cipher(b, xChaCha20Key), xChaCha20Nonce, additionalData)
benchmarkDecrypt(b, size, "ChaCha20_Poly1305", newChaCha20Poly1305Cipher(b, chaCha20Key), chaCha20Nonce, additionalData)
benchmarkDecrypt(b, size, "AES_256_GCM", newAesGcmCipher(b, aes256GcmKey), aes256GcmNonce, additionalData)
benchmarkDecrypt(b, size, "AES_128_GCM", newAesGcmCipher(b, aes128GcmKey), aes128GcmNonce, additionalData)
// benchmarkDecrypt(b, size, "AES_128_GCM", newAesGcmCipher(b, aes128GcmKey), aes128GcmNonce, additionalData)
benchmarkDecrypt(b, size, "XChaCha20_SHA256", newXChaCha20Sha256Cipher(b, xChaCha20Key), xChaCha20Nonce, additionalData)
}
}
Expand Down
2 changes: 1 addition & 1 deletion encryption_unauthenticated/encryption_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ type xChaCha12Cipher struct {
}

func newXChaCha12Cipher(b *testing.B, key, nonce []byte) xChaCha12Cipher {
cipher, err := xchacha12.NewCipher(key, nonce)
cipher, err := xchacha12.New(key, nonce)
if err != nil {
b.Error(err)
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.21
require (
github.com/DataDog/zstd v1.5.5
github.com/akamensky/base58 v0.0.0-20210829145138-ce8bf8802e8f
github.com/bloom42/stdx v0.0.0-20240120085940-f464ec6e679c
github.com/bloom42/stdx v0.0.0-20240121092629-09ed451d9a75
github.com/cespare/xxhash/v2 v2.2.0
github.com/golang/snappy v0.0.4
github.com/jotfs/fastcdc-go v0.2.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ=
github.com/DataDog/zstd v1.5.5/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw=
github.com/akamensky/base58 v0.0.0-20210829145138-ce8bf8802e8f h1:z8MkSJCUyTmW5YQlxsMLBlwA7GmjxC7L4ooicxqnhz8=
github.com/akamensky/base58 v0.0.0-20210829145138-ce8bf8802e8f/go.mod h1:UdUwYgAXBiL+kLfcqxoQJYkHA/vl937/PbFhZM34aZs=
github.com/bloom42/stdx v0.0.0-20240120085940-f464ec6e679c h1:mpkg67NdWIwxLhMx7TNteYZy/wcg0frvZse1wuVap8w=
github.com/bloom42/stdx v0.0.0-20240120085940-f464ec6e679c/go.mod h1:zZWdLGQq1BX7GoDuZZPyyE0WUTy5MmNtPB6+8TB6Mf0=
github.com/bloom42/stdx v0.0.0-20240121092629-09ed451d9a75 h1:06wdAsXTKv/vD2RiTsylrnmZnYNv0bTW49PLEN/Ywtw=
github.com/bloom42/stdx v0.0.0-20240121092629-09ed451d9a75/go.mod h1:zZWdLGQq1BX7GoDuZZPyyE0WUTy5MmNtPB6+8TB6Mf0=
github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM=
Expand Down
24 changes: 12 additions & 12 deletions hashing/hashing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,17 @@ func BenchmarkHashing(b *testing.B) {

for _, size := range benchmarks {
benchmarkHasher(size, "sha256", sha256Hasher{}, b)
benchmarkHasher(size, "zeebo_blake3_256", zeeboBlake3Hasher{}, b)
benchmarkHasher(size, "lukechampine_blake3_256", lukechampineBlake3Hasher{}, b)
benchmarkHasher(size, "zeebo_blake3", zeeboBlake3Hasher{}, b)
benchmarkHasher(size, "lukechampine_blake3", lukechampineBlake3Hasher{}, b)
benchmarkHasher(size, "blake2b_256", blake2bHasher{}, b)
benchmarkHasher(size, "blake2s_256", blake2sHasher{}, b)
// benchmarkHasher("sha512/256", sha512_256Hasher{}, b)
benchmarkHasher(size, "sha3", sha3Hasher{}, b)
benchmarkHasher(size, "sha1", sha1Hasher{}, b)

benchmarkHasher(size, "sha2_512", sha512Hasher{}, b)
benchmarkHasher(size, "zeebo_blake3_512", zeeboBlake3_512Hasher{}, b)
benchmarkHasher(size, "lukechampine_blake3_512", lukechampineBlake3_512Hasher{}, b)
// benchmarkHasher(size, "zeebo_blake3_512", zeeboBlake3_512Hasher{}, b)
// benchmarkHasher(size, "lukechampine_blake3_512", lukechampineBlake3_512Hasher{}, b)
benchmarkHasher(size, "blake2b_512", blake2b512Hasher{}, b)
benchmarkHasher(size, "sha3_512", sha3_512Hasher{}, b)
}
Expand All @@ -67,23 +67,23 @@ func (lukechampineBlake3Hasher) Hash(input []byte) {
lukechampineblake3.Sum256(input)
}

type lukechampineBlake3_512Hasher struct{}
// type lukechampineBlake3_512Hasher struct{}

func (lukechampineBlake3_512Hasher) Hash(input []byte) {
lukechampineblake3.Sum512(input)
}
// func (lukechampineBlake3_512Hasher) Hash(input []byte) {
// lukechampineblake3.Sum512(input)
// }

type zeeboBlake3Hasher struct{}

func (zeeboBlake3Hasher) Hash(input []byte) {
zeeboblake3.Sum256(input)
}

type zeeboBlake3_512Hasher struct{}
// type zeeboBlake3_512Hasher struct{}

func (zeeboBlake3_512Hasher) Hash(input []byte) {
zeeboblake3.Sum512(input)
}
// func (zeeboBlake3_512Hasher) Hash(input []byte) {
// zeeboblake3.Sum512(input)
// }

type blake2sHasher struct{}

Expand Down
2 changes: 1 addition & 1 deletion kdf/kdf_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func (lukechampineBlake3_512KDF) DeriveKey(secret, info, out []byte) {
type zeeboBlake3KDF struct{}

func (zeeboBlake3KDF) DeriveKey(secret, info, out []byte) {
zeeboblake3.DeriveKey(string(info), secret, out)
zeeboblake3.DeriveKey(string(info), secret, out[:0])
}

type zeeboBlake3_512KDF struct{}
Expand Down

0 comments on commit 952b420

Please sign in to comment.