Skip to main content

Security

Voltaire handles cryptographic operations and sensitive data. This guide covers security requirements.

Threat Model

What We Protect Against

  • Timing attacks: Side-channel leaks via execution time
  • Memory disclosure: Sensitive data remaining in memory
  • Input validation failures: Malformed data causing crashes or miscomputation
  • Type confusion: Wrong types passed to crypto functions

What We Don’t Protect Against

  • Compromised runtime (Zig, Node, browser)
  • Hardware attacks (Spectre, Rowhammer)
  • Malicious dependencies (supply chain)

Constant-Time Operations

All cryptographic comparisons and key operations must be constant-time.

Comparison

Selection

TypeScript

Memory Handling

Clearing Sensitive Data

Avoid Copying Secrets

TypeScript Memory Limits

JavaScript doesn’t guarantee memory clearing:

Input Validation

Validate Before Processing

Reject Invalid Early

Error Handling

Don’t Leak Information in Errors

Avoid Panics in Crypto Code

Test Vectors

Use Official Vectors

Edge Cases

Malformed Inputs

Cross-Validation

Against Reference Implementations

Fuzz Testing

Security Checklist

Before merging crypto code:

Implementation

  • All comparisons constant-time
  • All secret operations constant-time
  • No early returns in secret-dependent code
  • Secrets cleared after use

Validation

  • All inputs validated before use
  • Length checks before access
  • Range checks for scalars/points
  • Point-on-curve validation

Testing

  • Official test vectors
  • Edge case tests (zero, max, invalid)
  • Malformed input tests
  • Cross-validation against reference
  • Fuzz testing

Error Handling

  • No secret info in error messages
  • No panics, only error returns
  • Consistent error types

Reporting Vulnerabilities

Found a security issue? Contact security@tevm.sh with:
  1. Description of vulnerability
  2. Steps to reproduce
  3. Potential impact
  4. Suggested fix (if any)
We aim to respond within 48 hours.