Skip to main content

Crate spine_crypto

Crate spine_crypto 

Source
Expand description

§SPINE Crypto

Advanced cryptographic primitives for the SPINE stack including:

  • Titans-based message prediction for speculative decoding with Neural Long-Term Memory
  • MIRAS-adaptive prediction with automatic variant switching
  • Post-quantum key evolution using lattice-based cryptography concepts

§Titans Predictor (Neural Long-Term Memory)

Uses the Titans architecture with test-time training for unbounded context message prediction, enabling speculative decoding where receivers can pre-compute responses. Unlike standard Transformers, Titans maintains persistent memory that survives across sequences through surprise-gated updates.

Key advantages over Transformers:

  • Unbounded context: Memory persists indefinitely via consolidation
  • Test-time training: Adapts to message patterns during inference
  • Surprise detection: Identifies anomalous messages for security
  • Memory efficiency: O(1) memory vs O(n²) for attention

§MIRAS-Adaptive Prediction

Integrates the MIRAS framework for continual learning:

  • YAAD: Yield-Adaptive Anomaly Detection for outlier-robust prediction
  • MONETA: Memory-Optimized Network for stable long-running sessions
  • MEMORA: Balanced updates for mixed traffic patterns

The predictor automatically switches between variants based on surprise levels.

§Quantum-Resistant Key Evolution

Implements NTRU-inspired lattice operations for key evolution that resists quantum computing attacks (Shor’s algorithm).

Structs§

ByteTokenizer
Byte-level tokenizer for message encoding
FeedForward
Feed-forward network in transformer
LatticeParams
Parameters for NTRU-like lattice operations
LayerNorm
Layer normalization
MirasPredictorStats
Statistics for MIRAS predictor
MirasTitansPredictor
MIRAS-adaptive message predictor with automatic variant switching
OutputProjection
Output projection to predict next byte distribution
PositionalEncoding
Positional encoding for transformer sequence modeling
QuantumKeyEvolution
Quantum-resistant key evolution system.
QuantumKeyPair
Quantum-resistant key pair.
QuantumMessage
Wire format for quantum-protected messages
QuantumSpeculativeProtocol
Combined quantum-resistant speculative protocol
RingElement
Polynomial ring element Z_q[X]/(X^n + 1).
TitansBlock
Single Titans decoder block with Neural Long-Term Memory
TitansConfig
Configuration for Titans predictor
TitansPredictor
Titans-based message predictor with Neural Long-Term Memory

Enums§

KemAlgorithm
Key Encapsulation Mechanism algorithm selection
MessagePayload

Type Aliases§

TransformerConfig
TransformerPredictor