sigil-quic / treeREADME.md
sigil-quic
Experimental QUIC v1 for Sigil, including packet protection, a TLS 1.3 handshake engine, bounded connection and stream state, and a UDP endpoint adapter.
Status
Early development. Client/server handshakes, authenticated Retry, sequential bidirectional streams, RFC 9221 DATAGRAM, authenticated path migration, and numeric IPv4/IPv6 endpoints are implemented and covered by tests. TLS uses AES-128-GCM/SHA-256, X25519, and P-256 signatures. HQ interoperability tools are included. Full QUIC key update, 0-RTT, PSK authentication, and a built-in X.509 trust store are not implemented. Applications must provide a certificate verifier or an independently trusted public-key pin. The library needs independent security review before production use.
Dependency
Add this entry to your package.sgl dependencies, then run sigil deps install:
(from-git url: "codeberg:sigil/sigil-quic" branch: "master")Requires sigil-crypto ^0.18.1. The package declares Sigil 0.22 dependencies. The endpoint adapter needs IPv4/IPv6-aware UDP support: udp-socket families and socket-normalize-address. This support is not in a released Sigil yet and is planned for an upcoming release.
Usage
Derive client Initial packet keys for the example destination connection ID from RFC 9001, then release the owned key material:
(import (sigil quic packet))
(let ((keys (initial-keys #u8(131 148 200 240 62 81 87 8) 'client)))
; Vector entries: traffic secret, AES key, IV, header-protection key.
(display (bytevector-length (vector-ref keys 1))) ; => 16
(discard-packet-keys! keys))For connections, use (sigil quic connection) and drive its receive, output, and timer calls, or use (sigil quic endpoint) for the UDP adapter. See the API and implementation notes for identity verification, stream handling, DATAGRAM limits, migration, cleanup, and endpoint options. The HQ adapter is a complete transfer example.
Tests
On a Linux host with a C toolchain and the required socket APIs:
sigil deps install
sigil test --reportTests cover RFC vectors, malformed input, bounded state, failure cleanup, and loopback UDP. For a single native executable using the same test bodies:
node scripts/native-tls-tests.mjs
cd build/native-tests
sigil deps install
sigil build --config native
build/native/bin/quic-native-testsThe packet probe also provides byte-corruption controls:
sigil build --config native
QUIC_PROBE_SKIP_BENCH=1 scripts/run-gates.sh build/native/bin/quic-probeLicense
BSD-3-Clause. See LICENSE.