Expand description
Cryptographic operations for Seq
These functions are exported with C ABI for LLVM codegen to call.
§API
# SHA-256 hashing
"hello" crypto.sha256 # ( String -- String ) hex digest
# HMAC-SHA256 for webhook verification
"message" "secret" crypto.hmac-sha256 # ( String String -- String ) hex signature
# Timing-safe comparison
sig1 sig2 crypto.constant-time-eq # ( String String -- Bool )
# Secure random bytes
32 crypto.random-bytes # ( Int -- String ) hex-encoded random bytes
# UUID v4
crypto.uuid4 # ( -- String ) "550e8400-e29b-41d4-a716-446655440000"
# AES-256-GCM authenticated encryption
plaintext hex-key crypto.aes-gcm-encrypt # ( String String -- String Bool )
ciphertext hex-key crypto.aes-gcm-decrypt # ( String String -- String Bool )
# Key derivation from password
password salt iterations crypto.pbkdf2-sha256 # ( String String Int -- String Bool )Functions§
- patch_
seq_ ⚠constant_ time_ eq - Timing-safe string comparison
- patch_
seq_ ⚠crypto_ aes_ gcm_ decrypt - Decrypt ciphertext using AES-256-GCM
- patch_
seq_ ⚠crypto_ aes_ gcm_ encrypt - Encrypt plaintext using AES-256-GCM
- patch_
seq_ ⚠crypto_ ed25519_ keypair - Generate an Ed25519 keypair
- patch_
seq_ ⚠crypto_ ed25519_ sign - Sign a message with an Ed25519 private key
- patch_
seq_ ⚠crypto_ ed25519_ verify - Verify an Ed25519 signature
- patch_
seq_ ⚠crypto_ pbkdf2_ sha256 - Derive a key from a password using PBKDF2-SHA256
- patch_
seq_ ⚠hmac_ sha256 - Compute HMAC-SHA256 of a message with a key
- patch_
seq_ ⚠random_ bytes - Generate cryptographically secure random bytes
- patch_
seq_ ⚠sha256 - Compute SHA-256 hash of a string
- patch_
seq_ ⚠uuid4 - Generate a UUID v4 (random)