No description
  • Go 87.6%
  • Assembly 12.1%
  • C 0.3%
Find a file
Henry Bubert 208229450e ssh: make channel window size and max packet size configurable
The initial window (2 MiB) and maximum packet size (32 KiB) that a
channel advertises to its peer have been compile-time constants since
the package was written. Flow control bounds the throughput of a
channel to roughly window / RTT, so a single channel, and with it any
SFTP session built on top of it, cannot exceed about 20 MiB/s over a
100 ms link no matter how much bandwidth is available. OpenSSH uses
the same defaults, but programs built on this package have had no way
to raise them short of patching a vendored copy, which is what rclone
resorted to (https://github.com/pkg/sftp/issues/158).

Add ChannelWindowSize and ChannelMaxPacketSize to Config, so clients
and servers can choose the values advertised on every channel they
open or accept. Zero keeps the current defaults. SetDefaults raises the
window to at least one packet and clamps the packet size to what a
transport packet can carry, so no configuration can stall a channel or
produce packets the transport rejects. The values only affect the
direction in which the configured side receives; the other direction
is governed by whatever the peer advertises.

BenchmarkChannelThroughput, one channel over a pipe with a simulated
20 ms round trip time, on an Apple M4:

    window=2MiB     94.83 MB/s
    window=16MiB   765.79 MB/s

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-11-09 10:04:20 -03:00
acme acme: prefer test log helpers in test contexts 2026-10-05 11:52:13 -07:00
argon2 argon2: add loong64 LSX implementation of blamka 2026-09-19 18:38:21 -07:00
bcrypt bcrypt: update InvalidCostError message to describe cost range inclusive 2025-05-12 11:46:18 -07:00
blake2b blake2b: add loong64 SIMD implementation 2026-09-19 18:40:00 -07:00
blake2s Reland "blake2s: add loong64 SIMD implementation" 2026-10-26 17:53:12 -07:00
blowfish all: bump go.mod version and drop compatibility shims 2024-06-26 15:12:35 +00:00
bn256 bn256: add missing symbols in comment 2024-09-10 20:43:33 +00:00
cast5 all: bump go.mod version and drop compatibility shims 2024-06-26 15:12:35 +00:00
chacha20 chacha20: add loong64 SIMD implementation 2026-09-19 18:39:20 -07:00
chacha20poly1305 chacha20poly1305: remove usages of BYTE instr 2026-05-18 11:44:40 -07:00
cryptobyte cryptobyte: fix typo 'octects' into 'octets' for asn1.go 2025-03-17 08:22:34 -07:00
curve25519 all: freeze and deprecate more packages 2025-09-09 12:19:31 -07:00
ed25519 all: freeze and deprecate more packages 2025-09-09 12:19:31 -07:00
hkdf hkdf: forward Extract to the standard library 2026-04-23 08:20:08 -07:00
internal crypto/internal/poly1305: provide optimised assembly for riscv64 2026-08-03 22:01:12 -07:00
md4 all: bump go.mod version and drop compatibility shims 2024-06-26 15:12:35 +00:00
nacl all: fix some typos in comment 2025-10-08 13:58:26 -07:00
ocsp all: clean up minor issues found by staticcheck 2026-07-21 14:30:59 -07:00
otr all: eliminate vet diagnostics 2025-10-28 06:00:51 -07:00
pbkdf2 pbkdf2: turn into a wrapper for crypto/pbkdf2 2026-04-23 08:20:11 -07:00
pkcs12 pkcs12: limit PBKDF iteration count to prevent CPU exhaustion 2026-06-04 06:58:05 -07:00
poly1305 all: bump go.mod version and drop compatibility shims 2024-06-26 15:12:35 +00:00
ripemd160 all: bump go.mod version and drop compatibility shims 2024-06-26 15:12:35 +00:00
salsa20 salsa20: fix keystream reuse in LoongArch LSX tail 2026-10-08 17:58:02 -07:00
scrypt scrypt: fix panic on parameters <= 0 2026-01-13 07:44:11 -08:00
sha3 sha3: make it mostly a wrapper around crypto/sha3 2025-10-22 18:01:01 -07:00
ssh ssh: make channel window size and max packet size configurable 2026-11-09 10:04:20 -03:00
tea all: deprecate broken and legacy packages 2019-02-22 23:25:34 +00:00
twofish all: bump go.mod version and drop compatibility shims 2024-06-26 15:12:35 +00:00
x509roots x509roots/fallback: update bundle 2026-10-20 08:33:06 -07:00
xtea all: bump go.mod version and drop compatibility shims 2024-06-26 15:12:35 +00:00
xts all: freeze and deprecate more packages 2025-09-09 12:19:31 -07:00
.gitattributes crypto: copying .gitattributes to all subrepositories 2014-12-23 06:54:52 +00:00
.gitignore gitignore: remove obsolete reference to .hgignore in comment 2020-03-20 18:11:02 +00:00
codereview.cfg crypto: add codereview.cfg 2015-03-18 17:04:25 +00:00
CONTRIBUTING.md CONTRIBUTING.md: remove note about not accepting Pull Requests 2018-03-14 18:02:59 +00:00
go.mod go.mod: update golang.org/x dependencies 2026-10-09 09:24:17 -07:00
go.sum go.mod: update golang.org/x dependencies 2026-10-09 09:24:17 -07:00
LICENSE LICENSE: update per Google Legal 2024-07-16 16:09:32 +00:00
PATENTS go.crypto: add PATENTS file to the subrepo. 2012-04-16 11:25:08 +10:00
README.md README: don't recommend go get 2024-11-04 00:10:25 +00:00

Go Cryptography

Go Reference

This repository holds supplementary Go cryptography packages.

Report Issues / Send Patches

This repository uses Gerrit for code changes. To learn how to submit changes to this repository, see https://go.dev/doc/contribute.

The git repository is https://go.googlesource.com/crypto.

The main issue tracker for the crypto repository is located at https://go.dev/issues. Prefix your issue with "x/crypto:" in the subject line, so it is easy to find.

Note that contributions to the cryptography package receive additional scrutiny due to their sensitive nature. Patches may take longer than normal to receive feedback.