Cryptographic algorithms
Browse the crypto library by job. Open a card to see the available APIs, their constraints, and what the measured operation cost.
How the USD estimates work
Counts come from counters measured around the operation in PocketIC. They exclude SDK entry and reply work and include page charges incurred inside the measured interval. Measurement guide · Collection counters · Crypto measurement notes
Prices cover the measured instructions on a standard 13-node ICP application subnet. One Wasm32 instruction costs one cycle and one Wasm64 instruction costs two. One trillion cycles equals one XDR. A replicated update adds a base charge of about $0.00000671. Ingress, storage, and IC services such as threshold signing have their own charges. ICP cycle prices
The USD estimate uses the December 1, 2026 IMF rate of 1.34112 dollars per XDR. Batch averages share the work of one update across its measured operations. The linked benchmarks identify the inputs, the build and what was timed. IMF exchange rates
34 entries
Ascon hashes & XOFsStandard Ascon digest and variable-length output.
When to use Ascon hashes & XOFs
Hash with Ascon-Hash256, fill a chosen output length with Ascon-XOF128, or distinguish application domains with Ascon-CXOF128 customization.
Tradeoff. These APIs match final NIST SP 800-232. Existing systems that use pre-standard Ascon use different inputs and outputs.
Rust API
cdk_rsx_crypto_symmetric::ascon::hash256cdk_rsx_crypto_symmetric::ascon::xof128cdk_rsx_crypto_symmetric::ascon::cxof128
Cost per operation
- Hash256
- 58,295 instructions≈ $0.000000156
- Average over 100 operations in one call. Staged 256-byte messages and 32-byte digests. Benchmark
- XOF128
- 64,709 instructions≈ $0.000000174
- Average over 100 operations in one call. Staged 256-byte messages and 64-byte outputs. Benchmark
- CXOF128
- 73,604 instructions≈ $0.000000197
- Average over 100 operations in one call. Staged 256-byte messages, 32-byte customization, and 64-byte outputs. Benchmark
Benchmark measurements
- Hash256, 100 messages
- 6,335,467 instructions
- Staged Wasm64 IC update for 100 independent 256-byte messages. Input setup happened in an earlier call. Benchmark report
- XOF128, 100 messages
- 6,976,973 instructions
- Staged Wasm64 IC update for 100 independent 256-byte messages with 64 bytes of output each. Benchmark report
- CXOF128, 100 messages
- 7,866,473 instructions
- Staged Wasm64 IC update for 100 independent 256-byte messages with 32 bytes of customization and 64 bytes of output each. Benchmark report
BLAKE2sCompact digests and tags for BLAKE2s protocols.
When to use BLAKE2s
Match systems that already use BLAKE2s. The keyed and unkeyed functions yield 32 bytes and can run four independent messages at a time.
Tradeoff. Digest and keyed-tag callers follow different trust rules. Use the keyed mode when the receiver needs shared-key authenticity.
Rust API
cdk_rsx_crypto_hash::Blake2scdk_rsx_crypto_hash::Blake2sKeycdk_rsx_crypto_hash::blake2scdk_rsx_crypto_hash::blake2s_keyed
Cost per operation
- Hash
- 4,845 instructions≈ $0.000000013
- Average over 100 operations in one call. Staged 256-byte messages, four independent messages per SIMD group. Benchmark
- Keyed hash
- 6,519 instructions≈ $0.0000000175
- Average over 100 operations in one call. Staged 256-byte messages with independent fresh 32-byte keys. Benchmark
Benchmark measurements
- Hash 100 messages, four-wide SIMD
- 905,364 instructions
- Staged Wasm64 IC update for 100 independent 256-byte messages. Input setup happened in an earlier call. Benchmark report
- Tag 100 messages, four-wide SIMD
- 1,072,845 instructions
- Staged Wasm64 IC update for 100 independent 256-byte messages with distinct fresh 32-byte keys. Benchmark report
BLAKE3Hash or authenticate data with a 32-byte result.
When to use BLAKE3
Use the tree hash for content fingerprints or the keyed variant for a shared-key tag. Independent-message SIMD handles both forms and accepts different keys in each lane.
Tradeoff. A public digest verifies equality. Authenticating the author requires a shared-key tag or signature. The four-message measurements depend on batching.
Rust API
cdk_rsx_crypto_hash::blake3::hashcdk_rsx_crypto_hash::blake3::keyed_hashcdk_rsx_crypto_hash::blake_candidates::blake3_hash4cdk_rsx_crypto_hash::blake_candidates::blake3_keyed_hash4
Cost per operation
- Hash
- 3,575 instructions≈ $0.00000000959
- Average over 100 operations in one call. Staged 256-byte messages, four independent messages per SIMD group. Benchmark
- Keyed hash
- 3,604 instructions≈ $0.00000000967
- Average over 100 operations in one call. Staged 256-byte messages with independent fresh 32-byte keys. Benchmark
Benchmark measurements
- Hash 100 messages, four-wide SIMD
- 778,314 instructions
- Staged Wasm64 IC update for 100 independent 256-byte messages. Input setup happened in an earlier call. Benchmark report
- Tag 100 messages, four-wide SIMD
- 781,189 instructions
- Staged Wasm64 IC update for 100 independent 256-byte messages, each with its own 32-byte key. Fresh keyed work runs inside the measured update. Benchmark report
BLAKE3 key derivationDerive separate keys from secret material and a purpose.
When to use BLAKE3 key derivation
The SDK's fixed-context helper takes a 32-byte secret and a 32-byte user identifier. Four-wide derivation accepts independent pairs. Use the general API when a protocol calls for a different context.
Tradeoff. Keep derivation contexts distinct by protocol and purpose. This API expects cryptographically strong secret material.
Rust API
cdk_rsx_crypto_hash::blake3::derive_keycdk_rsx_crypto_hash::user_kdf::blake3_user_key_freshcdk_rsx_crypto_hash::user_kdf::derive4
Cost per operation
- Derive one user key
- 2,335 instructions≈ $0.00000000626
- One staged 32-byte secret and 32-byte identifier in a fixed public context. Benchmark
- Derive per user
- 1,010 instructions≈ $0.00000000271
- Average over 100 operations in one call. Staged distinct 32-byte secrets and identifiers in a fixed public context. Benchmark
- Derive from shared master
- 1,022 instructions≈ $0.00000000274
- Average over 100 operations in one call. One staged master secret and distinct 32-byte identifiers. Benchmark
- Derive with caller context
- 7,975 instructions≈ $0.0000000214
- Average over 100 operations in one call. Staged 256-byte material. The call hashes the supplied context for each item. Benchmark
Benchmark measurements
- Derive 100 fixed-context user keys
- 521,792 instructions
- Staged Wasm64 IC update for 100 distinct 32-byte secrets and 32-byte identifiers. The measured call derives all 100 outputs. Benchmark report
HKDF-SHA256Extract and derive purpose-specific keys.
When to use HKDF-SHA256
Turn shared high-entropy material into keys for separate protocol purposes. The prepared state supports expansions with different context values.
Tradeoff. Supply distinct context labels where keys serve different roles. A public salt contributes domain separation without replacing secret input entropy.
Rust API
cdk_rsx_crypto_hash::HkdfSha256cdk_rsx_crypto_hash::HkdfSha256::extractcdk_rsx_crypto_hash::HkdfSha256::expand
Cost per operation
- Extract
- 41,618 instructions≈ $0.000000112
- Average over 100 operations in one call. Staged 256-byte input keying material and 32-byte salt. Produces a 32-byte key. Benchmark
- Expand
- 72,914 instructions≈ $0.000000196
- Average over 100 operations in one call. Staged 32-byte keys and 256-byte context. Produces 64 output bytes per key. Benchmark
- Extract and expand
- 83,801 instructions≈ $0.000000225
- Average over 100 operations in one call. Staged 32-byte input keys, a common 32-byte public salt, and 256-byte context. Produces 64 output bytes per key. Benchmark
Benchmark measurements
- 100 extract-and-expand operations
- 8,806,877 instructions
- Staged Wasm64 IC update. Each input key is 32 bytes, with a shared 32-byte public salt, 256 bytes of context and 64 bytes of output. Extraction happens in the measured call. Benchmark report
HMAC-SHA256 & HMAC-SHA512Verify integrity and authenticity with a shared key.
When to use HMAC-SHA256 & HMAC-SHA512
Authenticate a message with a standard SHA-2 MAC. Prepare the key once if the application verifies many messages with that same key.
Tradeoff. Every verifier shares the secret and can generate tags. Use a public-key signature when independent verifiers must be able to check the sender.
Rust API
cdk_rsx_crypto_hash::HmacSha256cdk_rsx_crypto_hash::HmacSha512cdk_rsx_crypto_hash::PreparedHmacSha256cdk_rsx_crypto_hash::PreparedHmacSha512
Cost per operation
- Tag with HMAC-SHA256
- 41,621 instructions≈ $0.000000112
- Average over 100 operations in one call. Staged 256-byte messages and fresh 32-byte keys. Benchmark
- Verify HMAC-SHA256 tag
- 32,914 instructions≈ $0.0000000883
- Average over 100 operations in one call. 256-byte message and 32-byte tag. The key-derived prefix comes from an earlier call. Benchmark
- Tag with HMAC-SHA512
- 44,169 instructions≈ $0.000000118
- Average over 100 operations in one call. Staged 256-byte messages and fresh 32-byte keys. Benchmark
Benchmark measurements
- HMAC-SHA256 with fresh keys
- 4,588,784 instructions
- Staged Wasm64 IC update for 100 independent 256-byte messages and fresh 32-byte keys. Benchmark report
- HMAC-SHA512 with fresh keys
- 4,843,690 instructions
- Staged Wasm64 IC update for 100 independent 256-byte messages and fresh 32-byte keys. Benchmark report
Keccak-256Ethereum-compatible hashes for addresses and signed data.
When to use Keccak-256
Compute the same digest as Ethereum tools. The incremental and parts APIs hash multiple inputs without assembling a contiguous copy.
Tradeoff. Protocols using SHA3-256 expect a different digest. Shape and size of input components remain the application's responsibility.
Rust API
cdk_rsx_crypto_hash::Keccak256cdk_rsx_crypto_hash::keccak256cdk_rsx_crypto_hash::keccak256_parts
Measured instruction cost
The retained benchmark set has no instruction measurement for this entry.
SHA-256, SHA-384 & SHA-512Standard digests for fingerprints, signatures and commitments.
When to use SHA-256, SHA-384 & SHA-512
Hash bytes into a fixed-width value that can be compared across systems. SHA-256 can process four independent messages at once. The streaming APIs take data in pieces.
Tradeoff. Use the digest width specified by your protocol. The wins from four-wide SIMD depend on having independent messages to process together.
Rust API
cdk_rsx_crypto_hash::sha256cdk_rsx_crypto_hash::sha384cdk_rsx_crypto_hash::sha512cdk_rsx_crypto_hash::sha256_simd4::sha2564cdk_rsx_const_sha256::Sha256
Hash API guide · SHA-256 batching and streaming · Compile-time SHA-256 for build and schema identities
Cost per operation
- Hash with SHA-256
- 15,439 instructions≈ $0.0000000414
- One staged 128-byte message, scalar path. Benchmark
- Hash with SHA-256 SIMD
- 10,544 instructions≈ $0.0000000283
- Average over 100 operations in one call. Staged 256-byte messages, four independent messages per SIMD group. Benchmark
- Hash with SHA-512
- 23,937 instructions≈ $0.0000000642
- Average over 100 operations in one call. Staged 256-byte messages, reference backend. Benchmark
Benchmark measurements
- SHA-256. Scalar cohort to four-wide SIMD
- 2,885,097 → 1,475,078 instructions
- Staged Wasm64 IC update for 100 independent 256-byte messages. Input setup happened in an earlier call. Benchmark report
- SHA-512. Reference backend
- 2,820,384 instructions
- Staged Wasm64 IC update for 100 independent 256-byte messages. Input setup happened in an earlier call. Benchmark report
AES block primitivesEncrypt fixed 16-byte blocks inside a defined construction.
When to use AES block primitives
Choose raw AES-128 or AES-256 for protocol building blocks. The AES-128 companion provides borrowed buffers and fixslice or SIMD backends, including a dedicated owner for the public zero key.
Tradeoff. Raw block encryption needs a defined mode and authentication for records. The optional narrow SIMD backend depends on register-swizzle lowering on the qualified engine.
Rust API
cdk_rsx_crypto_symmetric::Aes128Keycdk_rsx_crypto_symmetric::Aes256Keycdk_rsx_crypto_aes::Aes128cdk_rsx_crypto_aes::Aes128Simdcdk_rsx_crypto_aes::ZeroKeyAes128Simd
Raw block API guide · Borrowed AES-128 and backend contracts
Cost per operation
- Encrypt sixteen blocks with AES-128
- 49,589 instructions≈ $0.000000133
- Average over 100 operations in one call. Each staged group has sixteen 16-byte blocks and one fresh key schedule. Benchmark
- Encrypt sixteen blocks with AES-256
- 65,060 instructions≈ $0.000000175
- Average over 100 operations in one call. Each staged group has sixteen 16-byte blocks and one fresh key schedule. Benchmark
- Encrypt sixteen blocks with prepared AES-128
- 37,862 instructions≈ $0.000000102
- Average over 100 operations in one call. Each group has sixteen 16-byte blocks. Key schedules come from an earlier call. Benchmark
Benchmark measurements
- Fresh AES-128 and AES-256 block cohorts
- 5,941,837 / 7,489,043 instructions
- Staged Wasm64 IC updates for 100 independent groups of sixteen 16-byte blocks. Both include one fresh key schedule per group. Benchmark report
- Public-zero-key AES-128 block. Boolean to narrow SIMD
- 6,745 → 2,678 instructions
- Complete checked Wasm64 IC update averaged per block over 1,000 actual blocks. The fixed public key was prepared before timing. The report rounds to 0.1 instruction. Benchmark report
AES-128-GCM & AES-256-GCMAuthenticated encryption for systems that speak AES-GCM.
When to use AES-128-GCM & AES-256-GCM
Encrypt a body and cover associated metadata with a detached tag. Prepared key and GHASH owners help when many records share one key.
Tradeoff. Each encryption under a given key needs a unique nonce. Match the 128-bit or 256-bit key profile and record limits in your protocol.
Rust API
cdk_rsx_crypto_symmetric::Aes128Gcmcdk_rsx_crypto_symmetric::Aes256Gcmcdk_rsx_crypto_symmetric::Aes128GcmPrepared64cdk_rsx_crypto_symmetric::Aes256GcmPrepared64
Cost per operation
- Seal with AES-128-GCM
- 93,687 instructions≈ $0.000000251
- Average over 100 operations in one call. Staged 256-byte record, fresh key, 12-byte nonce, 32 bytes of associated data. Benchmark
- Open with AES-128-GCM
- 94,087 instructions≈ $0.000000252
- Average over 100 operations in one call. Staged 256-byte record, fresh key, 12-byte nonce, 32 bytes of associated data. Benchmark
- Seal with AES-256-GCM
- 114,758 instructions≈ $0.000000308
- Average over 100 operations in one call. Staged 256-byte record, fresh key, 12-byte nonce, 32 bytes of associated data. Benchmark
- Open with AES-256-GCM
- 115,158 instructions≈ $0.000000309
- Average over 100 operations in one call. Staged 256-byte record, fresh key, 12-byte nonce, 32 bytes of associated data. Benchmark
Benchmark measurements
- Seal 100 records, AES-128-GCM
- 10,586,643 instructions
- Staged Wasm64 IC update for 100 independent 256-byte bodies with fresh keys, 12-byte nonces and 32 bytes of associated data. Benchmark report
- Seal 100 records, AES-256-GCM
- 12,693,743 instructions
- Staged Wasm64 IC update for 100 independent 256-byte bodies with fresh keys, 12-byte nonces and 32 bytes of associated data. Benchmark report
AES-128-GCM-SIV & AES-256-GCM-SIVAuthenticated encryption with resistance to nonce mistakes.
When to use AES-128-GCM-SIV & AES-256-GCM-SIV
Use the AES-GCM-SIV record format when the protocol needs misuse resistance. A reused nonce can still expose equality under the same key.
Tradeoff. The separate GCM-SIV format derives keys for each nonce. Applications still assign unique nonces and follow the protocol's record limits.
Rust API
cdk_rsx_crypto_symmetric::Aes128GcmSivcdk_rsx_crypto_symmetric::Aes256GcmSivcdk_rsx_crypto_symmetric::Aes128GcmSivBatchedcdk_rsx_crypto_symmetric::Aes256GcmSivBatched
Cost per operation
- Seal with AES-128-GCM-SIV
- 115,943 instructions≈ $0.000000311
- Average over 100 operations in one call. Staged 256-byte record with fresh key and per-nonce key derivation. Benchmark
- Open with AES-128-GCM-SIV
- 116,375 instructions≈ $0.000000312
- Average over 100 operations in one call. Staged 256-byte record with fresh key and per-nonce key derivation. Benchmark
- Seal with AES-256-GCM-SIV
- 162,477 instructions≈ $0.000000436
- Average over 100 operations in one call. Staged 256-byte record with fresh key and per-nonce key derivation. Benchmark
- Open with AES-256-GCM-SIV
- 162,910 instructions≈ $0.000000437
- Average over 100 operations in one call. Staged 256-byte record with fresh key and per-nonce key derivation. Benchmark
Benchmark measurements
- Seal 100 records, AES-128-GCM-SIV
- 12,734,461 instructions
- Staged Wasm64 IC update for 100 independent 256-byte bodies with fresh keys, 12-byte nonces and 32 bytes of associated data. Includes per-nonce key derivation. Benchmark report
- Seal 100 records, AES-256-GCM-SIV
- 17,387,861 instructions
- Staged Wasm64 IC update for 100 independent 256-byte bodies with fresh keys, 12-byte nonces and 32 bytes of associated data. Includes per-nonce key derivation. Benchmark report
Ascon-AEAD128Lightweight authenticated encryption in the final NIST format.
When to use Ascon-AEAD128
Seal a record and authenticate its public metadata with the Ascon permutation. The typed owner accepts 16-byte keys and nonces.
Tradeoff. Choose this family when both peers use final SP 800-232. Nonces must be unique under one key.
Rust API
cdk_rsx_crypto_symmetric::AsconAead128cdk_rsx_crypto_symmetric::AsconAead128::sealcdk_rsx_crypto_symmetric::AsconAead128::open
Cost per operation
- Seal
- 27,600 instructions≈ $0.000000074
- Average over 100 operations in one call. Staged 256-byte record, fresh 16-byte key and nonce, 32 bytes of associated data. Benchmark
- Open
- 28,179 instructions≈ $0.0000000756
- Average over 100 operations in one call. Staged 256-byte record, fresh 16-byte key and nonce, 32 bytes of associated data. Benchmark
Benchmark measurements
- Seal 100 records
- 3,977,837 instructions
- Staged Wasm64 IC update for 100 independent 256-byte bodies with fresh 16-byte keys, 16-byte nonces and 32 bytes of associated data. Benchmark report
- Open 100 records
- 4,035,643 instructions
- Staged Wasm64 IC update for the same record shape, with authenticated decryption. Benchmark report
ChaCha20 & HChaCha20Generate a keystream or derive a subkey for a protocol.
When to use ChaCha20 & HChaCha20
ChaCha20 XORs bytes with a keyed stream. HChaCha20 turns a 32-byte key and a 16-byte nonce input into the subkey used by XChaCha.
Tradeoff. Plain ChaCha20 provides confidentiality only. Use an authenticated record format when the receiver checks integrity.
Rust API
cdk_rsx_crypto_symmetric::ChaCha20Keycdk_rsx_crypto_symmetric::chacha20_blockcdk_rsx_crypto_symmetric::chacha20_xorcdk_rsx_crypto_symmetric::hchacha20
Cost per operation
- ChaCha20 XOR
- 10,450 instructions≈ $0.000000028
- Average over 100 operations in one call. Staged 256-byte bodies with fresh keys and 12-byte nonces. Benchmark
- HChaCha20 subkey
- 5,112 instructions≈ $0.0000000137
- Average over 100 operations in one call. Staged 32-byte keys and 16-byte nonce inputs. Benchmark
- Generate four ChaCha20 blocks
- 16,715 instructions≈ $0.0000000448
- Average over 100 operations in one call. Staged fresh key words and four 64-byte keystream blocks per item. Benchmark
Benchmark measurements
- ChaCha20 XOR, 100 bodies
- 2,262,457 instructions
- Staged Wasm64 IC update for 100 independent 256-byte bodies. Benchmark report
- HChaCha20, 100 subkeys
- 1,012,623 instructions
- Staged Wasm64 IC update for 100 independent 32-byte keys and 16-byte nonce inputs. Benchmark report
ChaCha20-Poly1305Encrypt a record and verify its tag before using it.
When to use ChaCha20-Poly1305
Seal messages in place and authenticate public metadata alongside the encrypted body. The cohort API can check a request containing many independent keys and records.
Tradeoff. Reserve a unique 12-byte nonce for each record under the same key. The in-place API clears its body on authentication failure.
Rust API
cdk_rsx_crypto_symmetric::ChaCha20Poly1305cdk_rsx_crypto_symmetric::ChaCha20Poly1305Widecdk_rsx_crypto_symmetric::chachapoly_open_cohort
Cost per operation
- Seal
- 17,264 instructions≈ $0.0000000463
- Average over 100 operations in one call. Staged 256-byte record, fresh key, 12-byte nonce, 32 bytes of associated data. Benchmark
- Open
- 17,702 instructions≈ $0.0000000475
- Average over 100 operations in one call. Staged 256-byte record, fresh key, 12-byte nonce, 32 bytes of associated data. Benchmark
- Open an incoming record
- 14,712 instructions≈ $0.0000000395
- Average over 100 operations in one call. Incoming request with packed Wire decoding, fresh keys, 256-byte bodies, and plaintext replies after tag checks. Benchmark
Benchmark measurements
- Open 100 records from an incoming request
- 3,873,592 instructions
- Complete Wasm64 IC update with packed decoding and tag checks. Each record has a different key, a 256-byte body, a 12-byte nonce and 32 bytes of associated data. Benchmark report
- Seal 100 staged records, wide SIMD
- 2,949,068 instructions
- Staged Wasm64 IC update for 100 independent 256-byte bodies with fresh keys, 12-byte nonces and 32 bytes of associated data. Benchmark report
GHASH & POLYVALField authentication math for GCM record formats.
When to use GHASH & POLYVAL
GHASH is the field hash used by AES-GCM. POLYVAL is the field hash used by AES-GCM-SIV. Prepared owners retain a table for repeated use with the same hash key.
Tradeoff. The surrounding authenticated-encryption construction decides how the field result becomes a tag. The two formats use different field encodings.
Rust API
cdk_rsx_crypto_symmetric::ghashcdk_rsx_crypto_symmetric::polyvalcdk_rsx_crypto_symmetric::GHashPrepared64cdk_rsx_crypto_symmetric::PolyvalPrepared64
Cost per operation
- GHASH, sixteen blocks
- 22,051 instructions≈ $0.0000000591
- Average over 100 operations in one call. Each staged group has sixteen 16-byte blocks and fresh hash-key preparation. Benchmark
- POLYVAL, sixteen blocks
- 20,409 instructions≈ $0.0000000547
- Average over 100 operations in one call. Each staged group has sixteen 16-byte blocks and fresh hash-key preparation. Benchmark
Benchmark measurements
- GHASH and POLYVAL, 100 groups
- 2,542,295 / 2,378,025 instructions
- Staged Wasm64 IC updates for 100 independent groups of sixteen 16-byte blocks, including hash-key precomputation. Benchmark report
Poly1305Compute a one-time authentication tag.
When to use Poly1305
Verify a message with a 16-byte tag when the protocol derives a fresh one-time key. The wide implementation also accepts borrowed input.
Tradeoff. Allocate a fresh one-time key for each message. A protocol such as ChaCha20-Poly1305 handles that key separation as part of its record format.
Rust API
cdk_rsx_crypto_symmetric::Poly1305Keycdk_rsx_crypto_symmetric::Poly1305WideKeycdk_rsx_crypto_symmetric::poly1305_tag
Cost per operation
- Create a tag
- 7,152 instructions≈ $0.0000000192
- Average over 100 operations in one call. Staged 256-byte messages and distinct fresh 32-byte one-time keys. Benchmark
- Verify a tag
- 7,475 instructions≈ $0.0000000201
- Average over 100 operations in one call. 256-byte messages and 16-byte tags. One-time test key context prepared before the measured call. Benchmark
Benchmark measurements
- Tag 100 messages
- 1,216,623 instructions
- Staged Wasm64 IC update for 100 independent 256-byte messages with distinct 32-byte one-time keys. Benchmark report
XChaCha20-Poly1305Authenticated record encryption with a 24-byte nonce.
When to use XChaCha20-Poly1305
The larger nonce space suits protocols that assign nonces independently. It keeps the same 32-byte key and 16-byte tag sizes as ChaCha20-Poly1305.
Tradeoff. Use a format that expects XChaCha20. The application still owns nonce selection and key lifetime.
Rust API
cdk_rsx_crypto_symmetric::XChaCha20Poly1305cdk_rsx_crypto_symmetric::XChaCha20Poly1305Wide
Cost per operation
- Seal
- 18,351 instructions≈ $0.0000000492
- Average over 100 operations in one call. Staged 256-byte record, fresh key, 24-byte nonce, 32 bytes of associated data. Benchmark
- Open
- 18,792 instructions≈ $0.0000000504
- Average over 100 operations in one call. Staged 256-byte record, fresh key, 24-byte nonce, 32 bytes of associated data. Benchmark
Benchmark measurements
- Seal 100 staged records, wide SIMD
- 3,137,477 instructions
- Staged Wasm64 IC update for 100 independent 256-byte bodies with fresh keys, 24-byte nonces and 32 bytes of associated data. Benchmark report
- Open 100 staged records, wide SIMD
- 3,177,881 instructions
- Staged Wasm64 IC update with the same body, key, nonce and associated-data sizes as the seal workload. Benchmark report
BIP340 SchnorrVerify Bitcoin-style signatures with x-only public keys.
When to use BIP340 Schnorr
Check a 64-byte signature under a 32-byte public key. An optional verifier can validate public Y-coordinate hints and still check each signature independently.
Tradeoff. Use BIP340 when the protocol expects its signature and key encodings. Aggregate research variants have separate admission rules.
Rust API
cdk_rsx_crypto_secp256k1::SchnorrSigningKeycdk_rsx_crypto_secp256k1::SchnorrPublicKeycdk_rsx_crypto_secp256k1::schnorr_verifycdk_rsx_crypto_batch::schnorr_hints::verify_single
BIP340 API guide · Independent BIP340 verification and hints
Cost per operation
- Verify a signature with hints in a batch
- 964,832 instructions≈ $0.00000259
- Average over 100 operations in one call. Each signature gets its own verdict. Uses checked public-key and nonce Y coordinates. Benchmark
- All 100 in one call · 96,483,265 instructions · ≈ $0.000259
- Verify one signature with hints
- 1,585,090 instructions≈ $0.00000425
- Checked public-key and nonce Y coordinates. Average of 100 separate one-signature calls. Benchmark
- Verify one signature without hints
- 2,468,486 instructions≈ $0.00000662
- One 32-byte message in a single incoming call. Benchmark
- Sign
- 2,211,450 instructions≈ $0.00000593
- Average over 100 operations in one call. Staged 256-byte message, 32-byte secret and auxiliary input. Includes normalized key construction. Benchmark
Benchmark measurements
- Verify 100 hinted signatures independently, complete call
- 100,700,230 instructions
- One Wasm64 IC update for 100 distinct signatures on 32-byte messages, with checked public-key and nonce Y hints. The complete call averages 1,007,002 instructions per signature. Benchmark report
- Verify one hinted signature within that batch, operation only
- 964,832 instructions
- Average per signature across the 100 independently checked signatures. The measured verification work for the whole batch is 96,483,265 instructions. Benchmark report
- Verify one hinted signature in its own call, operation only
- 1,585,090 instructions
- Mean of 100 separate one-signature updates using checked public-key and nonce Y hints. Each complete call averaged 1,954,577 instructions. Benchmark report
- Verify one unhinted signature, operation only
- 2,468,486 instructions
- One incoming update for a 32-byte message without coordinate hints. The complete call used 2,828,867 instructions. Benchmark report
ECDSA / secp256k1Check signatures from secp256k1 wallets and services.
When to use ECDSA / secp256k1
Verify standard compact signatures over 32-byte digests. The caller can supply an inverse hint, which the verifier checks before using it to reduce the work.
Tradeoff. Choose the protocol's low-S policy for incoming signatures. Hinted requests carry additional bytes. Verification kernels work on public inputs.
Rust API
cdk_rsx_crypto_secp256k1::EcdsaSigningKeycdk_rsx_crypto_secp256k1::EcdsaPublicKeycdk_rsx_crypto_secp256k1::verify_prehashcdk_rsx_crypto_secp256k1::verify_fresh_packed_batch_prehash_with_hints_gwindow
Cost per operation
- Sign a digest
- 2,046,851 instructions≈ $0.00000549
- Average over 100 operations in one call. Staged 32-byte secret and 32-byte prehashed digest. Returns a compact low-S signature. Benchmark
- Verify a compact signature
- 2,128,072 instructions≈ $0.00000571
- Average over 100 operations in one call. Incoming request with valid compact signatures, 32-byte digests, and fresh uncompressed SEC1 public keys. Benchmark
- Derive a public key
- 1,052,911 instructions≈ $0.00000282
- Average over 100 operations in one call. Staged 32-byte secret, including import. Produces a compressed SEC1 key. Benchmark
- Verify with a checked inverse
- 1,086,502 instructions≈ $0.00000291
- Average over 100 operations in one call. Incoming request using dense four-wide SIMD with an extra 32-byte inverse hint per input. Benchmark
Benchmark measurements
- Verify 100 ordinary compact signatures
- 216,915,273 instructions
- Complete Wasm64 IC update. Distinct valid signatures with uncompressed 65-byte public keys, 32-byte digests and 64-byte signatures. Benchmark report
- Verify 100 signatures with checked inverse hints
- 113,219,850 instructions
- Complete Wasm64 IC update using dense four-wide SIMD and the G12 generator window. Same base record sizes plus a 32-byte hint per signature. Benchmark report
Ed25519Sign or verify messages using compact Ed25519 keys.
When to use Ed25519
Sign arbitrary bytes and verify them with a 32-byte public key. Strict validation rejects weak small-order points. The dense SIMD path checks independent verification equations together.
Tradeoff. Match the sender's Ed25519 profile. The optional prime-order batch verifier applies a stricter subgroup policy than independent verification.
Rust API
cdk_rsx_crypto_curves::ed25519::SigningKeycdk_rsx_crypto_curves::ed25519::PublicKeycdk_rsx_crypto_curves::ed25519::verify_strict_simd128_densecdk_rsx_crypto_curves::ed25519::PrimeOrderBatch
Cost per operation
- Sign
- 1,369,423 instructions≈ $0.00000367
- Average over 100 operations in one call. Staged 256-byte message and 32-byte seed, including seed expansion and public derivation. Benchmark
- Verify one signature
- 2,213,046 instructions≈ $0.00000594
- One staged 256-byte message with fresh public-key and strict scalar signature checks. Benchmark
- Derive a public key
- 659,558 instructions≈ $0.00000177
- Average over 100 operations in one call. Staged 32-byte seed, including seed expansion. Produces a 32-byte public key. Benchmark
- Verify a signature in a SIMD batch
- 1,425,620 instructions≈ $0.00000382
- Average over 100 operations in one call. Distinct staged signatures on 256-byte messages, with an independent strict check for each. Benchmark
Benchmark measurements
- Verify 100 signatures in one strict SIMD update, complete call
- 142,979,685 instructions
- Staged Wasm64 IC update for independent 256-byte messages with distinct fresh public keys and valid signatures. Benchmark report
- Verify one signature within that SIMD batch, operation only
- 1,425,620 instructions
- Average per signature in one call with 100 independent verdicts. The measured verification work for the whole batch is 142,562,038 instructions. Benchmark report
EIP-712 & Ethereum signaturesCheck typed data a user signs with an Ethereum wallet.
When to use EIP-712 & Ethereum signatures
Build the EIP-712 digest from the protocol domain and a typed-data hash. Derive an Ethereum address from a supplied public key and verify the signature against it.
Tradeoff. The application owns its schema encoding, intended signer, and replay policy. The public key is supplied by the caller and checked against the expected address.
Rust API
cdk_rsx_crypto_ethereum::eip712_digestcdk_rsx_crypto_ethereum::hash_wordscdk_rsx_crypto_ethereum::RsvSignaturecdk_rsx_crypto_ethereum::address_from_public_keycdk_rsx_crypto_ethereum::verify_prehash_with_public_key
Measured instruction cost
The retained benchmark set has no instruction measurement for this entry.
RSA-PSS-3072Verify RSA-PSS signatures for a fixed key and hash profile.
When to use RSA-PSS-3072
Accept existing RSA-PSS signatures over a message or precomputed SHA-256 digest. A prepared public key retains arithmetic for repeated verification.
Tradeoff. This verifier uses a 3,072-bit modulus and exponent 65,537. The crate implements public verification for that profile.
Rust API
cdk_rsx_crypto_rsa::PublicKey::verifycdk_rsx_crypto_rsa::PublicKey::verify_digestcdk_rsx_crypto_rsa::PreparedPublicKey
Cost per operation
- Verify a message
- 5,396,277 instructions≈ $0.0000145
- Average over 100 operations in one call. Staged 256-byte message and fresh 384-byte modulus and signature. Includes hashing. Benchmark
- Verify a prehashed digest
- 5,356,666 instructions≈ $0.0000144
- Average over 100 operations in one call. Staged 32-byte digest and fresh 384-byte modulus and signature. Benchmark
- Import a public modulus
- 6,455 instructions≈ $0.0000000173
- Average over 100 operations in one call. Staged 384-byte modulus, including validation for exponent 65537. Benchmark
Benchmark measurements
- Verify 100 fresh public keys and signatures
- 540,046,102 instructions
- Staged Wasm64 IC update with 100 independent 256-byte messages, 384-byte moduli and 384-byte signatures. Includes hashing and fresh key import. Benchmark report
DHKEM (X25519, HKDF-SHA256)Encapsulate a derived secret for a recipient public key.
When to use DHKEM (X25519, HKDF-SHA256)
The sender creates an encapsulated public value. The recipient combines it with its private key to derive the same secret. A prepared recipient helps when one key receives many encapsulations.
Tradeoff. This is the KEM within the HPKE X25519 suite. The surrounding protocol supplies authenticated peer identity and fresh ephemeral entropy.
Rust API
cdk_rsx_crypto_hpke::encapcdk_rsx_crypto_hpke::encap_with_ikmcdk_rsx_crypto_hpke::PreparedRecipient::decap
Cost per operation
- Derive a key pair
- 693,011 instructions≈ $0.00000186
- Average over 100 operations in one call. Staged 32-byte input keying material, including RFC 9180 derivation. Benchmark
- Encapsulate
- 1,343,181 instructions≈ $0.0000036
- Average over 100 operations in one call. Wasm SIMD with a staged 32-byte recipient public key and ephemeral input. Median of three calls. Benchmark
- Decapsulate
- 1,299,781 instructions≈ $0.00000349
- Average over 100 operations in one call. Wasm SIMD with a staged 32-byte recipient secret and encapsulated key. Includes public derivation. Median of three calls. Benchmark
Benchmark measurements
- 100 fresh encapsulations, SIMD
- 134,744,323 instructions
- Staged Wasm64 IC update, median of three. Distinct 32-byte public keys and 32-byte ephemeral inputs. The call includes key derivation, shared-secret derivation and cleanup. Benchmark report
HPKE Base modeEncrypt to a recipient public key and seal follow-up records.
When to use HPKE Base mode
Compose X25519 DHKEM, HKDF-SHA256 and ChaCha20-Poly1305 in the fixed RFC 9180 Base suite. Create a fresh envelope or reuse a sender context for a sequence of records. The exporter derives separate application material.
Tradeoff. The recipient checks a tag on each record. Sender identity must come from the surrounding protocol.
Rust API
cdk_rsx_crypto_hpke::setup_sendercdk_rsx_crypto_hpke::setup_receivercdk_rsx_crypto_hpke::seal_in_placecdk_rsx_crypto_hpke::Sender::seal_in_placecdk_rsx_crypto_hpke::Exporter::exportcdk_rsx_crypto_hpke::ExportedAead
Cost per operation
- Set up and seal
- 1,460,941 instructions≈ $0.00000392
- Average over 100 operations in one call. Wasm SIMD with a staged 256-byte record, fresh key agreement, and context setup. Benchmark
- Set up and open
- 1,417,714 instructions≈ $0.0000038
- Average over 100 operations in one call. Wasm SIMD with a staged 256-byte record, fresh key agreement, and context setup. Benchmark
- Seal on an established context
- 25,951 instructions≈ $0.0000000696
- Average over 100 operations in one call. Staged 256-byte record on an established context. Setup was measured separately. Benchmark
- Open on an established context
- 26,342 instructions≈ $0.0000000707
- Average over 100 operations in one call. Staged 256-byte record on an established context. Setup was measured separately. Benchmark
Benchmark measurements
- Set up and seal 100 fresh envelopes
- 147,319,990 instructions
- Staged Wasm64 IC update, median of three. 100 distinct 256-byte bodies with 29 bytes of context and 30 bytes of associated data. Fresh setup is included. Benchmark report
- Seal 100 records on one established context
- 6,032,391 instructions
- Prior-call context Wasm64 IC update. 100 independent 256-byte bodies. Sender setup took place before the measured call. Benchmark report
ML-KEM-512 & ML-KEM-768Establish a shared key using a standardized post-quantum KEM.
When to use ML-KEM-512 & ML-KEM-768
Use the FIPS 203 format for either supported parameter set. The sender returns a ciphertext plus a 32-byte shared secret. The recipient derives the same secret from its decapsulation key.
Tradeoff. Pick the parameter set required by the protocol. ML-KEM-768 carries larger keys and ciphertexts. A corrupted ciphertext of the right size yields an implicit-rejection secret, so authentication belongs to the surrounding protocol.
Rust API
cdk_rsx_crypto_mlkem::mlkem512::EncapsulationKeycdk_rsx_crypto_mlkem::mlkem512::DecapsulationKeycdk_rsx_crypto_mlkem::mlkem768::EncapsulationKeycdk_rsx_crypto_mlkem::mlkem768::DecapsulationKey
Cost per operation
- Generate ML-KEM-512 keys
- 832,883 instructions≈ $0.00000223
- Average over 100 operations in one call. Wasm SIMD Q15 with staged 64-byte entropy input. Produces public and secret keys. Benchmark
- Encapsulate with ML-KEM-512
- 959,705 instructions≈ $0.00000257
- Average over 100 operations in one call. Wasm SIMD Q15 includes fresh import of a staged 800-byte public key. Produces a 768-byte ciphertext and 32-byte secret. Benchmark
- Decapsulate with ML-KEM-512
- 1,253,234 instructions≈ $0.00000336
- Average over 100 operations in one call. Wasm SIMD Q15 with a staged 1,632-byte secret key and 768-byte ciphertext, including checked import. Benchmark
- Encapsulate with ML-KEM-768
- 1,534,765 instructions≈ $0.00000412
- Average over 100 operations in one call. Wasm SIMD Q15 includes fresh import of a staged 1,184-byte public key. Produces a 1,088-byte ciphertext and 32-byte secret. Benchmark
Benchmark measurements
- ML-KEM-512. 100 encapsulations with fresh keys
- 98,545,730 instructions
- Staged Wasm64 IC update using SIMD Q15, median of three. Includes checked import of 800-byte public keys and writes 768-byte ciphertexts and 32-byte secrets. Benchmark report
- ML-KEM-768. 100 encapsulations with fresh keys
- 156,947,764 instructions
- Staged Wasm64 IC update using SIMD Q15, median of three. Includes checked import of 1,184-byte public keys and writes 1,088-byte ciphertexts and 32-byte secrets. Benchmark report
X25519Derive shared material from one secret and a peer public key.
When to use X25519
Two peers can agree on the same 32-byte value without transmitting it. The API rejects an all-zero result. An optional batched backend shares final inversion work across independent pairs.
Tradeoff. Authenticate the peer and pass the result through your protocol's KDF before using it as a key. The measured SIMD agreement path is experimental.
Rust API
cdk_rsx_crypto_curves::x25519::SecretKey::agreecdk_rsx_crypto_curves::x25519::agree_batch_independent_experimental
Cost per operation
- Agree one shared secret
- 2,102,177 instructions≈ $0.00000564
- One staged 32-byte secret and 32-byte peer key, scalar path with fresh import. Benchmark
- Agree shared secrets with SIMD
- 636,719 instructions≈ $0.00000171
- Average over 100 operations in one call. Staged independent secret and peer key pairs, including scratch and cleanup. Benchmark
- Derive a public key
- 515,015 instructions≈ $0.00000138
- Average over 100 operations in one call. Staged independent 32-byte secrets, with shared final inversion in the batch. Benchmark
Benchmark measurements
- 100 independent agreements, SIMD
- 64,098,112 instructions
- Staged Wasm64 IC update with 100 distinct 32-byte secrets and 32-byte peer public keys. Measured code includes import, agreement, result checks and cleanup. Benchmark report
Alternate ECDSA encodingsMeasure ECDSA with an encoded inverse or explicit nonce point.Experimental
When to use Alternate ECDSA encodings
Study processing work shifted to sender-side arithmetic or additional input. The prototype keeps conversion APIs separate from ordinary compact verification.
Tradeoff. These are separate experimental wire formats. A receiver using standard compact ECDSA expects the standard signature encoding.
Rust API
cdk_rsx_crypto_secp256k1::experimental::InverseEncodedSignaturecdk_rsx_crypto_secp256k1::experimental::ExplicitRSignature
Cost per operation
- Verify an inverse-encoded signature
- 2,098,157 instructions≈ $0.00000563
- Average over 100 operations in one call. Staged valid signatures and 256-byte messages. Includes hashing before verification. Benchmark
- Verify an explicit-R signature
- 4,225,727 instructions≈ $0.0000113
- Average over 100 operations in one call. Staged valid explicit-R signatures and 256-byte messages. Benchmark
Benchmark measurements
- Verify 100 inverse-encoded signatures
- 210,273,080 instructions
- Staged Wasm64 IC update for 100 independent valid records. The benchmark hashes 256-byte messages before checking the alternate encoding. Benchmark report
- Verify 100 explicit-R signatures
- 423,030,250 instructions
- Staged Wasm64 IC update for the explicit-R variant with 100 independent valid records and 256-byte messages. Benchmark report
ChaCha8, ChaCha12 & ChaCha20 PRGsGenerate repeatable, separate byte streams from one session seed.Experimental
When to use ChaCha8, ChaCha12 & ChaCha20 PRGs
Study caller-seeded game profiles and the 20-round control. Each query and purpose has its own deterministic stream. The batch API returns one 32-byte output per query.
Tradeoff. The eight- and twelve-round profiles are experimental. Repeating the same inputs repeats the stream. Supply private entropy when deriving private material.
Rust API
cdk_rsx_crypto_prg::Sessioncdk_rsx_crypto_prg::Profilecdk_rsx_crypto_prg::Session::fill_secretscdk_rsx_crypto_prg::Stream::fill
Cost per operation
- Generate one secret with ChaCha8
- 1,703 instructions≈ $0.00000000457
- One 32-byte stream output from an established session. Benchmark
- Generate one secret with ChaCha12
- 1,987 instructions≈ $0.00000000533
- One 32-byte stream output from an established session. Benchmark
- Generate one secret with ChaCha20
- 2,531 instructions≈ $0.00000000679
- One 32-byte stream output from an established session. Benchmark
- Generate one secret with BLAKE3
- 2,274 instructions≈ $0.0000000061
- One 32-byte output from a prepared session, using the selected short-input path. Benchmark
Benchmark measurements
- ChaCha8. Individual streams to batched output
- 6,860 → 6,022 instructions
- Complete checked Wasm64 IC update per 32-byte output in an actual 100-query cohort. Session setup precedes timing. Both paths produce the same independent outputs. Values rounded to 0.1 instruction. Benchmark report
- ChaCha20. Individual streams to batched output
- 7,682 → 6,634 instructions
- Complete checked Wasm64 IC update per 32-byte output in an actual 100-query cohort with the 20-round control. Setup and rounding match the ChaCha8 cohort. Benchmark report
FourQ ECDHCompare FourQ key agreement with other curves.Experimental
When to use FourQ ECDH
The portable port reproduces the compressed public-key and raw shared-secret formats and measures key generation, validation and agreement separately.
Tradeoff. Use this port for research. Upstream FourQlib is unmaintained and the port lacks a production audit and compiled-Wasm constant-time qualification.
Rust API
cdk_rsx_crypto_fourq::SecretKey::public_keycdk_rsx_crypto_fourq::SecretKey::agreecdk_rsx_crypto_fourq::PublicKey::from_bytes
Cost per operation
- Agree a shared secret
- 2,461,712 instructions≈ $0.0000066
- Average over 100 operations in one call. Staged distinct 32-byte secret and compressed peer public key. Includes peer validation. Benchmark
- Derive a public key
- 959,423 instructions≈ $0.00000257
- Average over 100 operations in one call. Staged distinct fixed-width secrets and compressed public-key outputs. Benchmark
Benchmark measurements
- 100 independent agreements
- 246,596,471 instructions
- Staged Wasm64 IC update for 100 distinct 32-byte secret and compressed peer public-key pairs. Includes peer validation and agreement. Benchmark report
- Derive 100 public keys
- 96,364,781 instructions
- Staged Wasm64 IC update for 100 distinct fixed-width secrets and compressed public-key outputs. Benchmark report
Free-XOR & Half-GatesBuild and evaluate Boolean circuits over encoded inputs.Experimental
When to use Free-XOR & Half-Gates
Compose XOR and AND gates from 128-bit wire labels. The crate includes an eight-bit equality fixture, a fixed-key AES gate hash and a BLAKE3 XOF for private randomness.
Tradeoff. The library implements honest-execution components. Oblivious transfer, authenticated transport and malicious-party protections belong to a separate protocol.
Rust API
cdk_rsx_crypto_garbled_circuit::free_xorcdk_rsx_crypto_garbled_circuit::garble_andcdk_rsx_crypto_garbled_circuit::evaluate_andcdk_rsx_crypto_garbled_circuit::prepare_equality8cdk_rsx_crypto_garbled_circuit::evaluate_equality8cdk_rsx_crypto_garbled_circuit::PrgSession::fill_secrets
Cost per operation
- Generate one session secret
- 2,274 instructions≈ $0.0000000061
- One 32-byte output from a prepared BLAKE3 session. Benchmark
- Evaluate an equality circuit
- 29,043 instructions≈ $0.0000000779
- Average over 1,000 operations in one call. Gate evaluation with staged labels. The complete checked update evaluates 1,000 circuits. Benchmark
Benchmark measurements
- Evaluate an equality circuit. Boolean to narrow SIMD
- 42,922 → 35,576 instructions
- Complete checked Wasm64 IC update per circuit in an actual 1,000-query cohort. Gate-only benchmark with staged circuit inputs. Values rounded to 0.1 instruction. Benchmark report
- BLAKE3 session PRG. Stream to four-wide batch
- 6,954 → 5,583 instructions
- Complete checked Wasm64 IC update per independent 32-byte output in an actual 100-query cohort. The session was prepared before timing. Values rounded to 0.1 instruction. Benchmark report
LightSABER & SABERCompare round-three post-quantum KEM parameter sets.Experimental
When to use LightSABER & SABER
The experimental implementation supports LightSABER and SABER with scalar and Wasm SIMD polynomial backends. Both derive a 32-byte shared secret.
Tradeoff. These are Round-3 submission formats. Use a protocol that explicitly chooses them. The parameters and public encodings differ from standardized ML-KEM.
Rust API
cdk_rsx_crypto_saber::lightsaber::keygencdk_rsx_crypto_saber::lightsaber::EncapsulationKeycdk_rsx_crypto_saber::saber::keygencdk_rsx_crypto_saber::saber::EncapsulationKeycdk_rsx_crypto_saber::Backend
Cost per operation
- Generate LightSABER keys
- 601,584 instructions≈ $0.00000161
- Average over 100 operations in one call. Staged seed inputs. Produces 672-byte public and 1,568-byte secret keys. Benchmark
- Encapsulate with LightSABER
- 830,318 instructions≈ $0.00000223
- Average over 100 operations in one call. Staged fresh public key and seed. Produces a 736-byte ciphertext. Benchmark
- Decapsulate with LightSABER
- 996,625 instructions≈ $0.00000267
- Average over 100 operations in one call. Staged fresh secret key and 736-byte ciphertext with implicit rejection. Benchmark
- Encapsulate with SABER
- 1,493,703 instructions≈ $0.00000401
- Average over 100 operations in one call. Staged fresh public key and seed. Produces a 1,088-byte ciphertext. Benchmark
Benchmark measurements
- LightSABER. 100 fresh encapsulations
- 85,517,827 instructions
- Staged Wasm64 IC update using SIMD Toom-Cook 4. Distinct fresh 32-byte entropy inputs and 736-byte ciphertext outputs. Benchmark report
- SABER. 100 fresh encapsulations
- 152,842,103 instructions
- Staged Wasm64 IC update using the same backend with SABER's 1,088-byte ciphertexts. Benchmark report
Private geometry circuitsCompile public maps or distance rules into Boolean circuits.Experimental
When to use Private geometry circuits
Compile line of sight on public maps with 0, 4, 16 or 64 walls. Check square proximity with radius 1, 2 or 4. Eight-bit equality and the 256-way selector are separate reference circuits.
Tradeoff. Each cost covers a measured garbling or evaluation stage. The fixture uses locally selected labels. A complete private protocol still needs input binding, authenticated transport and oblivious transfer.
Rust API
cdk_rsx_crypto_private_los::garble_intocdk_rsx_crypto_private_los::evaluate_intocdk_rsx_crypto_private_los::MAP_16cdk_rsx_crypto_private_los::PROXIMITY_1cdk_rsx_crypto_private_los::EQUALITY_8cdk_rsx_crypto_private_los::SELECTOR_256
Cost per operation
- Evaluate one 4-wall sight line
- 1,462,662 instructions≈ $0.00000392
- One position pair on a fixed public map, with prepared input labels. Benchmark
- Evaluate one 16-wall sight line
- 3,872,329 instructions≈ $0.0000104
- One position pair on a fixed public map, with prepared input labels. Benchmark
- Evaluate one 64-wall sight line
- 11,660,445 instructions≈ $0.0000313
- One position pair on a fixed public map, with prepared input labels. Benchmark
- Evaluate one radius-4 proximity circuit
- 167,963 instructions≈ $0.000000451
- One pair of private coordinates with staged labels. Circuit evaluation only. Benchmark
Benchmark measurements
- Evaluate LOS on a 16-wall map, initial to reusable workspace
- 11,162,096 → 11,003,690 instructions
- Complete checked Wasm64 IC update per position pair across 100 actual circuits. The established public map and fixture are staged. Values rounded to 0.1 instruction. Benchmark report
- Evaluate 100 radius-4 proximity circuits
- 29,306,802 instructions
- Complete checked Wasm64 IC update for 100 pairs of private coordinate bytes and a fixed square radius. Measures evaluation with staged fixture input labels and excludes protocol transport. Benchmark report
Radix signature certificatesTest moving signature verification work out of updates.Experimental
When to use Radix signature certificates
Prepare a witness in a query or offline, then pass it with the signature records for the update to verify. The checkpoint variant adds witness bytes and producer work to reduce replicated verification cost.
Tradeoff. The update verifies untrusted statements and witnesses against an experimental construction. The query and update are separate measurements and the protocol still needs independent cryptographic review.
Rust API
cdk_rsx_crypto_batch::radix_certificate::prove_groupedcdk_rsx_crypto_batch::radix_certificate::verify_groupedcdk_rsx_crypto_batch::radix_certificate::checkpoints::verify
Batch certificate interfaces (Rust source) · Certificate construction and scope
Cost per operation
- Verify one 100-signature certificate
- 38,704,285 instructions≈ $0.000104
- Incoming request with checked coordinate hints and a 1,924-byte proof. Benchmark
- Create one certificate
- 162,809,224 instructionsFree query
- Query bench checks 105 signatures, filters five false equations, and produces a 100-record certificate. Benchmark
Benchmark measurements
- Verify a 100-signature certificate. R3 to R4
- 41,122,086 → 39,643,555 instructions
- Complete Wasm64 IC update for 100 distinct signers, checked coordinate hints and a 1,924-byte proof. Includes fresh preparation, decoding, page fees and output. Benchmark report
- Create the same certificate in a query
- 164,395,069 instructions
- Complete Wasm64 IC query. Checks 105 distinct signatures, filters five false equations and prepares the 100-record packet. Benchmark report
Weighted signature batchesStudy aggregate verification of public signatures.Experimental
When to use Weighted signature batches
Combine BIP340 or explicit-R equations in a weighted check. The implementation has transcript-derived and caller-randomized weighting, plus optional fallback to independent checks.
Tradeoff. The aggregate verifier has its own acceptance and security assumptions. Explicit-R ECDSA adds a nonce point to the signature format. These constructions require independent cryptographic review.
Rust API
cdk_rsx_crypto_batch::verify_bip340_batchcdk_rsx_crypto_batch::verify_bip340_batch_randomizedcdk_rsx_crypto_batch::schnorr_hints::verify_batch_with_fallbackcdk_rsx_crypto_batch::ecdsa_explicit::verify_batch
Public-input weighting and fallback experiments · Scope and review status
Cost per operation
- Verify a batch of 100 BIP340 signatures
- 53,004,132 instructions≈ $0.000142
- Incoming request. Checks supplied coordinates and takes the aggregate success path for valid inputs. Benchmark
- Verify a batch of 100 explicit-R signatures
- 125,049,623 instructions≈ $0.000335
- Staged valid explicit-R ECDSA signatures on independent 256-byte messages. Benchmark
Benchmark measurements
- Aggregate 100 hinted BIP340 signatures
- 57,221,619 instructions
- Complete Wasm64 IC update for distinct valid 32-byte messages and supplied public-key and nonce Y hints. Transcript weighting with full fallback enabled. The reported inputs take the aggregate success path. Benchmark report
- Check 100 explicit-R ECDSA signatures in an aggregate
- 125,465,777 instructions
- Staged Wasm64 IC update for 100 independent valid records with 256-byte messages. The prototype uses transcript-derived weighting and the width-seven arithmetic backend. Benchmark report