# Third-Party Notices & Standards Attribution

`MoonWire` is an original clean-room MoonBit implementation licensed under the Apache License, Version 2.0 (see [LICENSE](./LICENSE)).

No third-party C/Rust/Go source files or GPL-licensed capture binaries are redistributed in this repository or its Mooncakes package archive.

## Protocol Specifications & Standards Implemented

1. **WireGuard Protocol Specification**
   - Author: Jason A. Donenfeld ("WireGuard: Next Generation Kernel Network Tunnel", NDSS 2017)
   - Reference URL: https://www.wireguard.com/papers/wireguard.pdf
   - Usage: Wire packet layouts (§5.4), `Noise_IKpsk2_25519_ChaChaPoly_BLAKE2s` handshake construction, `TAI64N` anti-replay timestamping, `mac1`/`mac2` and `Cookie Reply` DoS mitigation (§5.4.7), session timer constants (§6), and Cryptokey Routing (§4).
   - Trademark Notice: "WireGuard" is a registered trademark of Jason A. Donenfeld. `MoonWire` is an independent implementation and is not affiliated with or endorsed by the WireGuard project.

2. **Noise Protocol Framework (Revision 34)**
   - Author: Trevor Perrin
   - Reference URL: https://noiseprotocol.org/noise.html
   - Usage: SymmetricState and HandshakeState semantics for the `IKpsk2` handshake pattern (Public Domain specification).

3. **IETF RFC Cryptographic & Network Standards**
   - **RFC 7693**: The BLAKE2 Cryptographic Hash and Message Authentication Code (MAC) — `BLAKE2s` compression function, keyed MAC, and official test vectors.
   - **RFC 7748**: Elliptic Curves for Security — `X25519` Montgomery ladder over $\text{GF}(2^{255}-19)$, scalar clamping, low-order point checks, and official test vectors.
   - **RFC 8439**: ChaCha20 and Poly1305 for IETF Protocols — `ChaCha20` stream cipher, `Poly1305` authenticator, AEAD construction, and official test vectors.
   - **draft-irtf-cfrg-xchacha**: `XChaCha20-Poly1305` (`HChaCha20` subkey derivation + 24-byte nonce AEAD used by WireGuard Cookie Reply) and test vectors.
   - **SipHash-2-4**: Jean-Philippe Aumasson & Daniel J. Bernstein ("SipHash: a fast short-input PRF", 2012) and reference test vectors.
   - **RFC 6479**: IPsec Anti-Replay Algorithm without Bit Shifting — sliding bitmap window design reference.

## Architectural & Cross-Verification References

- **Cloudflare `boringtun`** (https://github.com/cloudflare/boringtun, BSD-3-Clause): Architectural inspiration for separating the Sans-IO `Tunn` packet-transformation state machine from host socket/TUN I/O. No code was copied.
- **`WireGuard/wireguard-go`** (https://github.com/WireGuard/wireguard-go, MIT License, Copyright (C) 2017-2023 WireGuard LLC): Reference behavior for handshake state transitions, `AllowedIPs` prefix routing semantics, and protocol edge cases.
- **Independent External Oracles (Not Redistributed)**
  - Node.js `node:crypto` (OpenSSL `3.0.16`, Node.js MIT / OpenSSL Apache-2.0) is used via `scripts/verify_with_openssl.mjs` to independently cross-verify `X25519`, `ChaCha20-Poly1305`, `BLAKE2s`, and full `Noise_IKpsk2` wire frames over live UDP sockets.
  - Real-world Linux kernel WireGuard packet captures from the Wireshark test suite (`wireguard-ping-tcp.pcap`, `wireguard-psk.pcap`, GPL-2.0-or-later) are fetched only into the git-ignored `release-local/` directory during local verification and are **never** committed or packaged into `MoonWire`.
