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