Skip to main content

Crate stateset_crypto

Crate stateset_crypto 

Source
Expand description

VES v1.0 Cryptographic Operations

Implements:

  • RFC 8785 JSON Canonicalization Scheme (JCS) via serde_jcs
  • Domain-separated hashing per VES spec
  • Ed25519 signing for agent signatures
  • AES-256-GCM payload encryption (VES-ENC-1)
  • X25519 ECDH key wrapping
  • Merkle tree hashing

Modules§

canonicalize
RFC 8785 JSON Canonicalization Scheme (JCS)
domain
Domain separation prefixes (must match sequencer)
encrypt
Payload encryption per VES-ENC-1
hash
Domain-separated SHA-256 hashing per VES v1.0
merkle
Merkle tree hashing per VES v1.0 Section 10
sign
Ed25519 signing and verification per VES v1.0

Enums§

CryptoError
Errors that can occur during VES cryptographic operations

Constants§

ZERO_HASH
32 bytes of zeros – used for plaintext payloads in cipher hash field

Functions§

bytes_to_hex
Convert bytes to hex string with 0x prefix
encode_string
Encode string with length prefix (VES ENC_STR)
hex_to_bytes
Convert hex string (with or without 0x prefix) to bytes
u32_be
Encode u32 as big-endian bytes
u64_be
Encode u64 as big-endian bytes
uuid_to_bytes
Convert UUID string to 16-byte array