AtlatestRepositorysigil-quic
1# sigil-quic
2
3Experimental QUIC v1 for [Sigil](https://codeberg.org/sigil/sigil), including
4packet protection, a TLS 1.3 handshake engine, bounded connection and stream
5state, and a UDP endpoint adapter.
6
7## Status
8
9Early development. Client/server handshakes, authenticated Retry, sequential
10bidirectional streams, RFC 9221 DATAGRAM, authenticated path migration, and
11numeric IPv4/IPv6 endpoints are implemented and covered by tests. TLS uses
12AES-128-GCM/SHA-256, X25519, and P-256 signatures. HQ interoperability tools
13are included. Full QUIC key update, 0-RTT, PSK authentication, and a built-in
14X.509 trust store are not implemented. Applications must provide a certificate
15verifier or an independently trusted public-key pin. The library needs
16independent security review before production use.
18## Dependency
20Add this entry to your `package.sgl` dependencies, then run `sigil deps install`:
22```scheme
23(from-git url: "codeberg:sigil/sigil-quic" branch: "master")
24```
26Requires sigil-crypto ^0.18.1. The package declares Sigil 0.22 dependencies.
27The endpoint adapter needs IPv4/IPv6-aware UDP support: `udp-socket` families
28and `socket-normalize-address`. This support is not in a released Sigil yet
29and is planned for an upcoming release.
31## Usage
33Derive client Initial packet keys for the example destination connection ID
34from RFC 9001, then release the owned key material:
36```scheme
37(import (sigil quic packet))
39(let ((keys (initial-keys #u8(131 148 200 240 62 81 87 8) 'client)))
40 ; Vector entries: traffic secret, AES key, IV, header-protection key.
41 (display (bytevector-length (vector-ref keys 1))) ; => 16
42 (discard-packet-keys! keys))
43```
45For connections, use `(sigil quic connection)` and drive its receive, output,
46and timer calls, or use `(sigil quic endpoint)` for the UDP adapter. See the
47[API and implementation notes](docs/implementation.md) for identity verification,
48stream handling, DATAGRAM limits, migration, cleanup, and endpoint options.
49The [HQ adapter](tools/hq/README.md) is a complete transfer example.
51## Tests
53On a Linux host with a C toolchain and the required socket APIs:
55```sh
56sigil deps install
57sigil test --report
58```
60Tests cover RFC vectors, malformed input, bounded state, failure cleanup, and
61loopback UDP. For a single native executable using the same test bodies:
63```sh
64node scripts/native-tls-tests.mjs
65cd build/native-tests
66sigil deps install
67sigil build --config native
68build/native/bin/quic-native-tests
69```
71The packet probe also provides byte-corruption controls:
73```sh
74sigil build --config native
75QUIC_PROBE_SKIP_BENCH=1 scripts/run-gates.sh build/native/bin/quic-probe
76```
78## License
80BSD-3-Clause. See [LICENSE](LICENSE).