Repository navigation
Conversation
The signature is the one step of a server handshake measured in milliseconds: 2.6 ms for an RSA-2048 key even through its CRT form. On an event loop that serves many connections per thread, every other connection on that thread waits behind it, so a burst of new connections stalls the requests of the ones already open. `Options.offload` is a function that runs a job and returns once it has finished; the handshake computes the signature through it. Null keeps the signature on the calling thread, as before. The RSA-PSS salt is drawn from `rng` before the hop and the job signs with a CSPRNG seeded from it, since `rng` may be bound to the caller's thread or event loop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The CertificateVerify signature is the one step of a server handshake measured in milliseconds: 2.6 ms for an RSA-2048 key even through its CRT form (#59, and its port to
mainin a sibling PR). On an event loop that serves many connections per thread, every other connection on that thread waits behind it, so a burst of new connections stalls the requests of the ones already open.This adds
Options.offloadon the server:runexecutes the job (on a thread pool, say) and returns once it has finished; the handshake computes the signature through it.null, the default, keeps the signature on the calling thread, so nothing changes for a caller who does not set it.The RSA-PSS salt is drawn from
rngbefore the hop, and the job signs with a CSPRNG seeded from it, sincerngmay be bound to the caller's thread or event loop.It is independent of the CRT change and applies to
mainon its own. nilo (an HTTP server on zio) has pinned it onzig-0.16.xsince it was written, and uses it to sign on its blocking pool.Tests
zig build teston Zig 0.17.0: 89 passed, 1 skipped. Two tests are new:makeCertificateVerifywithoffloadnull, and with anoffloadthat signs RSA on another thread.