Marten Seemann
f046ec6d71
fix staticcheck
2021-04-23 10:47:47 +07:00
Steven Allen
1ec50360f3
Merge pull request #94 from libp2p/chore/update
...
chore: update deps
2021-03-30 09:50:31 -07:00
Steven Allen
65ff13bd45
chore: update deps
...
And rebuild protobuf definitions.
2021-03-30 07:50:01 -07:00
Steven Allen
5f829bac68
Merge pull request #93 from libp2p/chore/re-license
...
chore: relicense MIT/Apache-2.0
2021-03-30 07:47:34 -07:00
Steven Allen
a27e362d55
chore: relicense MIT/Apache-2.0
2021-03-24 20:52:59 -07:00
Raúl Kripalani
86b4893f9a
optimize: reduce syscalls using a buffered reader.
...
Previously, each noise message read would make two syscalls:
1. one to read the length prefix.
2. one to read the encrypted payload.
This patch adds bufio.Reader mediation to cushion syscalls, and
significantly enhaces throughput in read-dominated connections, such
as file transfers.
2020-10-07 10:23:18 +01:00
Aarsh Shah
b5990bdf57
Merge pull request #81 from libp2p/feat/77
...
Further Optimizations and refactor benchmarking code.
2020-05-07 12:10:22 +05:30
Aarsh Shah
64edfa60be
test read decryption fails
2020-05-07 12:08:12 +05:30
Aarsh Shah
68f0604b8c
changes as per review
2020-05-07 11:20:31 +05:30
Aarsh Shah
47797a5deb
changes as per review
2020-05-04 15:34:12 +05:30
Aarsh Shah
e99d5b623e
pre-calculate handshake message len
2020-04-29 18:39:12 +05:30
Aarsh Shah
d9758632dc
more unit tests
2020-04-29 16:56:15 +05:30
Aarsh Shah
9f9e631635
remove alloc from benchmark
2020-04-29 16:24:42 +05:30
Aarsh Shah
5d22361619
benchmark till 62KB writes
2020-04-29 15:22:00 +05:30
Aarsh Shah
1c8319d290
better benchmark tests
2020-04-29 15:20:21 +05:30
Aarsh Shah
4cca3868d6
improved benchmark naming
2020-04-29 14:31:42 +05:30
Aarsh Shah
e4dcb0d235
improved benchmark tests
2020-04-29 14:05:08 +05:30
Aarsh Shah
dba16dd478
remove extra write but no abstraction
2020-04-28 23:13:50 +05:30
Aarsh Shah
8dc828f549
better benchmarking
2020-04-28 19:38:46 +05:30
Aarsh Shah
9ffff12a5a
better docs
2020-04-28 17:17:05 +05:30
Aarsh Shah
0176819b0c
optimize reads
2020-04-28 17:14:11 +05:30
Aarsh Shah
6278b74377
context cancellation and zero alloc reads
2020-04-28 14:25:21 +05:30
Raúl Kripalani
9b9c06f042
Merge pull request #58 from libp2p/raul-review
2020-04-24 20:54:23 +01:00
Raúl Kripalani
b51467260a
minor nits.
2020-04-24 20:46:55 +01:00
Raúl Kripalani
7b52f52bc2
rename param.
2020-04-24 12:41:58 +01:00
Raúl Kripalani
40f0c0f731
decrypt in place.
2020-04-24 12:38:46 +01:00
Raúl Kripalani
457b94d45f
revert deadline iff it could actually be set.
2020-04-24 11:26:58 +01:00
Raúl Kripalani
0efbf7367b
stop tracking qrem in state; simplify q logic.
2020-04-24 11:17:48 +01:00
Raúl Kripalani
6b2b8725db
stage writes in a buffer; write at once on the transport.
2020-04-24 11:08:25 +01:00
Raúl Kripalani
99a65b744b
improve comments and readability.
2020-04-23 18:11:09 +01:00
Raúl Kripalani
803b648b92
make Read conform to io.Reader behaviour + performance opt.
...
- Read() used to behave like io.ReadFull(); it now behaves like
io.Reader mandates.
- preallocate 2-byte (long) slices for message length calculation.
- on read, copy directly to supplied buffer, if the message is
smaller or equal to len(buffer).
- use buffer pools (via go-buffer-pool) to contain allocs and GC.
2020-04-23 17:54:47 +01:00
Raúl Kripalani
4dad9a3101
bench: reset timer + report allocs.
2020-04-23 13:29:40 +01:00
Raúl Kripalani
ef4c4223d1
propagate context deadlines to handshake.
...
Fixes https://github.com/libp2p/go-libp2p-noise/issues/75 .
2020-04-23 10:47:29 +01:00
Raúl Kripalani
1ecc08a61b
refine comments.
2020-04-23 10:47:29 +01:00
Raúl Kripalani
c242789e58
wrap errors.
2020-04-23 10:47:29 +01:00
Raúl Kripalani
fac8488ec4
remove ETHBerlin pdf.
2020-04-23 10:47:29 +01:00
Yusef Napora
7a756b9abf
Merge pull request #56 from libp2p/refactor/flynn
...
Replace noise explorer code with flynn/noise library
2020-03-03 13:09:16 -05:00
Yusef Napora
370abe0244
rm dead code
2020-03-03 09:45:14 -05:00
Yusef Napora
dd7ccf8247
make handshake state local to runHandshake
2020-03-03 09:34:31 -05:00
Yusef Napora
1edb96a9e1
make crypto methods private
2020-03-03 09:34:03 -05:00
Yusef Napora
db01d6a881
cleanup
2020-03-03 09:34:03 -05:00
Yusef Napora
5974ecc852
factor out processing remote handshake payload
2020-03-02 16:33:58 -05:00
Yusef Napora
70efae2bed
refactor internal session state
2020-03-02 16:20:51 -05:00
Yusef Napora
6e4c6b8ea0
move static keygen to session
2020-03-02 15:21:35 -05:00
Yusef Napora
b152f9d628
replace noise explorer with flynn/noise
2020-03-02 15:21:35 -05:00
Yusef Napora
5d2c4148f6
add benchmark tests
2020-03-02 15:21:35 -05:00
Yusef Napora
4d642f648c
fix EOF handling in Read
2020-03-02 15:21:35 -05:00
Yusef Napora
1bdb5d3916
test crypto error cases
2020-02-28 11:10:59 -05:00
Yusef Napora
9df4fe637c
cleanup
2020-02-28 11:10:59 -05:00
Yusef Napora
2f38053ad5
remove noise pipes & associated code
2020-02-28 11:10:59 -05:00