20 func (d Dummy) Write(b []byte) (int, error) {
29 id := new([IDSize]byte)
33 Timeout: time.Second * time.Duration(TimeoutDefault),
37 peer = newPeer(true, "foo", Dummy{&ciphertext}, conf, new([SSize]byte))
38 plaintext = make([]byte, 789)
41 func BenchmarkEnc(b *testing.B) {
43 for i := 0; i < b.N; i++ {
44 peer.EthProcess(plaintext)
48 func BenchmarkDec(b *testing.B) {
49 peer = newPeer(true, "foo", Dummy{&ciphertext}, conf, new([SSize]byte))
50 peer.EthProcess(plaintext)
51 peer = newPeer(true, "foo", Dummy{nil}, conf, new([SSize]byte))
52 orig := make([]byte, len(ciphertext))
53 copy(orig, ciphertext)
55 for i := 0; i < b.N; i++ {
56 peer.nonceBucket0 = make(map[uint64]struct{}, 1)
57 peer.nonceBucket1 = make(map[uint64]struct{}, 1)
58 copy(ciphertext, orig)
59 if !peer.PktProcess(ciphertext, Dummy{nil}, true) {