Repository navigation
Crate vyrn crypto
Path: crates/engine/vyrn-crypto · Layer 1 (11 §1.4) · Pinned: yes (11 §1.3)
vyrn-crypto is VYRN's one crypto stack: SipHash-2-4 (written in-house), BLAKE3, Ed25519 under ZIP-215 rules, X25519, and the derive_key contexts of 01 §4. The lane inlines the one-shot SipHash MAC check into its packet loop. Its Ed25519 verify is the only verify function in VYRN, and both the Rust and the Vx clients call it. The crate is #![forbid(unsafe_code)].
- 01 §4: BLAKE3-256 for content hashes,
PktHashand the KDF; thederive_keycontexts; X25519 - 11 §2.4: SipHash-2-4, in-house
- 11 §2.5: Ed25519 verification under ZIP-215 (canonical
S, non-canonicalAandRallowed, cofactored equation) - 09 §6 owns the exact session-key material that
derive_key(SESSION_CONTEXT, …)takes
| Type | Role |
|---|---|
siphash24 |
One-shot SipHash-2-4 with a 128-bit key and a 64-bit Tag; the form the lane inlines |
siphash::verify, tag_eq
|
MAC check against a tag |
SipHasher24, FixedState
|
Streaming SipHash behind FixedState, for non-engine hash maps |
hash::hash, hash::keyed_hash
|
BLAKE3-256 |
pkt_hash |
PktHash: the first 8 bytes of BLAKE3-256 over a packet's header and messages |
derive_key, SESSION_CONTEXT
|
BLAKE3 KDF; the session context string is "vyrn v1 session"
|
ed25519::verify, sign, public_key
|
Ed25519 under ZIP-215 |
x25519::public_key, shared_secret
|
X25519 key agreement |
Implemented. Own version 0.1.0, released as vyrn-crypto-v0.1.0; publish = false. The crate docs name no missing piece or follow-up. ed25519.rs explains why it does not use ed25519-dalek's own verify: that function is cofactorless and compares encodings of R, so it rejects signatures that ZIP-215 accepts.
Tests: tests/golden.rs (5 #[test]), plus unit tests in src/hash.rs and src/siphash.rs (3). Total: 8 #[test] functions. Golden inputs such as siphash.txt, ed25519-edge.txt and blake3_test_vectors.json are in tests/golden at the repository root.
Workspace: vyrn-types. External: blake3, curve25519-dalek, ed25519-dalek, x25519-dalek. This matches 11 §1.4 (layer 1 → vyrn-types).
- Source: crates/engine/vyrn-crypto
- Changelog: CHANGELOG.md
- Spec: Spec-01-Conventions, Spec-11-Build, Spec-09-Chain
- Related: Crate-vyrn-types, Crate-vyrn-wire, Crate-vyrn-log
Overview
Working on VYRN
Spec
- 00 Index
- 01 Conventions
- 02 Requirements
- 03 Architecture
- 04 Protocol
- 05 Engine
- 06 Platform
- 07 Replication
- 08 Epochs
- 09 Chain
- 10 Accounts, Risk, MD
- 11 Build
- 12 Commitment
- 13 Availability
- 14 Envelope
Engine crates
Other crates
- vyrn-nic
- vyrn-log
- vyrn-data
- vyrn-consensus
- vyrn-replica
- vyrn-epoch
- vyrn-chain
- vyrn-md
- vyrn-sim
- vyrn-bench
Binaries
- vyrn-seq (stub)
- vyrn-validator (stub)
- vyrn-admin
Outside Rust
Reflects main at a9f0d61.