Files
zwing/errors.go
T
zeekay f21120ce2f zwing v0.1.0: Z-Wing PQ secure channel for Lux
Z-Wing is the canonical Lux post-quantum secure channel. One construction,
one wire format, no negotiation. Layered design exposes a net.Conn so
luxfi/api/zap (and any other stream protocol) runs unchanged on top.

  KEM:       X-Wing  (X25519 + ML-KEM-768, IETF draft-connolly-cfrg-xwing-kem
                     SHA3-256 combiner: "\./" || "X-Wing" || ssM || ssX || ctX || pkX)
  Identity:  Ed25519 + ML-DSA-65 hybrid signatures
  AEAD:      ChaCha20-Poly1305 with sequence-numbered nonces (per direction)
  Transport: TCP (RNS routing is a follow-up package)

Public API: GenerateIdentity / Dial / Listen / Client / Server.

Six tests cover the spec end-to-end: handshake round-trip, TCP dial+listen,
ExpectedRemote pinning, key-zero-after-handshake forward secrecy, sequenced
nonces, and ZAP-over-Z-Wing application round-trip.
2026-05-06 12:18:21 -07:00

20 lines
874 B
Go

// Copyright (C) 2020-2026, Lux Industries Inc. All rights reserved.
// See the file LICENSE for licensing terms.
package zwing
import "errors"
var (
ErrHandshakeFailed = errors.New("zwing: handshake failed")
ErrIdentityMismatch = errors.New("zwing: remote identity does not match expected")
ErrSignatureInvalid = errors.New("zwing: signature verification failed")
ErrMessageTooLarge = errors.New("zwing: message exceeds maximum size")
ErrShortRead = errors.New("zwing: short read")
ErrInvalidWireFormat = errors.New("zwing: invalid wire format")
ErrChannelClosed = errors.New("zwing: channel closed")
ErrSequenceExhausted = errors.New("zwing: AEAD sequence number exhausted")
ErrConfigMissingID = errors.New("zwing: config missing LocalIdentity")
ErrCiphertextCorrupted = errors.New("zwing: AEAD authentication failed")
)