std::crypto API Reference
Development snapshot. Generated from the current repository source. This inventory may include internal and test declarations; it is not a list of supported public APIs. Check the module guide and the compiler version you use before relying on an entry.
Application entry points
Start with checked cryptographic facades, AEAD ownership and nonce policy, hashes, and key derivation/signatures. export marks a declaration in its defining source module; it does not classify a raw kernel or test helper as an application-level facade.
Overview
Structs: ChaCha20Poly1305 · Aes128Gcm · Aes256Gcm · HkdfSha256 · HkdfSha384 · Pbkdf2Sha256 · X25519 · Ed25519 · Argon2Parameters · Argon2id · CryptoError · ExtPoint · AffPoint · Fe25519 · Poly1305 · Sha1 · Sha256 · Sha512 · Sha384
Enums: CryptoErrorKind
Functions: computeAeadTag · aeadEncrypt · aeadDecrypt · xtime · gfMul8 · gfPow8 · rotl8 · sboxByte · rconAt · aes256ExpandKey · aes128ExpandKey · aesEncryptBlockWithRk · aes128EncryptBlockWithRk · aes128EncryptBlock · aes256EncryptBlockWithRk · aes256EncryptBlock · counter32be · inc32be · validateIncrementingCtrRequest · validateInitialCtrRequest · aes256CtrXorWithRk · aes256CtrXor · aes128CtrXorWithRk · aes128CtrXor · aes128CtrXorFromInitialCounter · reverseBits64 · ghashMulReflected · ghashUpdateReflected · ghashBlockReflected · ghashUpdateFourReflected · ghashAll · encryptBlockWithSchedule · ctrXorWithSchedule · validateGcmLengths · gcmEncryptWithSchedule · gcmDecryptWithSchedule · aes128GcmEncrypt · aes128GcmDecrypt · aes256GcmEncrypt · aes256GcmDecrypt · cryptoError · clearSensitiveOutput · validateExactLength · spansOverlapOutput · checkedTaggedLength · prepareDetachedInputs · aesGcmSealDetachedInto · aesGcmOpenDetachedInto · loadLe64 · low32 · rotr64 · add64 · blamka · storeLe64 · storeLe32 · roundedMemoryKiB · validParams · clearOutputIfRepresentable · invalidArgonParameter · hash2ToLen · hPrimeTo · blockOffset · gbMix · roundBlockInPlace · fillBlock · nextAddressBlock · selectRefIndex · seedInitBlock · argon2DeriveVariant · argon2DeriveVariantEx · argon2idDerive · argon2idDeriveEx · argon2iDerive · argon2iDeriveEx · argon2dDerive · argon2dDeriveEx · clearArgonVec · argonSpanOverlapsOutput · validateArgonFacade · b64At · base64Encode · base64EncodeString · rotr64 · loadLe64 · storeLe64 · ivAt · sigmaRow · g · compress · blake2bTo · blake2bHex · ctEq · xorInto · xorInPlace · zeroize · rotl32 · loadLe32 · storeLe32 · quarterRound · chacha20Block · chacha20Xor · loadLe32 · rotl32 · qr · pack64 · chacha20Block4Way · pointIdentity · edD · ed2D · affIdentity · affBasepoint · affAdd · affScalarMul · feCopyAff · affEncode · feEq · fePowConst · feSqrtM1 · feSqrtRatio · scalarLessThanL · affDecodeCompressed · affToExt · pointDouble · pointAdd · pointCopy · pointCmov · ctEqNibble · scalarMul · extIsIdentity · extHasSmallOrder · pointEncode · basepointExt · scalarL · reduceModL64 · mulScalar32 · scMulAdd · scReduce · ed25519PublicKey · ed25519Sign · ed25519SignHex · ed25519Verify · ed25519PublicKeyHex · ed25519BasepointHex · ed25519MulBaseHex · feLoadLe64 · feZero · feOne · feCopy · feFromBytes · feToBytes · feCarryPropagate · feReduce · feAdd · feSub · feReduceWide · feMul · feMulSmall · feSq · feSqN · feInvert · feCSwap · hexChar · fromHexNibble · hexEncode · hexDecodeTo · hkdfExtract · hkdfExpand · hkdf · hkdfExtractSha384 · hkdfExpandSha384 · hkdfSha384 · hmacSha1To · hmacSha256To · hmacSha256PartsTo · hmacSha384PartsTo · hmacSha384To · hmacSha384Hex · hmacSha256Hex · hmacVerifySha256Hex · pbkdf2Sha256 · pbkdf2Sha256Hex · p1305LoadLe32 · newPoly1305 · poly1305Auth · rol32 · newSha1 · sha1To · sha1Hex · bswap32 · k256 · newSha256 · sha256To · sha256Hex · rotr64 · ch512 · maj512 · bsig0_512 · bsig1_512 · ssig0_512 · ssig1_512 · bswap64 · k512 · sha512Hex · sha512To · sha384Hex · sha384To · xorBlocks · addU32Blocks · rotrU32Blocks · storeLe64 · storeBe64 · x25519 · x25519Basepoint · x25519Hex · test_aead_rfc8439 · test_aead_tamper_reject · test_aes128_fips197_block_vector · test_aes128_gcm_nist_zero_vector · test_aes_gcm_roundtrip · test_aes_gcm_reject_tamper · test_aes_ctr_rejects_counter_wrap_before_output · test_aes_ctr_initial_counter_allows_final_block · test_aes_gcm_rejects_oversized_payload_before_output · arraySpan · strBytes · assertBytes · test_safe_chacha_combined_roundtrip_and_reuse · test_safe_aes256_gcm_combined_roundtrip · test_safe_aes128_gcm_combined_roundtrip_and_dimensions · test_safe_facade_rejects_dimensions_and_clears_output · test_safe_facade_auth_failure_releases_no_plaintext · test_safe_facade_stages_in_place_aliases · test_safe_hkdf_rfc5869_and_reuse · test_safe_hkdf_sha384_reuse_and_failure_clearing · test_safe_pbkdf2_vector_and_parameter_error · test_safe_argon2id_reuse_alias_and_parameter_errors · test_safe_argon2id_accepts_empty_password · test_safe_ed25519_roundtrip_and_dimensions · expectArgonSuccess · test_argon2id_deterministic · test_argon2id_param_sensitivity · test_argon2_variants_produce_distinct_outputs · test_argon2_invalid_params_zero_output · test_argon2id_ex_secret_ad_affect_output · test_argon2i_d_ex_secret_ad_affect_output · test_argon2id_long_output_deterministic · test_argon2id_rfc9106_case · makeBytes · observe · bench_sha256_4k · bench_chacha20_poly1305_seal_16k · bench_chacha20_xor_16k · bench_poly1305_auth_16k · bench_aes128_gcm_seal_16k · bench_aes256_gcm_seal_16k · bench_x25519_public_key · bench_ed25519_sign_1k · bench_ed25519_verify_1k · bench_argon2id_1mib_one_pass · test_blake2b_empty · test_blake2b_abc · test_cteq_basic · test_xor_and_zeroize · fillSeq · test_chacha20_block_rfc8439 · test_chacha20_xor_roundtrip · test_chacha20_four_way_matches_scalar_blocks · test_chacha20_rejects_counter_wrap_before_output · main · test_ed25519_public_key_rfc8032_case1 · test_ed25519_sign_rfc8032_case1 · test_ed25519_verify_rfc8032_case1 · test_ed25519_verify_reject_tamper · identityForgerySignature · test_ed25519_verify_rejects_small_order_public_key · test_ed25519_verify_rejects_noncanonical_point_encoding · fillFieldInput · fieldEqual · test_field25519_wide_mul_and_square_properties · test_field25519_inversion_identity · test_hex_encode_decode_roundtrip · test_hex_decode_invalid · test_hkdf_sha384_extract_and_multiblock_expand · test_hkdf_sha384_rejects_oversized_output_before_write · test_hkdf_extract_rfc5869 · test_hkdf_expand_rfc5869 · test_hkdf_rejects_oversized_output_before_write · test_hmac_sha384_rfc4231_case1 · test_hmac_sha1_rfc2202_case2 · test_hmac_sha256_key_data · test_hmac_verify · test_pbkdf2_rfc6070_1 · test_pbkdf2_rfc6070_2 · test_pbkdf2_rejects_zero_iterations_before_write · assertTagEq · test_poly1305_empty · test_poly1305_rfc7539 · test_poly1305_rfc8439_a3 · test_poly1305_streaming_partitions_match_one_shot · test_sha256_empty · test_sha256_abc · test_sha256_snapshot_does_not_finalize_state · test_sha384_empty · test_sha384_abc · test_sha384_snapshot_does_not_finalize_state · test_sha512_empty · test_sha512_abc · test_sha512_check · xSpan · test_x25519_rfc7748 · test_x25519_basepoint_bob · test_safe_x25519_agreement · test_safe_x25519_rejects_non_contributory_peer · test_x25519_caller_owned_to_api_is_allocation_free_and_exact · test_x25519_to_api_rejects_alias_and_zeroes_low_order_output
Constants: MASK32 · MASK64 · ARGON2D_VARIANT · ARGON2I_VARIANT · ARGON2ID_VARIANT · ARGON2_VERSION_13 · ARGON2_BLOCK_BYTES · K256 · shiftLe · shiftBe
Constants
MASK32
📄
argon2id.vxL7-7
const MASK32: u64=0xffffffff;MASK64
📄
argon2id.vxL8-8
const MASK64: u64=0xffffffffffffffff;ARGON2D_VARIANT
📄
argon2id.vxL215-215
const ARGON2D_VARIANT: u8=0;ARGON2I_VARIANT
📄
argon2id.vxL216-216
const ARGON2I_VARIANT: u8=1;ARGON2ID_VARIANT
📄
argon2id.vxL217-217
const ARGON2ID_VARIANT: u8=2;ARGON2_VERSION_13
📄
argon2id.vxL218-218
const ARGON2_VERSION_13: u64=0x13;ARGON2_BLOCK_BYTES
📄
argon2id.vxL219-219
const ARGON2_BLOCK_BYTES: i64=1024;K256
📄
sha256.vxL8-25
const K256: [u32; 64]=[
0x428a2f98 as u32, 0x71374491 as u32, 0xb5c0fbcf as u32, 0xe9b5dba5 as u32,
0x3956c25b as u32, 0x59f111f1 as u32, 0x923f82a4 as u32, 0xab1c5ed5 as u32,
0xd807aa98 as u32, 0x12835b01 as u32, 0x243185be as u32, 0x550c7dc3 as u32,
0x72be5d74 as u32, 0x80deb1fe as u32, 0x9bdc06a7 as u32, 0xc19bf174 as u32,
0xe49b69c1 as u32, 0xefbe4786 as u32, 0x0fc19dc6 as u32, 0x240ca1cc as u32,
0x2de92c6f as u32, 0x4a7484aa as u32, 0x5cb0a9dc as u32, 0x76f988da as u32,
0x983e5152 as u32, 0xa831c66d as u32, 0xb00327c8 as u32, 0xbf597fc7 as u32,
0xc6e00bf3 as u32, 0xd5a79147 as u32, 0x06ca6351 as u32, 0x14292967 as u32,
0x27b70a85 as u32, 0x2e1b2138 as u32, 0x4d2c6dfc as u32, 0x53380d13 as u32,
0x650a7354 as u32, 0x766a0abb as u32, 0x81c2c92e as u32, 0x92722c85 as u32,
0xa2bfe8a1 as u32, 0xa81a664b as u32, 0xc24b8b70 as u32, 0xc76c51a3 as u32,
0xd192e819 as u32, 0xd6990624 as u32, 0xf40e3585 as u32, 0x106aa070 as u32,
0x19a4c116 as u32, 0x1e376c08 as u32, 0x2748774c as u32, 0x34b0bcb5 as u32,
0x391c0cb3 as u32, 0x4ed8aa4a as u32, 0x5b9cca4f as u32, 0x682e6ff3 as u32,
0x748f82ee as u32, 0x78a5636f as u32, 0x84c87814 as u32, 0x8cc70208 as u32,
0x90befffa as u32, 0xa4506ceb as u32, 0xbef9a3f7 as u32, 0xc67178f2 as u32,
];shiftLe
📄
utils.vxL2-2
const shiftLe: [u8;8]=[0,8,16,24,32,40,48,56];shiftBe
📄
utils.vxL3-3
const shiftBe: [u8;8]=[56,48,40,32,24,16,8,0];Contracts
Digest32
📄
contracts.vxL48-53
export contract Digest32 {
reset()!;
update(data: str)!;
updateRaw(data: RawBuf, len: u64)!;
sum(out: Ptr<u8>, out_len: u64)!;
}Methods:
| Method | Signature | Description |
|---|---|---|
reset↗ | reset()!; | |
update↗ | update(data: str)!; | |
updateRaw↗ | updateRaw(data: RawBuf, len: u64)!; | |
sum↗ | sum(out: Ptr<u8>, out_len: u64)!; |
Mac32
📄
contracts.vxL55-60
export contract Mac32 {
reset()!;
update(data: str)!;
updateRaw(data: RawBuf, len: u64)!;
final(out: Ptr<u8>, out_len: u64)!;
}Methods:
| Method | Signature | Description |
|---|---|---|
reset↗ | reset()!; | |
update↗ | update(data: str)!; | |
updateRaw↗ | updateRaw(data: RawBuf, len: u64)!; | |
final↗ | final(out: Ptr<u8>, out_len: u64)!; |
Structs
ChaCha20Poly1305 🔓 export
📄
api.vxL19-19
export struct ChaCha20Poly1305Methods:
| Method | Signature | Description |
|---|---|---|
ChaCha20Poly1305.sealDetachedInto↗ | export fn ChaCha20Poly1305.sealDetachedInto(key: Span<u8>, nonce: Span<u8>, aad: Span<u8>, plaintext: Span<u8>, output: &Vec<u8>!): Result<[u8; 16], CryptoError> | Encrypt into caller-reusable storage and return a detached 128-bit tag. |
ChaCha20Poly1305.openDetachedInto↗ | export fn ChaCha20Poly1305.openDetachedInto(key: Span<u8>, nonce: Span<u8>, aad: Span<u8>, ciphertext: Span<u8>, tag: Span<u8>, output: &Vec<u8>!): Result<usize, CryptoError> | Authenticate before releasing plaintext into caller-reusable storage. |
ChaCha20Poly1305.sealInto↗ | export fn ChaCha20Poly1305.sealInto(key: Span<u8>, nonce: Span<u8>, aad: Span<u8>, plaintext: Span<u8>, output: &Vec<u8>!): Result<usize, CryptoError> | Encrypt to the conventional ciphertext || tag representation. |
ChaCha20Poly1305.openInto↗ | export fn ChaCha20Poly1305.openInto(key: Span<u8>, nonce: Span<u8>, aad: Span<u8>, sealed: Span<u8>, output: &Vec<u8>!): Result<usize, CryptoError> | Open a conventional ciphertext || tag value. |
ChaCha20Poly1305.seal↗ | export fn ChaCha20Poly1305.seal(key: Span<u8>, nonce: Span<u8>, aad: Span<u8>, plaintext: Span<u8>): Result<Vec<u8>, CryptoError> | |
ChaCha20Poly1305.open↗ | export fn ChaCha20Poly1305.open(key: Span<u8>, nonce: Span<u8>, aad: Span<u8>, sealed: Span<u8>): Result<Vec<u8>, CryptoError> |
Aes128Gcm 🔓 export
📄
api.vxL20-20
export struct Aes128GcmMethods:
| Method | Signature | Description |
|---|---|---|
Aes128Gcm.sealDetachedInto↗ | export fn Aes128Gcm.sealDetachedInto(key: Span<u8>, nonce: Span<u8>, aad: Span<u8>, plaintext: Span<u8>, output: &Vec<u8>!): Result<[u8; 16], CryptoError> | AES-128-GCM detached encryption for protocols such as TLS 1.3. |
Aes128Gcm.openDetachedInto↗ | export fn Aes128Gcm.openDetachedInto(key: Span<u8>, nonce: Span<u8>, aad: Span<u8>, ciphertext: Span<u8>, tag: Span<u8>, output: &Vec<u8>!): Result<usize, CryptoError> | |
Aes128Gcm.sealInto↗ | export fn Aes128Gcm.sealInto(key: Span<u8>, nonce: Span<u8>, aad: Span<u8>, plaintext: Span<u8>, output: &Vec<u8>!): Result<usize, CryptoError> | |
Aes128Gcm.openInto↗ | export fn Aes128Gcm.openInto(key: Span<u8>, nonce: Span<u8>, aad: Span<u8>, sealed: Span<u8>, output: &Vec<u8>!): Result<usize, CryptoError> | |
Aes128Gcm.seal↗ | export fn Aes128Gcm.seal(key: Span<u8>, nonce: Span<u8>, aad: Span<u8>, plaintext: Span<u8>): Result<Vec<u8>, CryptoError> | |
Aes128Gcm.open↗ | export fn Aes128Gcm.open(key: Span<u8>, nonce: Span<u8>, aad: Span<u8>, sealed: Span<u8>): Result<Vec<u8>, CryptoError> |
Aes256Gcm 🔓 export
📄
api.vxL21-21
export struct Aes256GcmMethods:
| Method | Signature | Description |
|---|---|---|
Aes256Gcm.sealDetachedInto↗ | export fn Aes256Gcm.sealDetachedInto(key: Span<u8>, nonce: Span<u8>, aad: Span<u8>, plaintext: Span<u8>, output: &Vec<u8>!): Result<[u8; 16], CryptoError> | AES-256-GCM detached encryption with the checked/reusable contract. |
Aes256Gcm.openDetachedInto↗ | export fn Aes256Gcm.openDetachedInto(key: Span<u8>, nonce: Span<u8>, aad: Span<u8>, ciphertext: Span<u8>, tag: Span<u8>, output: &Vec<u8>!): Result<usize, CryptoError> | |
Aes256Gcm.sealInto↗ | export fn Aes256Gcm.sealInto(key: Span<u8>, nonce: Span<u8>, aad: Span<u8>, plaintext: Span<u8>, output: &Vec<u8>!): Result<usize, CryptoError> | |
Aes256Gcm.openInto↗ | export fn Aes256Gcm.openInto(key: Span<u8>, nonce: Span<u8>, aad: Span<u8>, sealed: Span<u8>, output: &Vec<u8>!): Result<usize, CryptoError> | |
Aes256Gcm.seal↗ | export fn Aes256Gcm.seal(key: Span<u8>, nonce: Span<u8>, aad: Span<u8>, plaintext: Span<u8>): Result<Vec<u8>, CryptoError> | |
Aes256Gcm.open↗ | export fn Aes256Gcm.open(key: Span<u8>, nonce: Span<u8>, aad: Span<u8>, sealed: Span<u8>): Result<Vec<u8>, CryptoError> |
HkdfSha256 🔓 export
📄
api.vxL22-22
export struct HkdfSha256Methods:
| Method | Signature | Description |
|---|---|---|
HkdfSha256.extract↗ | export fn HkdfSha256.extract(salt: Span<u8>, inputKeyMaterial: Span<u8>): Result<[u8; 32], CryptoError> | Extract a fixed 32-byte pseudorandom key without exposing raw pointers. |
HkdfSha256.expandInto↗ | export fn HkdfSha256.expandInto(prk: Span<u8>, info: Span<u8>, outputLength: usize, output: &Vec<u8>!): Result<usize, CryptoError> | Expand a 32-byte PRK into caller-reusable storage. RFC 5869's 8160-byte |
HkdfSha256.deriveInto↗ | export fn HkdfSha256.deriveInto(salt: Span<u8>, inputKeyMaterial: Span<u8>, info: Span<u8>, outputLength: usize, output: &Vec<u8>!): Result<usize, CryptoError> | One-shot HKDF-SHA256 derivation into caller-reusable storage. |
HkdfSha256.derive↗ | export fn HkdfSha256.derive(salt: Span<u8>, inputKeyMaterial: Span<u8>, info: Span<u8>, outputLength: usize): Result<Vec<u8>, CryptoError> |
HkdfSha384 🔓 export
📄
api.vxL23-23
export struct HkdfSha384Methods:
| Method | Signature | Description |
|---|---|---|
HkdfSha384.extract↗ | export fn HkdfSha384.extract(salt: Span<u8>, inputKeyMaterial: Span<u8>): Result<[u8; 48], CryptoError> | Extract a fixed 48-byte SHA-384 pseudorandom key through safe spans. |
HkdfSha384.expandInto↗ | export fn HkdfSha384.expandInto(prk: Span<u8>, info: Span<u8>, outputLength: usize, output: &Vec<u8>!): Result<usize, CryptoError> | Expand a 48-byte PRK into caller-reusable storage. RFC 5869's 12240-byte |
HkdfSha384.deriveInto↗ | export fn HkdfSha384.deriveInto(salt: Span<u8>, inputKeyMaterial: Span<u8>, info: Span<u8>, outputLength: usize, output: &Vec<u8>!): Result<usize, CryptoError> | |
HkdfSha384.derive↗ | export fn HkdfSha384.derive(salt: Span<u8>, inputKeyMaterial: Span<u8>, info: Span<u8>, outputLength: usize): Result<Vec<u8>, CryptoError> |
Pbkdf2Sha256 🔓 export
📄
api.vxL24-24
export struct Pbkdf2Sha256Methods:
| Method | Signature | Description |
|---|---|---|
Pbkdf2Sha256.deriveInto↗ | export fn Pbkdf2Sha256.deriveInto(password: Span<u8>, salt: Span<u8>, iterations: u64, outputLength: usize, output: &Vec<u8>!): Result<usize, CryptoError> | PBKDF2-HMAC-SHA256 into reusable storage. Iteration count and RFC output |
Pbkdf2Sha256.derive↗ | export fn Pbkdf2Sha256.derive(password: Span<u8>, salt: Span<u8>, iterations: u64, outputLength: usize): Result<Vec<u8>, CryptoError> |
X25519 🔓 export
📄
api.vxL25-25
export struct X25519Methods:
| Method | Signature | Description |
|---|---|---|
X25519.publicKeyTo↗ | export fn X25519.publicKeyTo(privateKey: Span<u8>, output: &Span<u8>!): Result<usize, CryptoError> | Derive an X25519 public key from an exact 32-byte private scalar. |
X25519.publicKeyInto↗ | export fn X25519.publicKeyInto(privateKey: Span<u8>, output: &Vec<u8>!): Result<usize, CryptoError> | Derive an X25519 public key into reusable owned storage. |
X25519.publicKey↗ | export fn X25519.publicKey(privateKey: Span<u8>): Result<[u8; 32], CryptoError> | |
X25519.sharedSecretTo↗ | export fn X25519.sharedSecretTo(privateKey: Span<u8>, peerPublicKey: Span<u8>, output: &Span<u8>!): Result<usize, CryptoError> | Compute a contributory X25519 shared secret. RFC 7748 permits callers to |
X25519.sharedSecretInto↗ | export fn X25519.sharedSecretInto(privateKey: Span<u8>, peerPublicKey: Span<u8>, output: &Vec<u8>!): Result<usize, CryptoError> | Compute a contributory X25519 shared secret into reusable owned storage. |
X25519.sharedSecret↗ | export fn X25519.sharedSecret(privateKey: Span<u8>, peerPublicKey: Span<u8>): Result<[u8; 32], CryptoError> |
Ed25519 🔓 export
📄
api.vxL26-26
export struct Ed25519Methods:
| Method | Signature | Description |
|---|---|---|
Ed25519.publicKey↗ | export fn Ed25519.publicKey(privateSeed: Span<u8>): Result<[u8; 32], CryptoError> | Derive the RFC 8032 public key for an exact 32-byte private seed. |
Ed25519.signInto↗ | export fn Ed25519.signInto(privateSeed: Span<u8>, message: Span<u8>, output: &Vec<u8>!): Result<usize, CryptoError> | Deterministically sign a message into caller-reusable storage. The private |
Ed25519.sign↗ | export fn Ed25519.sign(privateSeed: Span<u8>, message: Span<u8>): Result<[u8; 64], CryptoError> | |
Ed25519.verify↗ | export fn Ed25519.verify(publicKey: Span<u8>, message: Span<u8>, signature: Span<u8>): Result<bool, CryptoError> | Strict verification: canonical encodings, canonical S, and non-small-order |
Argon2Parameters 🔓 export
📄
argon2id.vxL755-760
export struct Argon2ParametersPublic Argon2 cost policy. Memory is expressed in KiB, matching RFC 9106.
Implements: Copy
Fields:
| Name | Type | Access |
|---|---|---|
timeCost | u64 | 🔓 public |
memoryKiB | u64 | 🔓 public |
parallelism | u64 | 🔓 public |
Methods:
| Method | Signature | Description |
|---|---|---|
Argon2Parameters.new↗ | export fn Argon2Parameters.new(timeCost: u64, memoryKiB: u64, parallelism: u64): Argon2Parameters | |
Argon2Parameters.recommended↗ | export fn Argon2Parameters.recommended(): Argon2Parameters | RFC 9106's memory-constrained recommendation: 64 MiB, three passes and |
Argon2id 🔓 export
📄
argon2id.vxL783-783
export struct Argon2idType-safe Argon2id facade. RawBuf kernels remain available for protocol
implementations, while application code should use this Span/Vec surface.
Methods:
| Method | Signature | Description |
|---|---|---|
Argon2id.deriveInto↗ | export fn Argon2id.deriveInto(password: Span<u8>, salt: Span<u8>, parameters: Argon2Parameters, outputLength: usize, output: &Vec<u8>!): Result<usize, CryptoError> | Derive into caller-reusable storage. Input/output aliases are staged before |
Argon2id.deriveExInto↗ | export fn Argon2id.deriveExInto(password: Span<u8>, salt: Span<u8>, secret: Span<u8>, associatedData: Span<u8>, parameters: Argon2Parameters, outputLength: usize, output: &Vec<u8>!): Result<usize, CryptoError> | RFC 9106 extended derivation with an optional secret (pepper) and |
Argon2id.derive↗ | export fn Argon2id.derive(password: Span<u8>, salt: Span<u8>, parameters: Argon2Parameters, outputLength: usize): Result<Vec<u8>, CryptoError> | |
Argon2id.deriveEx↗ | export fn Argon2id.deriveEx(password: Span<u8>, salt: Span<u8>, secret: Span<u8>, associatedData: Span<u8>, parameters: Argon2Parameters, outputLength: usize): Result<Vec<u8>, CryptoError> |
CryptoError 🔓 export
📄
contracts.vxL18-23
export struct CryptoErrorAllocation-free cryptographic operation failure. requested and limit
are byte counts unless the operation documents another unit.
Implements: Copy
Fields:
| Name | Type | Access |
|---|---|---|
kind | CryptoErrorKind | 🔓 public |
requested | u64 | 🔓 public |
limit | u64 | 🔓 public |
Methods:
| Method | Signature | Description |
|---|---|---|
CryptoError.new↗ | export fn CryptoError.new(kind: CryptoErrorKind, requested: u64, limit: u64): CryptoError | |
message↗ | export fn (self: &CryptoError) message(): str |
ExtPoint
📄
ed25519.vxL12-18
struct ExtPointImplements: Copy
Fields:
| Name | Type | Access |
|---|---|---|
x | Fe25519 | 🔓 public |
y | Fe25519 | 🔓 public |
z | Fe25519 | 🔓 public |
t | Fe25519 | 🔓 public |
AffPoint
📄
ed25519.vxL52-56
struct AffPointFields:
| Name | Type | Access |
|---|---|---|
x | Fe25519 | 🔓 public |
y | Fe25519 | 🔓 public |
Fe25519 🔓 export
📄
field25519.vxL10-13
export struct Fe25519Field element in 5x51-bit limbs
Implements: Copy
Fields:
| Name | Type | Access |
|---|---|---|
l | [u64; 5] | 🔓 public |
Poly1305 🔓 export
📄
poly1305.vxL10-18
export struct Poly1305Fields:
| Name | Type | Access |
|---|---|---|
r | [u32; 5] | 🔒 private |
rs | [u32; 4] | 🔒 private |
h | [u32; 5] | 🔒 private |
pad | [u32; 4] | 🔒 private |
buf | [u8; 16] | 🔒 private |
buf_len | usize | 🔒 private |
finalized | bool | 🔒 private |
Methods:
| Method | Signature | Description |
|---|---|---|
Poly1305.new↗ | export fn Poly1305.new(key: RawBuf, key_len: usize): Poly1305 | |
update↗ | export fn (self: &Poly1305!) update(data: RawBuf, len: usize) | |
processBufferedBlock↗ | fn (self: &Poly1305!) processBufferedBlock(hibit: u32) | |
processDataBlock↗ | fn (self: &Poly1305!) processDataBlock(data: RawBuf, offset: usize) | |
processWords↗ | fn (self: &Poly1305!) processWords(t0: u32, t1: u32, t2: u32, t3: u32, hibit: u32) | |
finalize↗ | export fn (self: &Poly1305!) finalize(): [u8; 16] |
Sha1 🔓 export
📄
sha1.vxL7-12
export struct Sha1Fields:
| Name | Type | Access |
|---|---|---|
h | [u32; 5] | 🔒 private |
buf | [u8; 64] | 🔒 private |
bufLen | u64 | 🔒 private |
totalLen | u64 | 🔒 private |
Methods:
| Method | Signature | Description |
|---|---|---|
Sha1.new↗ | export fn Sha1.new(): Sha1 | |
processBlock↗ | fn (self: &Sha1!) processBlock(block: RawBuf) | |
reset↗ | export fn (self: &Sha1!) reset()! | |
update↗ | export fn (self: &Sha1!) update(data: str) | |
updateRaw↗ | export fn (self: &Sha1!) updateRaw(data: RawBuf, len: u64) | |
sum↗ | export fn (self: &Sha1!) sum(out: Ptr<u8>, out_len: u64)! |
Sha256 🔓 export
📄
sha256.vxL34-39
export struct Sha256Fields:
| Name | Type | Access |
|---|---|---|
h | [u32; 8] | 🔒 private |
buf | [u8; 64] | 🔒 private |
bufLen | u64 | 🔒 private |
totalLen | u64 | 🔒 private |
Methods:
| Method | Signature | Description |
|---|---|---|
Sha256.new↗ | export fn Sha256.new(): Sha256 | |
processBlock↗ | fn (self: &Sha256!) processBlock(block: RawBuf, offset: usize) | |
reset↗ | export fn (self: &Sha256!) reset()! | |
update↗ | export fn (self: &Sha256!) update(data: str) | |
updateRaw↗ | export fn (self: &Sha256!) updateRaw(data: RawBuf, len: u64) | |
sum↗ | export fn (self: &Sha256!) sum(out: Ptr<u8>, out_len: u64)! | |
snapshotTo↗ | export fn (self: &Sha256) snapshotTo(out: Ptr<u8>, outLen: u64): bool | Writes the digest of the current state without consuming or finalizing it. |
Sha512 🔓 export
📄
sha512.vxL65-71
export struct Sha512Fields:
| Name | Type | Access |
|---|---|---|
h | [u64; 8] | 🔓 public |
buf | [u8; 128] | 🔓 public |
bufLen | u64 | 🔓 public |
totalLen | u64 | 🔓 public |
Methods:
| Method | Signature | Description |
|---|---|---|
Sha512.new↗ | export fn Sha512.new(): Sha512 | |
init↗ | export fn (self: &Sha512!) init() | |
init384↗ | fn (self: &Sha512!) init384() | |
processBlock512↗ | fn (self: &Sha512!) processBlock512(block: RawBuf, offset: usize) | |
update512↗ | export fn (self: &Sha512!) update512(data: str) | |
updateRaw512↗ | export fn (self: &Sha512!) updateRaw512(data: RawBuf, len: u64) | |
sum512Family↗ | fn (self: &Sha512!) sum512Family(out: Ptr<u8>, outLen: u64, digestLen: u64) | |
sum512↗ | export fn (self: &Sha512!) sum512(out: Ptr<u8>, outLen: u64) |
Sha384 🔓 export
📄
sha512.vxL77-79
export struct Sha384SHA-384 shares SHA-512's compression function and block size, but uses
the independent FIPS 180-4 initial state and truncates the digest to 48 bytes. Keeping a single Sha512 engine avoids a second cryptographic kernel drifting away from the standard.
Fields:
| Name | Type | Access |
|---|---|---|
state | Sha512 | 🔒 private |
Methods:
| Method | Signature | Description |
|---|---|---|
Sha384.new↗ | export fn Sha384.new(): Sha384 | |
update384↗ | export fn (self: &Sha384!) update384(data: str) | |
updateRaw384↗ | export fn (self: &Sha384!) updateRaw384(data: RawBuf, len: u64) | |
sum384↗ | export fn (self: &Sha384!) sum384(out: Ptr<u8>, outLen: u64) | |
reset384↗ | export fn (self: &Sha384!) reset384() | Resets a SHA-384 state to its FIPS 180-4 initial value. |
snapshotTo↗ | export fn (self: &Sha384) snapshotTo(out: Ptr<u8>, outLen: u64): bool | Writes the digest of the current state without consuming or finalizing it. |
Enums
CryptoErrorKind 🔓 export
📄
contracts.vxL3-14
export enum CryptoErrorKindVariants:
InvalidKeyLengthInvalidNonceLengthInvalidTagLengthInvalidSignatureLengthMessageTooLargeCounterExhaustedAuthenticationFailedInvalidPublicKeyInvalidParameterOutOfMemory
Functions
computeAeadTag
📄
aead.vxL10-46
fn computeAeadTag(otkBuf: RawBuf, aad: RawBuf, aadLen: u64, ct: RawBuf, ctLen: u64): [u8; 16]Parameters:
| Name | Type |
|---|---|
otkBuf | RawBuf |
aad | RawBuf |
aadLen | u64 |
ct | RawBuf |
ctLen | u64 |
Returns: [u8; 16]
aeadEncrypt 🔓 export
📄
aead.vxL52-81
export fn aeadEncrypt(key: RawBuf, nonce: RawBuf, aad: RawBuf, aadLen: u64, plaintext: RawBuf, ptLen: u64, out: RawBuf): Result<[u8; 16], CryptoError>Encrypt with ChaCha20-Poly1305 AEAD (RFC 8439).
key: 32 bytes, nonce: 12 bytes. Writes ciphertext to out (same length as plaintext). Returns 16-byte authentication tag.
Parameters:
| Name | Type |
|---|---|
key | RawBuf |
nonce | RawBuf |
aad | RawBuf |
aadLen | u64 |
plaintext | RawBuf |
ptLen | u64 |
out | RawBuf |
Returns: Result<[u8; 16], CryptoError>
aeadDecrypt 🔓 export
📄
aead.vxL87-123
export fn aeadDecrypt(key: RawBuf, nonce: RawBuf, aad: RawBuf, aadLen: u64, ciphertext: RawBuf, ctLen: u64, tag: RawBuf, out: RawBuf): Result<(), CryptoError>Decrypt with ChaCha20-Poly1305 AEAD (RFC 8439).
key: 32 bytes, nonce: 12 bytes. Returns Ok(()) after authentication and decryption, or a typed CryptoError. Authentication failure clears ctLen output bytes. The early oversized-AAD error returns before touching output; do not infer that every error clears it. This raw API cannot validate allocation extents: callers must supply the exact readable/writable byte ranges below and uphold aliasing requirements. Prefer the checked ChaCha20Poly1305 facade for application records.
Parameters:
| Name | Type | Description |
|---|---|---|
key | RawBuf | 32 readable key bytes |
nonce | RawBuf | 12 readable nonce bytes; unique per key/encryption |
aad | RawBuf | aadLen readable associated-data bytes |
aadLen | u64 | Associated-data length in bytes |
ciphertext | RawBuf | ctLen readable ciphertext bytes |
ctLen | u64 | Ciphertext/output length in bytes; excludes the tag |
tag | RawBuf | 16 readable authentication-tag bytes |
out | RawBuf | At least ctLen writable bytes |
Returns: Result<(), CryptoError>
xtime
📄
aes.vxL5-8
fn xtime(x: u8): u8Parameters:
| Name | Type |
|---|---|
x | u8 |
Returns: u8
gfMul8
📄
aes.vxL10-24
fn gfMul8(a: u8, b: u8): u8Parameters:
| Name | Type |
|---|---|
a | u8 |
b | u8 |
Returns: u8
gfPow8
📄
aes.vxL26-39
fn gfPow8(a: u8, exp: u32): u8Parameters:
| Name | Type |
|---|---|
a | u8 |
exp | u32 |
Returns: u8
rotl8
📄
aes.vxL41-43
fn rotl8(x: u8, n: u8): u8Parameters:
| Name | Type |
|---|---|
x | u8 |
n | u8 |
Returns: u8
sboxByte
📄
aes.vxL45-50
fn sboxByte(x: u8): u8Parameters:
| Name | Type |
|---|---|
x | u8 |
Returns: u8
rconAt
📄
aes.vxL52-60
fn rconAt(iter: i64): u8Parameters:
| Name | Type |
|---|---|
iter | i64 |
Returns: u8
aes256ExpandKey 🔓 export
📄
aes.vxL64-113
export fn aes256ExpandKey(key: RawBuf): [u8; 240]Expand an AES-256 key once for internal multi-block constructions.
Callers must securely erase the returned 240-byte schedule.
Parameters:
| Name | Type |
|---|---|
key | RawBuf |
Returns: [u8; 240]
aes128ExpandKey 🔓 export
📄
aes.vxL120-157
export fn aes128ExpandKey(key: RawBuf): [u8; 176]Expand an AES-128 key once for internal multi-block constructions.
Callers must securely erase the returned 176-byte schedule.
Parameters:
| Name | Type |
|---|---|
key | RawBuf |
Returns: [u8; 176]
aesEncryptBlockWithRk
📄
aes.vxL159-173
fn aesEncryptBlockWithRk(rkb: RawBuf, input: RawBuf, out: RawBuf, rounds: i64)Parameters:
| Name | Type |
|---|---|
rkb | RawBuf |
input | RawBuf |
out | RawBuf |
rounds | i64 |
aes128EncryptBlockWithRk 🔓 export
📄
aes.vxL175-177
export fn aes128EncryptBlockWithRk(rkb: RawBuf, input: RawBuf, out: RawBuf)Parameters:
| Name | Type |
|---|---|
rkb | RawBuf |
input | RawBuf |
out | RawBuf |
aes128EncryptBlock 🔓 export
📄
aes.vxL181-186
export fn aes128EncryptBlock(key: RawBuf, input: RawBuf, out: RawBuf)AES-128 encrypt one 16-byte block.
key: 16 bytes, input: 16 bytes.
Parameters:
| Name | Type |
|---|---|
key | RawBuf |
input | RawBuf |
out | RawBuf |
aes256EncryptBlockWithRk 🔓 export
📄
aes.vxL188-190
export fn aes256EncryptBlockWithRk(rkb: RawBuf, input: RawBuf, out: RawBuf)Parameters:
| Name | Type |
|---|---|
rkb | RawBuf |
input | RawBuf |
out | RawBuf |
aes256EncryptBlock 🔓 export
📄
aes.vxL194-199
export fn aes256EncryptBlock(key: RawBuf, input: RawBuf, out: RawBuf)AES-256 encrypt one 16-byte block.
key: 32 bytes, input: 16 bytes.
Parameters:
| Name | Type |
|---|---|
key | RawBuf |
input | RawBuf |
out | RawBuf |
counter32be
📄
aes.vxL201-206
fn counter32be(counterBlock: RawBuf): u32Parameters:
| Name | Type |
|---|---|
counterBlock | RawBuf |
Returns: u32
inc32be
📄
aes.vxL208-221
fn inc32be(counterBlock: RawBuf)Parameters:
| Name | Type |
|---|---|
counterBlock | RawBuf |
validateIncrementingCtrRequest
📄
aes.vxL223-243
fn validateIncrementingCtrRequest(counter0: RawBuf, len: u64): Result<(), CryptoError>Parameters:
| Name | Type |
|---|---|
counter0 | RawBuf |
len | u64 |
Returns: Result<(), CryptoError>
validateInitialCtrRequest
📄
aes.vxL248-266
fn validateInitialCtrRequest(counter0: RawBuf, len: u64): Result<(), CryptoError>Validate the variant whose supplied counter is encrypted before it is
incremented. This is distinct from the GCM/J0 helpers above: an initial value of u32::MAX still permits exactly one 16-byte block.
Parameters:
| Name | Type |
|---|---|
counter0 | RawBuf |
len | u64 |
Returns: Result<(), CryptoError>
aes256CtrXorWithRk 🔓 export
📄
aes.vxL269-322
export fn aes256CtrXorWithRk(rkb: RawBuf, counter0: RawBuf, input: RawBuf, len: u64, out: RawBuf): Result<(), CryptoError>AES-256 CTR using a caller-owned expanded schedule.
Parameters:
| Name | Type |
|---|---|
rkb | RawBuf |
counter0 | RawBuf |
input | RawBuf |
len | u64 |
out | RawBuf |
Returns: Result<(), CryptoError>
aes256CtrXor 🔓 export
📄
aes.vxL326-338
export fn aes256CtrXor(key: RawBuf, counter0: RawBuf, input: RawBuf, len: u64, out: RawBuf): Result<(), CryptoError>AES-256 CTR XOR helper (counter block is 16-byte J0-like block).
Uses inc32 in big-endian per GCM convention.
Parameters:
| Name | Type |
|---|---|
key | RawBuf |
counter0 | RawBuf |
input | RawBuf |
len | u64 |
out | RawBuf |
Returns: Result<(), CryptoError>
aes128CtrXorWithRk 🔓 export
📄
aes.vxL343-383
export fn aes128CtrXorWithRk(rkb: RawBuf, counter0: RawBuf, input: RawBuf, len: u64, out: RawBuf): Result<(), CryptoError>AES-128 CTR XOR helper (counter block is a 16-byte J0-like block).
Like AES-GCM's CTR construction, the supplied block is incremented before it is encrypted for the first segment.
Parameters:
| Name | Type |
|---|---|
rkb | RawBuf |
counter0 | RawBuf |
input | RawBuf |
len | u64 |
out | RawBuf |
Returns: Result<(), CryptoError>
aes128CtrXor 🔓 export
📄
aes.vxL385-393
export fn aes128CtrXor(key: RawBuf, counter0: RawBuf, input: RawBuf, len: u64, out: RawBuf): Result<(), CryptoError>Parameters:
| Name | Type |
|---|---|
key | RawBuf |
counter0 | RawBuf |
input | RawBuf |
len | u64 |
out | RawBuf |
Returns: Result<(), CryptoError>
aes128CtrXorFromInitialCounter 🔓 export
📄
aes.vxL398-441
export fn aes128CtrXorFromInitialCounter(key: RawBuf, counter0: RawBuf, input: RawBuf, len: u64, out: RawBuf)Parameters:
| Name | Type |
|---|---|
key | RawBuf |
counter0 | RawBuf |
input | RawBuf |
len | u64 |
out | RawBuf |
reverseBits64
📄
aes_gcm.vxL9-17
fn reverseBits64(value: u64): u64Parameters:
| Name | Type |
|---|---|
value | u64 |
Returns: u64
ghashMulReflected
📄
aes_gcm.vxL19-42
fn ghashMulReflected(xLo: u64, xHi: u64, hLo: u64, hHi: u64): [u64; 2]Parameters:
| Name | Type |
|---|---|
xLo | u64 |
xHi | u64 |
hLo | u64 |
hHi | u64 |
Returns: [u64; 2]
ghashUpdateReflected
📄
aes_gcm.vxL44-55
fn ghashUpdateReflected(yLo: u64, yHi: u64, hLo: u64, hHi: u64, block: RawBuf): [u64; 2]Parameters:
| Name | Type |
|---|---|
yLo | u64 |
yHi | u64 |
hLo | u64 |
hHi | u64 |
block | RawBuf |
Returns: [u64; 2]
ghashBlockReflected
📄
aes_gcm.vxL57-62
fn ghashBlockReflected(block: RawBuf): [u64; 2]Parameters:
| Name | Type |
|---|---|
block | RawBuf |
Returns: [u64; 2]
ghashUpdateFourReflected
📄
aes_gcm.vxL64-93
fn ghashUpdateFourReflected(yLo: u64, yHi: u64, hLo: u64, hHi: u64, h2Lo: u64, h2Hi: u64, h3Lo: u64, h3Hi: u64, h4Lo: u64, h4Hi: u64, blocks: RawBuf): [u64; 2]Parameters:
| Name | Type |
|---|---|
yLo | u64 |
yHi | u64 |
hLo | u64 |
hHi | u64 |
h2Lo | u64 |
h2Hi | u64 |
h3Lo | u64 |
h3Hi | u64 |
h4Lo | u64 |
h4Hi | u64 |
blocks | RawBuf |
Returns: [u64; 2]
ghashAll
📄
aes_gcm.vxL95-206
fn ghashAll(h: RawBuf, aad: RawBuf, aadLen: u64, ct: RawBuf, ctLen: u64): [u8; 16]Parameters:
| Name | Type |
|---|---|
h | RawBuf |
aad | RawBuf |
aadLen | u64 |
ct | RawBuf |
ctLen | u64 |
Returns: [u8; 16]
encryptBlockWithSchedule
📄
aes_gcm.vxL208-216
fn encryptBlockWithSchedule(keyBytes: usize, roundKeys: RawBuf, input: RawBuf, output: RawBuf)Parameters:
| Name | Type |
|---|---|
keyBytes | usize |
roundKeys | RawBuf |
input | RawBuf |
output | RawBuf |
ctrXorWithSchedule
📄
aes_gcm.vxL218-230
fn ctrXorWithSchedule(keyBytes: usize, roundKeys: RawBuf, counter: RawBuf, input: RawBuf, length: u64, output: RawBuf): Result<(), CryptoError>Parameters:
| Name | Type |
|---|---|
keyBytes | usize |
roundKeys | RawBuf |
counter | RawBuf |
input | RawBuf |
length | u64 |
output | RawBuf |
Returns: Result<(), CryptoError>
validateGcmLengths
📄
aes_gcm.vxL232-261
fn validateGcmLengths(aadLen: u64, textLen: u64): Result<(), CryptoError>Parameters:
| Name | Type |
|---|---|
aadLen | u64 |
textLen | u64 |
Returns: Result<(), CryptoError>
gcmEncryptWithSchedule
📄
aes_gcm.vxL263-323
fn gcmEncryptWithSchedule(keyBytes: usize, roundKeys: RawBuf, nonce12: RawBuf, aad: RawBuf, aadLen: u64, plaintext: RawBuf, ptLen: u64, out: RawBuf): Result<[u8; 16], CryptoError>Parameters:
| Name | Type |
|---|---|
keyBytes | usize |
roundKeys | RawBuf |
nonce12 | RawBuf |
aad | RawBuf |
aadLen | u64 |
plaintext | RawBuf |
ptLen | u64 |
out | RawBuf |
Returns: Result<[u8; 16], CryptoError>
gcmDecryptWithSchedule
📄
aes_gcm.vxL325-393
fn gcmDecryptWithSchedule(keyBytes: usize, roundKeys: RawBuf, nonce12: RawBuf, aad: RawBuf, aadLen: u64, ciphertext: RawBuf, ctLen: u64, tag: RawBuf, out: RawBuf): Result<(), CryptoError>Parameters:
| Name | Type |
|---|---|
keyBytes | usize |
roundKeys | RawBuf |
nonce12 | RawBuf |
aad | RawBuf |
aadLen | u64 |
ciphertext | RawBuf |
ctLen | u64 |
tag | RawBuf |
out | RawBuf |
Returns: Result<(), CryptoError>
aes128GcmEncrypt 🔓 export
📄
aes_gcm.vxL396-409
export fn aes128GcmEncrypt(key: RawBuf, nonce12: RawBuf, aad: RawBuf, aadLen: u64, plaintext: RawBuf, ptLen: u64, out: RawBuf): Result<[u8; 16], CryptoError>AES-128-GCM encrypt with the NIST 96-bit nonce fast path.
Parameters:
| Name | Type |
|---|---|
key | RawBuf |
nonce12 | RawBuf |
aad | RawBuf |
aadLen | u64 |
plaintext | RawBuf |
ptLen | u64 |
out | RawBuf |
Returns: Result<[u8; 16], CryptoError>
aes128GcmDecrypt 🔓 export
📄
aes_gcm.vxL413-427
export fn aes128GcmDecrypt(key: RawBuf, nonce12: RawBuf, aad: RawBuf, aadLen: u64, ciphertext: RawBuf, ctLen: u64, tag: RawBuf, out: RawBuf): Result<(), CryptoError>AES-128-GCM authenticated decryption. Plaintext is released only after the
complete tag has been verified in constant time.
Parameters:
| Name | Type |
|---|---|
key | RawBuf |
nonce12 | RawBuf |
aad | RawBuf |
aadLen | u64 |
ciphertext | RawBuf |
ctLen | u64 |
tag | RawBuf |
out | RawBuf |
Returns: Result<(), CryptoError>
aes256GcmEncrypt 🔓 export
📄
aes_gcm.vxL430-443
export fn aes256GcmEncrypt(key: RawBuf, nonce12: RawBuf, aad: RawBuf, aadLen: u64, plaintext: RawBuf, ptLen: u64, out: RawBuf): Result<[u8; 16], CryptoError>AES-256-GCM encrypt with one key expansion per complete operation.
Parameters:
| Name | Type |
|---|---|
key | RawBuf |
nonce12 | RawBuf |
aad | RawBuf |
aadLen | u64 |
plaintext | RawBuf |
ptLen | u64 |
out | RawBuf |
Returns: Result<[u8; 16], CryptoError>
aes256GcmDecrypt 🔓 export
📄
aes_gcm.vxL445-459
export fn aes256GcmDecrypt(key: RawBuf, nonce12: RawBuf, aad: RawBuf, aadLen: u64, ciphertext: RawBuf, ctLen: u64, tag: RawBuf, out: RawBuf): Result<(), CryptoError>Parameters:
| Name | Type |
|---|---|
key | RawBuf |
nonce12 | RawBuf |
aad | RawBuf |
aadLen | u64 |
ciphertext | RawBuf |
ctLen | u64 |
tag | RawBuf |
out | RawBuf |
Returns: Result<(), CryptoError>
cryptoError
📄
api.vxL28-30
fn cryptoError(kind: CryptoErrorKind, requested: usize, limit: usize): CryptoErrorParameters:
| Name | Type |
|---|---|
kind | CryptoErrorKind |
requested | usize |
limit | usize |
Returns: CryptoError
clearSensitiveOutput
📄
api.vxL32-37
fn clearSensitiveOutput(output: &Vec<u8>!)Parameters:
| Name | Type |
|---|---|
output | &Vec<u8>! |
validateExactLength
📄
api.vxL39-50
fn validateExactLength(actual: usize, expected: usize, kind: CryptoErrorKind, output: &Vec<u8>!): Result<(), CryptoError>Parameters:
| Name | Type |
|---|---|
actual | usize |
expected | usize |
kind | CryptoErrorKind |
output | &Vec<u8>! |
Returns: Result<(), CryptoError>
spansOverlapOutput
📄
api.vxL52-60
fn spansOverlapOutput(source: Span<u8>, output: &Vec<u8>): boolParameters:
| Name | Type |
|---|---|
source | Span<u8> |
output | &Vec<u8> |
Returns: bool
checkedTaggedLength
📄
api.vxL62-68
fn checkedTaggedLength(length: usize, output: &Vec<u8>!): Result<usize, CryptoError>Parameters:
| Name | Type |
|---|---|
length | usize |
output | &Vec<u8>! |
Returns: Result<usize, CryptoError>
prepareDetachedInputs
📄
api.vxL70-89
fn prepareDetachedInputs(key: Span<u8>, nonce: Span<u8>, tag: Span<u8>, output: &Vec<u8>!): Result<(), CryptoError>Parameters:
| Name | Type |
|---|---|
key | Span<u8> |
nonce | Span<u8> |
tag | Span<u8> |
output | &Vec<u8>! |
Returns: Result<(), CryptoError>
aesGcmSealDetachedInto
📄
api.vxL269-328
fn aesGcmSealDetachedInto(keyLength: usize, useAes128: bool, key: Span<u8>, nonce: Span<u8>, aad: Span<u8>, plaintext: Span<u8>, output: &Vec<u8>!): Result<[u8; 16], CryptoError>Parameters:
| Name | Type |
|---|---|
keyLength | usize |
useAes128 | bool |
key | Span<u8> |
nonce | Span<u8> |
aad | Span<u8> |
plaintext | Span<u8> |
output | &Vec<u8>! |
Returns: Result<[u8; 16], CryptoError>
aesGcmOpenDetachedInto
📄
api.vxL330-402
fn aesGcmOpenDetachedInto(keyLength: usize, useAes128: bool, key: Span<u8>, nonce: Span<u8>, aad: Span<u8>, ciphertext: Span<u8>, tag: Span<u8>, output: &Vec<u8>!): Result<usize, CryptoError>Parameters:
| Name | Type |
|---|---|
keyLength | usize |
useAes128 | bool |
key | Span<u8> |
nonce | Span<u8> |
aad | Span<u8> |
ciphertext | Span<u8> |
tag | Span<u8> |
output | &Vec<u8>! |
Returns: Result<usize, CryptoError>
loadLe64
📄
argon2id.vxL10-20
fn loadLe64(buf: RawBuf, off: usize): u64Parameters:
| Name | Type |
|---|---|
buf | RawBuf |
off | usize |
Returns: u64
low32
📄
argon2id.vxL22-24
fn low32(x: u64): u64Parameters:
| Name | Type |
|---|---|
x | u64 |
Returns: u64
rotr64
📄
argon2id.vxL26-28
fn rotr64(x: u64, n: u64): u64Parameters:
| Name | Type |
|---|---|
x | u64 |
n | u64 |
Returns: u64
add64
📄
argon2id.vxL30-32
fn add64(a: u64, b: u64): u64Parameters:
| Name | Type |
|---|---|
a | u64 |
b | u64 |
Returns: u64
blamka
📄
argon2id.vxL34-37
fn blamka(a: u64, b: u64): u64Parameters:
| Name | Type |
|---|---|
a | u64 |
b | u64 |
Returns: u64
storeLe64
📄
argon2id.vxL39-48
fn storeLe64(buf: RawBuf!, off: usize, v: u64)Parameters:
| Name | Type |
|---|---|
buf | RawBuf! |
off | usize |
v | u64 |
storeLe32
📄
argon2id.vxL50-55
fn storeLe32(buf: RawBuf!, off: usize, v: u32)Parameters:
| Name | Type |
|---|---|
buf | RawBuf! |
off | usize |
v | u32 |
roundedMemoryKiB
📄
argon2id.vxL57-60
fn roundedMemoryKiB(memoryKiB: u64, parallelism: u64): u64Parameters:
| Name | Type |
|---|---|
memoryKiB | u64 |
parallelism | u64 |
Returns: u64
validParams
📄
argon2id.vxL62-90
fn validParams(pwdLen: u64, saltLen: u64, secretLen: u64, adLen: u64, timeCost: u64, memoryKiB: u64, parallelism: u64, outLen: u64): boolParameters:
| Name | Type |
|---|---|
pwdLen | u64 |
saltLen | u64 |
secretLen | u64 |
adLen | u64 |
timeCost | u64 |
memoryKiB | u64 |
parallelism | u64 |
outLen | u64 |
Returns: bool
clearOutputIfRepresentable
📄
argon2id.vxL92-97
fn clearOutputIfRepresentable(out: RawBuf!, outLen: u64)Parameters:
| Name | Type |
|---|---|
out | RawBuf! |
outLen | u64 |
invalidArgonParameter
📄
argon2id.vxL99-101
fn invalidArgonParameter(requested: u64, limit: u64): Result<(), CryptoError>Parameters:
| Name | Type |
|---|---|
requested | u64 |
limit | u64 |
Returns: Result<(), CryptoError>
hash2ToLen
📄
argon2id.vxL103-123
fn hash2ToLen(a: RawBuf, aLen: u64, b: RawBuf, bLen: u64, out: RawBuf, outLen: u64)Parameters:
| Name | Type |
|---|---|
a | RawBuf |
aLen | u64 |
b | RawBuf |
bLen | u64 |
out | RawBuf |
outLen | u64 |
hPrimeTo
📄
argon2id.vxL129-207
fn hPrimeTo(input: RawBuf, inputLen: u64, out: RawBuf!, outLen: u64)Parameters:
| Name | Type |
|---|---|
input | RawBuf |
inputLen | u64 |
out | RawBuf! |
outLen | u64 |
blockOffset
📄
argon2id.vxL211-213
fn blockOffset(idx: i64): usizeAlgorithm indices remain signed for the reference-index arithmetic, but
all validated memory byte offsets cross into RawBuf as target-width usize.
Parameters:
| Name | Type |
|---|---|
idx | i64 |
Returns: usize
gbMix
📄
argon2id.vxL221-243
fn gbMix(v: RawBuf, a: i64, b: i64, c: i64, d: i64)Parameters:
| Name | Type |
|---|---|
v | RawBuf |
a | i64 |
b | i64 |
c | i64 |
d | i64 |
roundBlockInPlace
📄
argon2id.vxL245-293
fn roundBlockInPlace(block: RawBuf)Parameters:
| Name | Type |
|---|---|
block | RawBuf |
fillBlock
📄
argon2id.vxL295-316
fn fillBlock(prev: RawBuf, ref: RawBuf, next: RawBuf!, withXor: bool)Parameters:
| Name | Type |
|---|---|
prev | RawBuf |
ref | RawBuf |
next | RawBuf! |
withXor | bool |
nextAddressBlock
📄
argon2id.vxL318-327
fn nextAddressBlock(input: RawBuf, out: RawBuf)Parameters:
| Name | Type |
|---|---|
input | RawBuf |
out | RawBuf |
selectRefIndex
📄
argon2id.vxL329-375
fn selectRefIndex(pass: i64, lane: i64, slice: i64, idxInSeg: i64, lanes: i64, laneLen: i64, j1: u64, j2: u64): i64Parameters:
| Name | Type |
|---|---|
pass | i64 |
lane | i64 |
slice | i64 |
idxInSeg | i64 |
lanes | i64 |
laneLen | i64 |
j1 | u64 |
j2 | u64 |
Returns: i64
seedInitBlock
📄
argon2id.vxL377-383
fn seedInitBlock(h0: RawBuf, j: u32, i: u32, out: RawBuf)Parameters:
| Name | Type |
|---|---|
h0 | RawBuf |
j | u32 |
i | u32 |
out | RawBuf |
argon2DeriveVariant
📄
argon2id.vxL386-398
fn argon2DeriveVariant(variant: u8, password: RawBuf, pwdLen: u64, salt: RawBuf, saltLen: u64, timeCost: u64, memoryKiB: u64, parallelism: u64, out: RawBuf, outLen: u64): Result<(), CryptoError>Derive key bytes using the selected RFC 9106 Argon2 variant.
Parameters:
| Name | Type |
|---|---|
variant | u8 |
password | RawBuf |
pwdLen | u64 |
salt | RawBuf |
saltLen | u64 |
timeCost | u64 |
memoryKiB | u64 |
parallelism | u64 |
out | RawBuf |
outLen | u64 |
Returns: Result<(), CryptoError>
argon2DeriveVariantEx
📄
argon2id.vxL400-668
fn argon2DeriveVariantEx(variant: u8, password: RawBuf, pwdLen: u64, salt: RawBuf, saltLen: u64, secret: RawBuf, secretLen: u64, ad: RawBuf, adLen: u64, timeCost: u64, memoryKiB: u64, parallelism: u64, out: RawBuf!, outLen: u64): Result<(), CryptoError>Parameters:
| Name | Type |
|---|---|
variant | u8 |
password | RawBuf |
pwdLen | u64 |
salt | RawBuf |
saltLen | u64 |
secret | RawBuf |
secretLen | u64 |
ad | RawBuf |
adLen | u64 |
timeCost | u64 |
memoryKiB | u64 |
parallelism | u64 |
out | RawBuf! |
outLen | u64 |
Returns: Result<(), CryptoError>
argon2idDerive 🔓 export
📄
argon2id.vxL671-681
export fn argon2idDerive(password: RawBuf, pwdLen: u64, salt: RawBuf, saltLen: u64, timeCost: u64, memoryKiB: u64, parallelism: u64, out: RawBuf, outLen: u64): Result<(), CryptoError>Argon2id derivation (recommended default).
Parameters:
| Name | Type |
|---|---|
password | RawBuf |
pwdLen | u64 |
salt | RawBuf |
saltLen | u64 |
timeCost | u64 |
memoryKiB | u64 |
parallelism | u64 |
out | RawBuf |
outLen | u64 |
Returns: Result<(), CryptoError>
argon2idDeriveEx 🔓 export
📄
argon2id.vxL684-696
export fn argon2idDeriveEx(password: RawBuf, pwdLen: u64, salt: RawBuf, saltLen: u64, secret: RawBuf, secretLen: u64, ad: RawBuf, adLen: u64, timeCost: u64, memoryKiB: u64, parallelism: u64, out: RawBuf, outLen: u64): Result<(), CryptoError>Argon2id derivation with optional secret/ad fields (RFC-style inputs).
Parameters:
| Name | Type |
|---|---|
password | RawBuf |
pwdLen | u64 |
salt | RawBuf |
saltLen | u64 |
secret | RawBuf |
secretLen | u64 |
ad | RawBuf |
adLen | u64 |
timeCost | u64 |
memoryKiB | u64 |
parallelism | u64 |
out | RawBuf |
outLen | u64 |
Returns: Result<(), CryptoError>
argon2iDerive 🔓 export
📄
argon2id.vxL699-709
export fn argon2iDerive(password: RawBuf, pwdLen: u64, salt: RawBuf, saltLen: u64, timeCost: u64, memoryKiB: u64, parallelism: u64, out: RawBuf, outLen: u64): Result<(), CryptoError>Argon2i derivation (data-independent indexing).
Parameters:
| Name | Type |
|---|---|
password | RawBuf |
pwdLen | u64 |
salt | RawBuf |
saltLen | u64 |
timeCost | u64 |
memoryKiB | u64 |
parallelism | u64 |
out | RawBuf |
outLen | u64 |
Returns: Result<(), CryptoError>
argon2iDeriveEx 🔓 export
📄
argon2id.vxL712-724
export fn argon2iDeriveEx(password: RawBuf, pwdLen: u64, salt: RawBuf, saltLen: u64, secret: RawBuf, secretLen: u64, ad: RawBuf, adLen: u64, timeCost: u64, memoryKiB: u64, parallelism: u64, out: RawBuf, outLen: u64): Result<(), CryptoError>Argon2i derivation with optional secret/ad fields.
Parameters:
| Name | Type |
|---|---|
password | RawBuf |
pwdLen | u64 |
salt | RawBuf |
saltLen | u64 |
secret | RawBuf |
secretLen | u64 |
ad | RawBuf |
adLen | u64 |
timeCost | u64 |
memoryKiB | u64 |
parallelism | u64 |
out | RawBuf |
outLen | u64 |
Returns: Result<(), CryptoError>
argon2dDerive 🔓 export
📄
argon2id.vxL727-737
export fn argon2dDerive(password: RawBuf, pwdLen: u64, salt: RawBuf, saltLen: u64, timeCost: u64, memoryKiB: u64, parallelism: u64, out: RawBuf, outLen: u64): Result<(), CryptoError>Argon2d derivation (data-dependent indexing).
Parameters:
| Name | Type |
|---|---|
password | RawBuf |
pwdLen | u64 |
salt | RawBuf |
saltLen | u64 |
timeCost | u64 |
memoryKiB | u64 |
parallelism | u64 |
out | RawBuf |
outLen | u64 |
Returns: Result<(), CryptoError>
argon2dDeriveEx 🔓 export
📄
argon2id.vxL740-752
export fn argon2dDeriveEx(password: RawBuf, pwdLen: u64, salt: RawBuf, saltLen: u64, secret: RawBuf, secretLen: u64, ad: RawBuf, adLen: u64, timeCost: u64, memoryKiB: u64, parallelism: u64, out: RawBuf, outLen: u64): Result<(), CryptoError>Argon2d derivation with optional secret/ad fields.
Parameters:
| Name | Type |
|---|---|
password | RawBuf |
pwdLen | u64 |
salt | RawBuf |
saltLen | u64 |
secret | RawBuf |
secretLen | u64 |
ad | RawBuf |
adLen | u64 |
timeCost | u64 |
memoryKiB | u64 |
parallelism | u64 |
out | RawBuf |
outLen | u64 |
Returns: Result<(), CryptoError>
clearArgonVec
📄
argon2id.vxL785-790
fn clearArgonVec(output: &Vec<u8>!)Parameters:
| Name | Type |
|---|---|
output | &Vec<u8>! |
argonSpanOverlapsOutput
📄
argon2id.vxL792-800
fn argonSpanOverlapsOutput(source: Span<u8>, output: &Vec<u8>): boolParameters:
| Name | Type |
|---|---|
source | Span<u8> |
output | &Vec<u8> |
Returns: bool
validateArgonFacade
📄
argon2id.vxL802-823
fn validateArgonFacade(passwordLength: usize, saltLength: usize, secretLength: usize, associatedDataLength: usize, parameters: Argon2Parameters, outputLength: usize): Result<(), CryptoError>Parameters:
| Name | Type |
|---|---|
passwordLength | usize |
saltLength | usize |
secretLength | usize |
associatedDataLength | usize |
parameters | Argon2Parameters |
outputLength | usize |
Returns: Result<(), CryptoError>
b64At
📄
base64.vxL1-7
fn b64At(n: u8): u8Parameters:
| Name | Type |
|---|---|
n | u8 |
Returns: u8
base64Encode 🔓 export
📄
base64.vxL10-57
export fn base64Encode(src: RawBuf, len: u64): stringBase64 encode raw bytes (RFC 4648, padded).
Parameters:
| Name | Type |
|---|---|
src | RawBuf |
len | u64 |
Returns: string
base64EncodeString 🔓 export
📄
base64.vxL60-62
export fn base64EncodeString(s: str): stringBase64 encode string bytes as UTF-8 byte sequence.
Parameters:
| Name | Type |
|---|---|
s | str |
Returns: string
rotr64
📄
blake2b.vxL4-6
fn rotr64(x: u64, n: u64): u64Parameters:
| Name | Type |
|---|---|
x | u64 |
n | u64 |
Returns: u64
loadLe64
📄
blake2b.vxL8-10
fn loadLe64(buf: RawBuf!, off: usize): u64Parameters:
| Name | Type |
|---|---|
buf | RawBuf! |
off | usize |
Returns: u64
storeLe64
📄
blake2b.vxL12-14
fn storeLe64(buf: RawBuf!, off: usize, v: u64)Parameters:
| Name | Type |
|---|---|
buf | RawBuf! |
off | usize |
v | u64 |
ivAt
📄
blake2b.vxL16-27
fn ivAt(i: usize): u64Parameters:
| Name | Type |
|---|---|
i | usize |
Returns: u64
sigmaRow
📄
blake2b.vxL29-42
fn sigmaRow(r: usize): [u8; 16]Parameters:
| Name | Type |
|---|---|
r | usize |
Returns: [u8; 16]
g
📄
blake2b.vxL44-66
fn g(vb: RawBuf, a: usize, b: usize, c: usize, d: usize, x: u64, y: u64)Parameters:
| Name | Type |
|---|---|
vb | RawBuf |
a | usize |
b | usize |
c | usize |
d | usize |
x | u64 |
y | u64 |
compress
📄
blake2b.vxL68-116
fn compress(h: RawBuf, block: RawBuf, t: u64, fFinal: bool)Parameters:
| Name | Type |
|---|---|
h | RawBuf |
block | RawBuf |
t | u64 |
fFinal | bool |
blake2bTo 🔓 export
📄
blake2b.vxL120-175
export fn blake2bTo(data: RawBuf, len: u64, out: Ptr<u8>, outLen: u64)Compute BLAKE2b hash to caller-provided output buffer.
outLen must be in [1, 64].
Parameters:
| Name | Type |
|---|---|
data | RawBuf |
len | u64 |
out | Ptr<u8> |
outLen | u64 |
blake2bHex 🔓 export
📄
blake2b.vxL177-181
export fn blake2bHex(data: str): stringParameters:
| Name | Type |
|---|---|
data | str |
Returns: string
ctEq 🔓 export
📄
bytes.vxL5-29
export fn ctEq(a: RawBuf, aLen: u64, b: RawBuf, bLen: u64): boolConstant-time equality over two byte slices (64-bit SWAR accelerated).
Returns false on length mismatch.
Parameters:
| Name | Type |
|---|---|
a | RawBuf |
aLen | u64 |
b | RawBuf |
bLen | u64 |
Returns: bool
xorInto 🔓 export
📄
bytes.vxL32-48
export fn xorInto(dst: RawBuf, a: RawBuf, b: RawBuf, len: u64)XOR two sources into destination: dst[i] = a[i] ^ b[i] (64-bit SWAR accelerated)
Parameters:
| Name | Type |
|---|---|
dst | RawBuf |
a | RawBuf |
b | RawBuf |
len | u64 |
xorInPlace 🔓 export
📄
bytes.vxL51-67
export fn xorInPlace(dst: RawBuf, src: RawBuf, len: u64)In-place XOR: dst[i] ^= src[i] (64-bit SWAR accelerated)
Parameters:
| Name | Type |
|---|---|
dst | RawBuf |
src | RawBuf |
len | u64 |
zeroize 🔓 export
📄
bytes.vxL71-73
export fn zeroize(buf: RawBuf, len: u64)Zeroize sensitive buffer memory. The compiler lowers this to a volatile
memset so the stores survive dead-store elimination before deallocation.
Parameters:
| Name | Type |
|---|---|
buf | RawBuf |
len | u64 |
rotl32
📄
chacha20.vxL7-9
fn rotl32(v: u32, n: u32): u32Parameters:
| Name | Type |
|---|---|
v | u32 |
n | u32 |
Returns: u32
loadLe32
📄
chacha20.vxL11-13
fn loadLe32(buf: RawBuf, off: usize): u32Parameters:
| Name | Type |
|---|---|
buf | RawBuf |
off | usize |
Returns: u32
storeLe32
📄
chacha20.vxL15-17
fn storeLe32(buf: RawBuf, off: usize, v: u32)Parameters:
| Name | Type |
|---|---|
buf | RawBuf |
off | usize |
v | u32 |
quarterRound
📄
chacha20.vxL19-26
fn quarterRound(a: u32, b: u32, c: u32, d: u32): [u32; 4]Parameters:
| Name | Type |
|---|---|
a | u32 |
b | u32 |
c | u32 |
d | u32 |
Returns: [u32; 4]
chacha20Block 🔓 export
📄
chacha20.vxL29-73
export fn chacha20Block(key: RawBuf, nonce: RawBuf, counter: u32, out: RawBuf)Generate one 64-byte ChaCha20 block.
Parameters:
| Name | Type |
|---|---|
key | RawBuf |
nonce | RawBuf |
counter | u32 |
out | RawBuf |
chacha20Xor 🔓 export
📄
chacha20.vxL76-154
export fn chacha20Xor(out: RawBuf, input: RawBuf, len: u64, key: RawBuf, nonce: RawBuf, counter: u32): Result<(), CryptoError>XOR stream with input using 4-way SIMD parallel block pass (256 bytes per iteration).
Parameters:
| Name | Type |
|---|---|
out | RawBuf |
input | RawBuf |
len | u64 |
key | RawBuf |
nonce | RawBuf |
counter | u32 |
Returns: Result<(), CryptoError>
loadLe32
📄
chacha20_4way.vxL5-7
fn loadLe32(buf: RawBuf, off: usize): u32Parameters:
| Name | Type |
|---|---|
buf | RawBuf |
off | usize |
Returns: u32
rotl32
📄
chacha20_4way.vxL9-11
fn rotl32(v: u32, n: u32): u32Parameters:
| Name | Type |
|---|---|
v | u32 |
n | u32 |
Returns: u32
qr
📄
chacha20_4way.vxL13-20
fn qr(a: u32, b: u32, c: u32, d: u32): [u32; 4]Parameters:
| Name | Type |
|---|---|
a | u32 |
b | u32 |
c | u32 |
d | u32 |
Returns: [u32; 4]
pack64
📄
chacha20_4way.vxL22-24
fn pack64(lo: u32, hi: u32): u64Parameters:
| Name | Type |
|---|---|
lo | u32 |
hi | u32 |
Returns: u64
chacha20Block4Way 🔓 export
📄
chacha20_4way.vxL27-151
export fn chacha20Block4Way(key: RawBuf, nonce: RawBuf, counter: u32, out256: RawBuf)Generate 4 consecutive ChaCha20 blocks (256 bytes) in 4-way parallel.
Parameters:
| Name | Type |
|---|---|
key | RawBuf |
nonce | RawBuf |
counter | u32 |
out256 | RawBuf |
pointIdentity 🔓 export
📄
ed25519.vxL20-25
export fn pointIdentity(out: &ExtPoint!)Parameters:
| Name | Type |
|---|---|
out | &ExtPoint! |
edD
📄
ed25519.vxL28-42
fn edD(out: &Fe25519!)Parameters:
| Name | Type |
|---|---|
out | &Fe25519! |
ed2D
📄
ed25519.vxL45-49
fn ed2D(out: &Fe25519!)Parameters:
| Name | Type |
|---|---|
out | &Fe25519! |
affIdentity
📄
ed25519.vxL58-61
fn affIdentity(out: &AffPoint!)Parameters:
| Name | Type |
|---|---|
out | &AffPoint! |
affBasepoint
📄
ed25519.vxL63-80
fn affBasepoint(out: &AffPoint!)Parameters:
| Name | Type |
|---|---|
out | &AffPoint! |
affAdd
📄
ed25519.vxL82-107
fn affAdd(p: &AffPoint, q: &AffPoint, out: &AffPoint!)Parameters:
| Name | Type |
|---|---|
p | &AffPoint |
q | &AffPoint |
out | &AffPoint! |
affScalarMul
📄
ed25519.vxL109-131
fn affScalarMul(scalar: RawBuf, point: &AffPoint, out: &AffPoint!)Parameters:
| Name | Type |
|---|---|
scalar | RawBuf |
point | &AffPoint |
out | &AffPoint! |
feCopyAff
📄
ed25519.vxL133-136
fn feCopyAff(p: &AffPoint, out: &AffPoint!)Parameters:
| Name | Type |
|---|---|
p | &AffPoint |
out | &AffPoint! |
affEncode
📄
ed25519.vxL138-147
fn affEncode(p: &AffPoint, out: RawBuf)Parameters:
| Name | Type |
|---|---|
p | &AffPoint |
out | RawBuf |
feEq
📄
ed25519.vxL149-162
fn feEq(a: &Fe25519, b: &Fe25519): boolParameters:
| Name | Type |
|---|---|
a | &Fe25519 |
b | &Fe25519 |
Returns: bool
fePowConst
📄
ed25519.vxL164-184
fn fePowConst(base: &Fe25519, expLe: RawBuf, out: &Fe25519!)Parameters:
| Name | Type |
|---|---|
base | &Fe25519 |
expLe | RawBuf |
out | &Fe25519! |
feSqrtM1
📄
ed25519.vxL186-199
fn feSqrtM1(out: &Fe25519!)Parameters:
| Name | Type |
|---|---|
out | &Fe25519! |
feSqrtRatio
📄
ed25519.vxL201-237
fn feSqrtRatio(u: &Fe25519, v: &Fe25519, out: &Fe25519!): boolParameters:
| Name | Type |
|---|---|
u | &Fe25519 |
v | &Fe25519 |
out | &Fe25519! |
Returns: bool
scalarLessThanL
📄
ed25519.vxL239-254
fn scalarLessThanL(s: RawBuf): boolParameters:
| Name | Type |
|---|---|
s | RawBuf |
Returns: bool
affDecodeCompressed
📄
ed25519.vxL256-317
fn affDecodeCompressed(in32: RawBuf, out: &AffPoint!): boolParameters:
| Name | Type |
|---|---|
in32 | RawBuf |
out | &AffPoint! |
Returns: bool
affToExt
📄
ed25519.vxL320-325
fn affToExt(p: &AffPoint, out: &ExtPoint!)Parameters:
| Name | Type |
|---|---|
p | &AffPoint |
out | &ExtPoint! |
pointDouble 🔓 export
📄
ed25519.vxL335-359
export fn pointDouble(p: &ExtPoint, out: &ExtPoint!)Parameters:
| Name | Type |
|---|---|
p | &ExtPoint |
out | &ExtPoint! |
pointAdd 🔓 export
📄
ed25519.vxL362-398
export fn pointAdd(p: &ExtPoint, q: &ExtPoint, out: &ExtPoint!)Parameters:
| Name | Type |
|---|---|
p | &ExtPoint |
q | &ExtPoint |
out | &ExtPoint! |
pointCopy
📄
ed25519.vxL400-405
fn pointCopy(point: &ExtPoint, out: &ExtPoint!)Parameters:
| Name | Type |
|---|---|
point | &ExtPoint |
out | &ExtPoint! |
pointCmov
📄
ed25519.vxL409-431
fn pointCmov(candidate: &ExtPoint, choose: u64, out: &ExtPoint!)Parameters:
| Name | Type |
|---|---|
candidate | &ExtPoint |
choose | u64 |
out | &ExtPoint! |
ctEqNibble
📄
ed25519.vxL433-436
fn ctEqNibble(left: u64, right: u64): u64Parameters:
| Name | Type |
|---|---|
left | u64 |
right | u64 |
Returns: u64
scalarMul 🔓 export
📄
ed25519.vxL443-494
export fn scalarMul(scalar: RawBuf, point: &ExtPoint, out: &ExtPoint!)Parameters:
| Name | Type |
|---|---|
scalar | RawBuf |
point | &ExtPoint |
out | &ExtPoint! |
extIsIdentity
📄
ed25519.vxL496-500
fn extIsIdentity(point: &ExtPoint): boolParameters:
| Name | Type |
|---|---|
point | &ExtPoint |
Returns: bool
extHasSmallOrder
📄
ed25519.vxL502-511
fn extHasSmallOrder(point: &ExtPoint): boolParameters:
| Name | Type |
|---|---|
point | &ExtPoint |
Returns: bool
pointEncode 🔓 export
📄
ed25519.vxL514-533
export fn pointEncode(p: &ExtPoint, out: RawBuf)Parameters:
| Name | Type |
|---|---|
p | &ExtPoint |
out | RawBuf |
basepointExt 🔓 export
📄
ed25519.vxL536-560
export fn basepointExt(out: &ExtPoint!)Parameters:
| Name | Type |
|---|---|
out | &ExtPoint! |
scalarL
📄
ed25519.vxL564-575
fn scalarL(): [u8; 32]Returns: [u8; 32]
reduceModL64
📄
ed25519.vxL577-640
fn reduceModL64(x64: RawBuf): [u8; 32]Parameters:
| Name | Type |
|---|---|
x64 | RawBuf |
Returns: [u8; 32]
mulScalar32
📄
ed25519.vxL642-677
fn mulScalar32(a: RawBuf, b: RawBuf): [u8; 64]Parameters:
| Name | Type |
|---|---|
a | RawBuf |
b | RawBuf |
Returns: [u8; 64]
scMulAdd
📄
ed25519.vxL679-700
fn scMulAdd(r: RawBuf, k: RawBuf, a: RawBuf): [u8; 32]Parameters:
| Name | Type |
|---|---|
r | RawBuf |
k | RawBuf |
a | RawBuf |
Returns: [u8; 32]
scReduce
📄
ed25519.vxL702-704
fn scReduce(hash: RawBuf): [u8; 32]Parameters:
| Name | Type |
|---|---|
hash | RawBuf |
Returns: [u8; 32]
ed25519PublicKey 🔓 export
📄
ed25519.vxL709-736
export fn ed25519PublicKey(pubOut: RawBuf, privateKey: RawBuf)Ed25519 key pair generation.
privateKey: 32 random bytes. Writes 32-byte public key to pubOut.
Parameters:
| Name | Type |
|---|---|
pubOut | RawBuf |
privateKey | RawBuf |
ed25519Sign 🔓 export
📄
ed25519.vxL741-826
export fn ed25519Sign(sigOut: RawBuf, privateKey: RawBuf, message: RawBuf, msgLen: u64)Ed25519 sign a message.
Writes 64-byte signature to sigOut. privateKey: 32 bytes, message: raw bytes.
Parameters:
| Name | Type |
|---|---|
sigOut | RawBuf |
privateKey | RawBuf |
message | RawBuf |
msgLen | u64 |
ed25519SignHex 🔓 export
📄
ed25519.vxL829-833
export fn ed25519SignHex(privateKey: RawBuf, message: RawBuf, msgLen: u64): stringEd25519 sign returning hex(signature[64]).
Parameters:
| Name | Type |
|---|---|
privateKey | RawBuf |
message | RawBuf |
msgLen | u64 |
Returns: string
ed25519Verify 🔓 export
📄
ed25519.vxL836-912
export fn ed25519Verify(signature: RawBuf, publicKey: RawBuf, message: RawBuf, msgLen: u64): boolEd25519 verify: returns true iff signature is valid.
Parameters:
| Name | Type |
|---|---|
signature | RawBuf |
publicKey | RawBuf |
message | RawBuf |
msgLen | u64 |
Returns: bool
ed25519PublicKeyHex 🔓 export
📄
ed25519.vxL915-919
export fn ed25519PublicKeyHex(privateKey: RawBuf): stringEd25519 public key generation returning hex.
Parameters:
| Name | Type |
|---|---|
privateKey | RawBuf |
Returns: string
ed25519BasepointHex 🔓 export
📄
ed25519.vxL922-928
export fn ed25519BasepointHex(): stringDiagnostic helper: return encoded Ed25519 basepoint.
Returns: string
ed25519MulBaseHex 🔓 export
📄
ed25519.vxL931-939
export fn ed25519MulBaseHex(scalar: RawBuf): stringDiagnostic helper: encode scalar*B for a raw 32-byte scalar.
Parameters:
| Name | Type |
|---|---|
scalar | RawBuf |
Returns: string
feLoadLe64
📄
field25519.vxL5-7
fn feLoadLe64(buf: RawBuf, off: usize): u64Parameters:
| Name | Type |
|---|---|
buf | RawBuf |
off | usize |
Returns: u64
feZero 🔓 export
📄
field25519.vxL15-21
export fn feZero(out: &Fe25519!)Parameters:
| Name | Type |
|---|---|
out | &Fe25519! |
feOne 🔓 export
📄
field25519.vxL23-29
export fn feOne(out: &Fe25519!)Parameters:
| Name | Type |
|---|---|
out | &Fe25519! |
feCopy 🔓 export
📄
field25519.vxL32-38
export fn feCopy(f: &Fe25519, out: &Fe25519!)Copy a field element (creates a new value from a reference)
Parameters:
| Name | Type |
|---|---|
f | &Fe25519 |
out | &Fe25519! |
feFromBytes 🔓 export
📄
field25519.vxL41-55
export fn feFromBytes(b: RawBuf, out: &Fe25519!)Parameters:
| Name | Type |
|---|---|
b | RawBuf |
out | &Fe25519! |
feToBytes 🔓 export
📄
field25519.vxL58-90
export fn feToBytes(f: &Fe25519, out: RawBuf)Parameters:
| Name | Type |
|---|---|
f | &Fe25519 |
out | RawBuf |
feCarryPropagate
📄
field25519.vxL92-119
fn feCarryPropagate(f: &Fe25519, out: &Fe25519!)Parameters:
| Name | Type |
|---|---|
f | &Fe25519 |
out | &Fe25519! |
feReduce
📄
field25519.vxL121-160
fn feReduce(f: &Fe25519, out: &Fe25519!)Parameters:
| Name | Type |
|---|---|
f | &Fe25519 |
out | &Fe25519! |
feAdd 🔓 export
📄
field25519.vxL162-170
export fn feAdd(a: &Fe25519, b: &Fe25519, out: &Fe25519!)Parameters:
| Name | Type |
|---|---|
a | &Fe25519 |
b | &Fe25519 |
out | &Fe25519! |
feSub 🔓 export
📄
field25519.vxL172-182
export fn feSub(a: &Fe25519, b: &Fe25519, out: &Fe25519!)Parameters:
| Name | Type |
|---|---|
a | &Fe25519 |
b | &Fe25519 |
out | &Fe25519! |
feReduceWide
📄
field25519.vxL188-217
fn feReduceWide(t0: u128, t1: u128, t2: u128, t3: u128, t4: u128, out: &Fe25519!)Parameters:
| Name | Type |
|---|---|
t0 | u128 |
t1 | u128 |
t2 | u128 |
t3 | u128 |
t4 | u128 |
out | &Fe25519! |
feMul 🔓 export
📄
field25519.vxL219-237
export fn feMul(a: &Fe25519, b: &Fe25519, out: &Fe25519!)Parameters:
| Name | Type |
|---|---|
a | &Fe25519 |
b | &Fe25519 |
out | &Fe25519! |
feMulSmall 🔓 export
📄
field25519.vxL243-253
export fn feMulSmall(a: &Fe25519, coefficient: u64, out: &Fe25519!)Multiply by a single machine-word coefficient. This is the canonical
constant/small-coefficient path for field formulas: it preserves the same reduction semantics as feMul without manufacturing a sparse field element and paying for its zero products.
Parameters:
| Name | Type |
|---|---|
a | &Fe25519 |
coefficient | u64 |
out | &Fe25519! |
feSq 🔓 export
📄
field25519.vxL255-257
export fn feSq(a: &Fe25519, out: &Fe25519!)Parameters:
| Name | Type |
|---|---|
a | &Fe25519 |
out | &Fe25519! |
feSqN
📄
field25519.vxL276-283
fn feSqN(a: &Fe25519, n: i64, out: &Fe25519!)Parameters:
| Name | Type |
|---|---|
a | &Fe25519 |
n | i64 |
out | &Fe25519! |
feInvert 🔓 export
📄
field25519.vxL286-338
export fn feInvert(z: &Fe25519, out: &Fe25519!)Parameters:
| Name | Type |
|---|---|
z | &Fe25519 |
out | &Fe25519! |
feCSwap 🔓 export
📄
field25519.vxL341-350
export fn feCSwap(a: &Fe25519!, b: &Fe25519!, swap: u64)Parameters:
| Name | Type |
|---|---|
a | &Fe25519! |
b | &Fe25519! |
swap | u64 |
hexChar
📄
hex.vxL1-4
fn hexChar(n: u8): u8Parameters:
| Name | Type |
|---|---|
n | u8 |
Returns: u8
fromHexNibble
📄
hex.vxL6-11
fn fromHexNibble(c: u8): i32Parameters:
| Name | Type |
|---|---|
c | u8 |
Returns: i32
hexEncode 🔓 export
📄
hex.vxL14-34
export fn hexEncode(src: RawBuf, len: u64): stringEncode raw bytes to lowercase hex string.
Parameters:
| Name | Type |
|---|---|
src | RawBuf |
len | u64 |
Returns: string
hexDecodeTo 🔓 export
📄
hex.vxL38-58
export fn hexDecodeTo(hex: str, out: RawBuf, outCap: u64): u64Decode hex string to bytes into caller-provided output buffer.
Returns number of written bytes, or 0 on invalid hex/out-of-capacity.
Parameters:
| Name | Type |
|---|---|
hex | str |
out | RawBuf |
outCap | u64 |
Returns: u64
hkdfExtract 🔓 export
📄
hkdf.vxL9-29
export fn hkdfExtract(salt: RawBuf, saltLen: u64, ikm: RawBuf, ikmLen: u64, prk: Ptr<u8>): Result<(), CryptoError>HKDF-Extract: PRK = HMAC-SHA256(salt, IKM)
If salt is empty (saltLen==0), uses 32 zero bytes as default salt.
Parameters:
| Name | Type |
|---|---|
salt | RawBuf |
saltLen | u64 |
ikm | RawBuf |
ikmLen | u64 |
prk | Ptr<u8> |
Returns: Result<(), CryptoError>
hkdfExpand 🔓 export
📄
hkdf.vxL33-81
export fn hkdfExpand(prk: RawBuf, prkLen: u64, info: RawBuf, infoLen: u64, out: RawBuf, outLen: u64): Result<(), CryptoError>HKDF-Expand: derive output keying material from PRK.
prk: 32 bytes (from hkdfExtract), outLen ≤ 255*32 = 8160 bytes.
Parameters:
| Name | Type |
|---|---|
prk | RawBuf |
prkLen | u64 |
info | RawBuf |
infoLen | u64 |
out | RawBuf |
outLen | u64 |
Returns: Result<(), CryptoError>
hkdf 🔓 export
📄
hkdf.vxL84-95
export fn hkdf(salt: RawBuf, saltLen: u64, ikm: RawBuf, ikmLen: u64, info: RawBuf, infoLen: u64, out: RawBuf, outLen: u64): Result<(), CryptoError>One-shot HKDF: Extract + Expand.
Parameters:
| Name | Type |
|---|---|
salt | RawBuf |
saltLen | u64 |
ikm | RawBuf |
ikmLen | u64 |
info | RawBuf |
infoLen | u64 |
out | RawBuf |
outLen | u64 |
Returns: Result<(), CryptoError>
hkdfExtractSha384 🔓 export
📄
hkdf.vxL99-119
export fn hkdfExtractSha384(salt: RawBuf, saltLen: u64, ikm: RawBuf, ikmLen: u64, prk: Ptr<u8>): Result<(), CryptoError>HKDF-Extract with HMAC-SHA384. An empty salt is represented by one
SHA-384 digest-length block of zero bytes, as required by RFC 5869.
Parameters:
| Name | Type |
|---|---|
salt | RawBuf |
saltLen | u64 |
ikm | RawBuf |
ikmLen | u64 |
prk | Ptr<u8> |
Returns: Result<(), CryptoError>
hkdfExpandSha384 🔓 export
📄
hkdf.vxL122-165
export fn hkdfExpandSha384(prk: RawBuf, prkLen: u64, info: RawBuf, infoLen: u64, out: RawBuf, outLen: u64): Result<(), CryptoError>HKDF-Expand with HMAC-SHA384. The RFC 5869 limit is 255 digest blocks.
Parameters:
| Name | Type |
|---|---|
prk | RawBuf |
prkLen | u64 |
info | RawBuf |
infoLen | u64 |
out | RawBuf |
outLen | u64 |
Returns: Result<(), CryptoError>
hkdfSha384 🔓 export
📄
hkdf.vxL167-180
export fn hkdfSha384(salt: RawBuf, saltLen: u64, ikm: RawBuf, ikmLen: u64, info: RawBuf, infoLen: u64, out: RawBuf, outLen: u64): Result<(), CryptoError>Parameters:
| Name | Type |
|---|---|
salt | RawBuf |
saltLen | u64 |
ikm | RawBuf |
ikmLen | u64 |
info | RawBuf |
infoLen | u64 |
out | RawBuf |
outLen | u64 |
Returns: Result<(), CryptoError>
hmacSha1To 🔓 export
📄
hmac.vxL12-62
export fn hmacSha1To(key: RawBuf, keyLen: u64, data: RawBuf, dataLen: u64, out: Ptr<u8>)HMAC-SHA1 (RFC 2104). SHA-1 is retained solely for interoperating with
protocol profiles such as SRTP AES_CM_128_HMAC_SHA1_80; new application protocols should use HMAC-SHA256 instead.
Parameters:
| Name | Type |
|---|---|
key | RawBuf |
keyLen | u64 |
data | RawBuf |
dataLen | u64 |
out | Ptr<u8> |
hmacSha256To 🔓 export
📄
hmac.vxL64-159
export fn hmacSha256To(key: RawBuf, keyLen: u64, data: RawBuf, dataLen: u64, out: Ptr<u8>)Parameters:
| Name | Type |
|---|---|
key | RawBuf |
keyLen | u64 |
data | RawBuf |
dataLen | u64 |
out | Ptr<u8> |
hmacSha256PartsTo 🔓 export
📄
hmac.vxL164-215
export fn hmacSha256PartsTo(key: RawBuf, keyLen: u64, first: RawBuf, firstLen: u64, second: RawBuf, secondLen: u64, third: RawBuf, thirdLen: u64, out: Ptr<u8>)Allocation-free HMAC-SHA256 over three discontiguous byte segments.
This is the shared kernel for HKDF/PBKDF2; no secret-bearing concatenation buffer or per-round allocator traffic is required.
Parameters:
| Name | Type |
|---|---|
key | RawBuf |
keyLen | u64 |
first | RawBuf |
firstLen | u64 |
second | RawBuf |
secondLen | u64 |
third | RawBuf |
thirdLen | u64 |
out | Ptr<u8> |
hmacSha384PartsTo 🔓 export
📄
hmac.vxL219-270
export fn hmacSha384PartsTo(key: RawBuf, keyLen: u64, first: RawBuf, firstLen: u64, second: RawBuf, secondLen: u64, third: RawBuf, thirdLen: u64, out: Ptr<u8>)Allocation-free HMAC-SHA384 over three discontiguous byte segments.
SHA-384 uses SHA-512's 128-byte block size and a 48-byte digest.
Parameters:
| Name | Type |
|---|---|
key | RawBuf |
keyLen | u64 |
first | RawBuf |
firstLen | u64 |
second | RawBuf |
secondLen | u64 |
third | RawBuf |
thirdLen | u64 |
out | Ptr<u8> |
hmacSha384To 🔓 export
📄
hmac.vxL272-282
export fn hmacSha384To(key: RawBuf, keyLen: u64, data: RawBuf, dataLen: u64, out: Ptr<u8>)Parameters:
| Name | Type |
|---|---|
key | RawBuf |
keyLen | u64 |
data | RawBuf |
dataLen | u64 |
out | Ptr<u8> |
hmacSha384Hex 🔓 export
📄
hmac.vxL284-292
export fn hmacSha384Hex(key: str, data: str): stringParameters:
| Name | Type |
|---|---|
key | str |
data | str |
Returns: string
hmacSha256Hex 🔓 export
📄
hmac.vxL294-311
export fn hmacSha256Hex(key: str, data: str): stringParameters:
| Name | Type |
|---|---|
key | str |
data | str |
Returns: string
hmacVerifySha256Hex 🔓 export
📄
hmac.vxL313-340
export fn hmacVerifySha256Hex(key: str, data: str, expectedHex: str): boolParameters:
| Name | Type |
|---|---|
key | str |
data | str |
expectedHex | str |
Returns: bool
pbkdf2Sha256 🔓 export
📄
pbkdf2.vxL8-103
export fn pbkdf2Sha256(password: RawBuf, pwdLen: u64, salt: RawBuf, saltLen: u64, iterations: u64, out: RawBuf, outLen: u64): Result<(), CryptoError>PBKDF2 with HMAC-SHA256 as PRF.
Password and salt are raw buffers, iterations >= 1, output written to out.
Parameters:
| Name | Type |
|---|---|
password | RawBuf |
pwdLen | u64 |
salt | RawBuf |
saltLen | u64 |
iterations | u64 |
out | RawBuf |
outLen | u64 |
Returns: Result<(), CryptoError>
pbkdf2Sha256Hex 🔓 export
📄
pbkdf2.vxL106-128
export fn pbkdf2Sha256Hex(password: str, salt: str, iterations: u64, dkLen: u64): Result<string, CryptoError>Convenience: PBKDF2-SHA256 with string inputs, returns hex-encoded output.
Parameters:
| Name | Type |
|---|---|
password | str |
salt | str |
iterations | u64 |
dkLen | u64 |
Returns: Result<string, CryptoError>
p1305LoadLe32
📄
poly1305.vxL5-7
fn p1305LoadLe32(buf: RawBuf, off: usize): u32Parameters:
| Name | Type |
|---|---|
buf | RawBuf |
off | usize |
Returns: u32
newPoly1305 🔓 export
📄
poly1305.vxL70-72
export fn newPoly1305(key: RawBuf, key_len: usize): Poly1305Parameters:
| Name | Type |
|---|---|
key | RawBuf |
key_len | usize |
Returns: Poly1305
poly1305Auth 🔓 export
📄
poly1305.vxL318-322
export fn poly1305Auth(key: RawBuf, key_len: usize, message: RawBuf, msg_len: usize): [u8; 16]Parameters:
| Name | Type |
|---|---|
key | RawBuf |
key_len | usize |
message | RawBuf |
msg_len | usize |
Returns: [u8; 16]
rol32
📄
sha1.vxL3-5
fn rol32(x: u32, n: u32): u32Parameters:
| Name | Type |
|---|---|
x | u32 |
n | u32 |
Returns: u32
newSha1 🔓 export
📄
sha1.vxL35-37
export fn newSha1(): Sha1Returns: Sha1
sha1To 🔓 export
📄
sha1.vxL190-194
export fn sha1To(data: RawBuf, len: u64, out: Ptr<u8>)Parameters:
| Name | Type |
|---|---|
data | RawBuf |
len | u64 |
out | Ptr<u8> |
sha1Hex 🔓 export
📄
sha1.vxL196-204
export fn sha1Hex(data: str): stringParameters:
| Name | Type |
|---|---|
data | str |
Returns: string
bswap32
📄
sha256.vxL4-6
fn bswap32(v: u32): u32Parameters:
| Name | Type |
|---|---|
v | u32 |
Returns: u32
k256
📄
sha256.vxL27-32
fn k256(t: i64): u32Parameters:
| Name | Type |
|---|---|
t | i64 |
Returns: u32
newSha256 🔓 export
📄
sha256.vxL65-67
export fn newSha256(): Sha256Returns: Sha256
sha256To 🔓 export
📄
sha256.vxL245-249
export fn sha256To(data: RawBuf, len: u64, out: Ptr<u8>)Parameters:
| Name | Type |
|---|---|
data | RawBuf |
len | u64 |
out | Ptr<u8> |
sha256Hex 🔓 export
📄
sha256.vxL251-263
export fn sha256Hex(data: str): stringParameters:
| Name | Type |
|---|---|
data | str |
Returns: string
rotr64
📄
sha512.vxL4-6
fn rotr64(x: u64, n: u64): u64Parameters:
| Name | Type |
|---|---|
x | u64 |
n | u64 |
Returns: u64
ch512
📄
sha512.vxL8-10
fn ch512(x: u64, y: u64, z: u64): u64Parameters:
| Name | Type |
|---|---|
x | u64 |
y | u64 |
z | u64 |
Returns: u64
maj512
📄
sha512.vxL12-14
fn maj512(x: u64, y: u64, z: u64): u64Parameters:
| Name | Type |
|---|---|
x | u64 |
y | u64 |
z | u64 |
Returns: u64
bsig0_512
📄
sha512.vxL16-18
fn bsig0_512(x: u64): u64Parameters:
| Name | Type |
|---|---|
x | u64 |
Returns: u64
bsig1_512
📄
sha512.vxL20-22
fn bsig1_512(x: u64): u64Parameters:
| Name | Type |
|---|---|
x | u64 |
Returns: u64
ssig0_512
📄
sha512.vxL24-26
fn ssig0_512(x: u64): u64Parameters:
| Name | Type |
|---|---|
x | u64 |
Returns: u64
ssig1_512
📄
sha512.vxL28-30
fn ssig1_512(x: u64): u64Parameters:
| Name | Type |
|---|---|
x | u64 |
Returns: u64
bswap64
📄
sha512.vxL32-34
fn bswap64(v: u64): u64Parameters:
| Name | Type |
|---|---|
v | u64 |
Returns: u64
k512
📄
sha512.vxL36-63
fn k512(t: i64): u64Parameters:
| Name | Type |
|---|---|
t | i64 |
Returns: u64
sha512Hex 🔓 export
📄
sha512.vxL324-331
export fn sha512Hex(data: str): stringParameters:
| Name | Type |
|---|---|
data | str |
Returns: string
sha512To 🔓 export
📄
sha512.vxL333-338
export fn sha512To(data: RawBuf, len: u64, out: Ptr<u8>)Parameters:
| Name | Type |
|---|---|
data | RawBuf |
len | u64 |
out | Ptr<u8> |
sha384Hex 🔓 export
📄
sha512.vxL340-347
export fn sha384Hex(data: str): stringParameters:
| Name | Type |
|---|---|
data | str |
Returns: string
sha384To 🔓 export
📄
sha512.vxL349-354
export fn sha384To(data: RawBuf, len: u64, out: Ptr<u8>)Parameters:
| Name | Type |
|---|---|
data | RawBuf |
len | u64 |
out | Ptr<u8> |
xorBlocks 🔓 export
📄
simd.vxL6-12
export fn xorBlocks(dst: RawBuf, a: RawBuf, b: RawBuf, bytes: u64)Parameters:
| Name | Type |
|---|---|
dst | RawBuf |
a | RawBuf |
b | RawBuf |
bytes | u64 |
addU32Blocks 🔓 export
📄
simd.vxL14-21
export fn addU32Blocks(dst: RawBuf, a: RawBuf, b: RawBuf, words: u64)Parameters:
| Name | Type |
|---|---|
dst | RawBuf |
a | RawBuf |
b | RawBuf |
words | u64 |
rotrU32Blocks 🔓 export
📄
simd.vxL23-31
export fn rotrU32Blocks(dst: RawBuf, src: RawBuf, words: u64, shift: u32)Parameters:
| Name | Type |
|---|---|
dst | RawBuf |
src | RawBuf |
words | u64 |
shift | u32 |
storeLe64 🔓 export
📄
utils.vxL4-13
export fn storeLe64(buf: RawBuf, off: usize, v: u64)Parameters:
| Name | Type |
|---|---|
buf | RawBuf |
off | usize |
v | u64 |
storeBe64 🔓 export
📄
utils.vxL15-24
export fn storeBe64(buf: RawBuf, off: usize, v: u64)Parameters:
| Name | Type |
|---|---|
buf | RawBuf |
off | usize |
v | u64 |
x25519 🔓 export
📄
x25519.vxL13-92
export fn x25519(out: RawBuf, scalar: RawBuf, point: RawBuf)Scalar multiplication: result = scalar * point on Curve25519.
Both scalar and point are 32 bytes (little-endian). Result written to out (32 bytes).
Parameters:
| Name | Type |
|---|---|
out | RawBuf |
scalar | RawBuf |
point | RawBuf |
x25519Basepoint 🔓 export
📄
x25519.vxL97-102
export fn x25519Basepoint(out: RawBuf, privateKey: RawBuf)Generate X25519 public key from private key.
Private key: 32 random bytes (will be clamped internally). Uses basepoint u=9.
Parameters:
| Name | Type |
|---|---|
out | RawBuf |
privateKey | RawBuf |
x25519Hex 🔓 export
📄
x25519.vxL105-109
export fn x25519Hex(myPrivate: RawBuf, theirPublic: RawBuf): stringCompute X25519 shared secret, returns hex string.
Parameters:
| Name | Type |
|---|---|
myPrivate | RawBuf |
theirPublic | RawBuf |
Returns: string
test_aead_rfc8439 🔓 export
📄
aead.test.vxL4-124
export fn test_aead_rfc8439(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
test_aead_tamper_reject 🔓 export
📄
aead.test.vxL126-172
export fn test_aead_tamper_reject(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
test_aes128_fips197_block_vector 🔓 export
📄
aes_gcm.test.vxL6-23
export fn test_aes128_fips197_block_vector(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
test_aes128_gcm_nist_zero_vector 🔓 export
📄
aes_gcm.test.vxL25-68
export fn test_aes128_gcm_nist_zero_vector(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
test_aes_gcm_roundtrip 🔓 export
📄
aes_gcm.test.vxL70-117
export fn test_aes_gcm_roundtrip(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
test_aes_gcm_reject_tamper 🔓 export
📄
aes_gcm.test.vxL119-162
export fn test_aes_gcm_reject_tamper(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
test_aes_ctr_rejects_counter_wrap_before_output 🔓 export
📄
aes_gcm.test.vxL164-192
export fn test_aes_ctr_rejects_counter_wrap_before_output(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
test_aes_ctr_initial_counter_allows_final_block 🔓 export
📄
aes_gcm.test.vxL197-216
export fn test_aes_ctr_initial_counter_allows_final_block(ctx: &TestCtx!)Initial-counter CTR may encrypt the all-ones counter exactly once. The
separate preflight must not accidentally apply GCM/J0's pre-increment rule and reject that valid final block.
Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
test_aes_gcm_rejects_oversized_payload_before_output 🔓 export
📄
aes_gcm.test.vxL218-246
export fn test_aes_gcm_rejects_oversized_payload_before_output(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
arraySpan
📄
api.test.vxL8-10
fn arraySpan<const N: usize>(value: &[u8; N]): Span<u8>Type Parameters:
const N: usize
Parameters:
| Name | Type |
|---|---|
value | &[u8; N] |
Returns: Span<u8>
strBytes
📄
api.test.vxL12-14
fn strBytes(value: str): Span<u8>Parameters:
| Name | Type |
|---|---|
value | str |
Returns: Span<u8>
assertBytes
📄
api.test.vxL16-22
fn assertBytes(ctx: &TestCtx!, actual: &Vec<u8>, expected: Span<u8>)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
actual | &Vec<u8> |
expected | Span<u8> |
test_safe_chacha_combined_roundtrip_and_reuse 🔓 export
📄
api.test.vxL24-61
export fn test_safe_chacha_combined_roundtrip_and_reuse(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
test_safe_aes256_gcm_combined_roundtrip 🔓 export
📄
api.test.vxL63-84
export fn test_safe_aes256_gcm_combined_roundtrip(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
test_safe_aes128_gcm_combined_roundtrip_and_dimensions 🔓 export
📄
api.test.vxL86-119
export fn test_safe_aes128_gcm_combined_roundtrip_and_dimensions(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
test_safe_facade_rejects_dimensions_and_clears_output 🔓 export
📄
api.test.vxL121-143
export fn test_safe_facade_rejects_dimensions_and_clears_output(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
test_safe_facade_auth_failure_releases_no_plaintext 🔓 export
📄
api.test.vxL145-175
export fn test_safe_facade_auth_failure_releases_no_plaintext(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
test_safe_facade_stages_in_place_aliases 🔓 export
📄
api.test.vxL177-201
export fn test_safe_facade_stages_in_place_aliases(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
test_safe_hkdf_rfc5869_and_reuse 🔓 export
📄
api.test.vxL203-230
export fn test_safe_hkdf_rfc5869_and_reuse(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
test_safe_hkdf_sha384_reuse_and_failure_clearing 🔓 export
📄
api.test.vxL232-267
export fn test_safe_hkdf_sha384_reuse_and_failure_clearing(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
test_safe_pbkdf2_vector_and_parameter_error 🔓 export
📄
api.test.vxL269-294
export fn test_safe_pbkdf2_vector_and_parameter_error(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
test_safe_argon2id_reuse_alias_and_parameter_errors 🔓 export
📄
api.test.vxL296-349
export fn test_safe_argon2id_reuse_alias_and_parameter_errors(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
test_safe_argon2id_accepts_empty_password 🔓 export
📄
api.test.vxL351-363
export fn test_safe_argon2id_accepts_empty_password(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
test_safe_ed25519_roundtrip_and_dimensions 🔓 export
📄
api.test.vxL365-399
export fn test_safe_ed25519_roundtrip_and_dimensions(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
expectArgonSuccess
📄
argon2id.test.vxL4-9
fn expectArgonSuccess(result: Result<(), CryptoError>)Parameters:
| Name | Type |
|---|---|
result | Result<(), CryptoError> |
test_argon2id_deterministic 🔓 export
📄
argon2id.test.vxL11-40
export fn test_argon2id_deterministic(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
test_argon2id_param_sensitivity 🔓 export
📄
argon2id.test.vxL42-75
export fn test_argon2id_param_sensitivity(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
test_argon2_variants_produce_distinct_outputs 🔓 export
📄
argon2id.test.vxL77-116
export fn test_argon2_variants_produce_distinct_outputs(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
test_argon2_invalid_params_zero_output 🔓 export
📄
argon2id.test.vxL118-149
export fn test_argon2_invalid_params_zero_output(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
test_argon2id_ex_secret_ad_affect_output 🔓 export
📄
argon2id.test.vxL151-192
export fn test_argon2id_ex_secret_ad_affect_output(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
test_argon2i_d_ex_secret_ad_affect_output 🔓 export
📄
argon2id.test.vxL194-256
export fn test_argon2i_d_ex_secret_ad_affect_output(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
test_argon2id_long_output_deterministic 🔓 export
📄
argon2id.test.vxL258-289
export fn test_argon2id_long_output_deterministic(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
test_argon2id_rfc9106_case 🔓 export
📄
argon2id.test.vxL291-311
export fn test_argon2id_rfc9106_case(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
makeBytes
📄
bench.test.vxL12-24
fn makeBytes(length: usize): RawBufParameters:
| Name | Type |
|---|---|
length | usize |
Returns: RawBuf
observe
📄
bench.test.vxL26-31
fn observe(buffer: RawBuf, length: usize, seed: i64): i64Parameters:
| Name | Type |
|---|---|
buffer | RawBuf |
length | usize |
seed | i64 |
Returns: i64
bench_sha256_4k
📄
bench.test.vxL33-45
fn bench_sha256_4k(b: &BenchCtx!)Parameters:
| Name | Type |
|---|---|
b | &BenchCtx! |
bench_chacha20_poly1305_seal_16k
📄
bench.test.vxL47-68
fn bench_chacha20_poly1305_seal_16k(b: &BenchCtx!)Parameters:
| Name | Type |
|---|---|
b | &BenchCtx! |
bench_chacha20_xor_16k
📄
bench.test.vxL70-88
fn bench_chacha20_xor_16k(b: &BenchCtx!)Parameters:
| Name | Type |
|---|---|
b | &BenchCtx! |
bench_poly1305_auth_16k
📄
bench.test.vxL90-103
fn bench_poly1305_auth_16k(b: &BenchCtx!)Parameters:
| Name | Type |
|---|---|
b | &BenchCtx! |
bench_aes128_gcm_seal_16k
📄
bench.test.vxL105-126
fn bench_aes128_gcm_seal_16k(b: &BenchCtx!)Parameters:
| Name | Type |
|---|---|
b | &BenchCtx! |
bench_aes256_gcm_seal_16k
📄
bench.test.vxL128-149
fn bench_aes256_gcm_seal_16k(b: &BenchCtx!)Parameters:
| Name | Type |
|---|---|
b | &BenchCtx! |
bench_x25519_public_key
📄
bench.test.vxL151-163
fn bench_x25519_public_key(b: &BenchCtx!)Parameters:
| Name | Type |
|---|---|
b | &BenchCtx! |
bench_ed25519_sign_1k
📄
bench.test.vxL165-179
fn bench_ed25519_sign_1k(b: &BenchCtx!)Parameters:
| Name | Type |
|---|---|
b | &BenchCtx! |
bench_ed25519_verify_1k
📄
bench.test.vxL181-197
fn bench_ed25519_verify_1k(b: &BenchCtx!)Parameters:
| Name | Type |
|---|---|
b | &BenchCtx! |
bench_argon2id_1mib_one_pass
📄
bench.test.vxL199-215
fn bench_argon2id_1mib_one_pass(b: &BenchCtx!)Parameters:
| Name | Type |
|---|---|
b | &BenchCtx! |
test_blake2b_empty 🔓 export
📄
blake2b.test.vxL4-9
export fn test_blake2b_empty(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
test_blake2b_abc 🔓 export
📄
blake2b.test.vxL11-16
export fn test_blake2b_abc(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
test_cteq_basic 🔓 export
📄
bytes.test.vxL3-13
export fn test_cteq_basic(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
test_xor_and_zeroize 🔓 export
📄
bytes.test.vxL15-40
export fn test_xor_and_zeroize(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
fillSeq
📄
chacha20.test.vxL4-11
fn fillSeq(buf: RawBuf, n: i64)Parameters:
| Name | Type |
|---|---|
buf | RawBuf |
n | i64 |
test_chacha20_block_rfc8439 🔓 export
📄
chacha20.test.vxL13-49
export fn test_chacha20_block_rfc8439(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
test_chacha20_xor_roundtrip 🔓 export
📄
chacha20.test.vxL51-110
export fn test_chacha20_xor_roundtrip(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
test_chacha20_four_way_matches_scalar_blocks 🔓 export
📄
chacha20.test.vxL112-161
export fn test_chacha20_four_way_matches_scalar_blocks(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
test_chacha20_rejects_counter_wrap_before_output 🔓 export
📄
chacha20.test.vxL163-189
export fn test_chacha20_rejects_counter_wrap_before_output(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
main
📄
debug_sha256.vxL3-6
fn main()test_ed25519_public_key_rfc8032_case1 🔓 export
📄
ed25519_pk.test.vxL4-21
export fn test_ed25519_public_key_rfc8032_case1(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
test_ed25519_sign_rfc8032_case1 🔓 export
📄
ed25519_sign.test.vxL4-28
export fn test_ed25519_sign_rfc8032_case1(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
test_ed25519_verify_rfc8032_case1 🔓 export
📄
ed25519_verify.test.vxL4-28
export fn test_ed25519_verify_rfc8032_case1(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
test_ed25519_verify_reject_tamper 🔓 export
📄
ed25519_verify.test.vxL30-55
export fn test_ed25519_verify_reject_tamper(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
identityForgerySignature
📄
ed25519_verify.test.vxL57-69
fn identityForgerySignature(): [u8; 64]Returns: [u8; 64]
test_ed25519_verify_rejects_small_order_public_key 🔓 export
📄
ed25519_verify.test.vxL71-82
export fn test_ed25519_verify_rejects_small_order_public_key(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
test_ed25519_verify_rejects_noncanonical_point_encoding 🔓 export
📄
ed25519_verify.test.vxL84-98
export fn test_ed25519_verify_rejects_noncanonical_point_encoding(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
fillFieldInput
📄
field25519.test.vxL7-17
fn fillFieldInput(seed: u64, out: &[u8; 32]!)Parameters:
| Name | Type |
|---|---|
seed | u64 |
out | &[u8; 32]! |
fieldEqual
📄
field25519.test.vxL19-30
fn fieldEqual(a: &Fe25519, b: &Fe25519): boolParameters:
| Name | Type |
|---|---|
a | &Fe25519 |
b | &Fe25519 |
Returns: bool
test_field25519_wide_mul_and_square_properties 🔓 export
📄
field25519.test.vxL32-58
export fn test_field25519_wide_mul_and_square_properties(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
test_field25519_inversion_identity 🔓 export
📄
field25519.test.vxL60-77
export fn test_field25519_inversion_identity(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
test_hex_encode_decode_roundtrip 🔓 export
📄
hex.test.vxL3-17
export fn test_hex_encode_decode_roundtrip(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
test_hex_decode_invalid 🔓 export
📄
hex.test.vxL19-29
export fn test_hex_decode_invalid(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
test_hkdf_sha384_extract_and_multiblock_expand 🔓 export
📄
hkdf.test.vxL7-43
export fn test_hkdf_sha384_extract_and_multiblock_expand(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
test_hkdf_sha384_rejects_oversized_output_before_write 🔓 export
📄
hkdf.test.vxL45-57
export fn test_hkdf_sha384_rejects_oversized_output_before_write(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
test_hkdf_extract_rfc5869 🔓 export
📄
hkdf.test.vxL59-88
export fn test_hkdf_extract_rfc5869(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
test_hkdf_expand_rfc5869 🔓 export
📄
hkdf.test.vxL90-124
export fn test_hkdf_expand_rfc5869(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
test_hkdf_rejects_oversized_output_before_write 🔓 export
📄
hkdf.test.vxL126-145
export fn test_hkdf_rejects_oversized_output_before_write(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
test_hmac_sha384_rfc4231_case1 🔓 export
📄
hmac.test.vxL6-27
export fn test_hmac_sha384_rfc4231_case1(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
test_hmac_sha1_rfc2202_case2 🔓 export
📄
hmac.test.vxL30-50
export fn test_hmac_sha1_rfc2202_case2(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
test_hmac_sha256_key_data 🔓 export
📄
hmac.test.vxL53-57
export fn test_hmac_sha256_key_data(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
test_hmac_verify 🔓 export
📄
hmac.test.vxL59-67
export fn test_hmac_verify(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
test_pbkdf2_rfc6070_1 🔓 export
📄
pbkdf2.test.vxL4-15
export fn test_pbkdf2_rfc6070_1(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
test_pbkdf2_rfc6070_2 🔓 export
📄
pbkdf2.test.vxL17-27
export fn test_pbkdf2_rfc6070_2(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
test_pbkdf2_rejects_zero_iterations_before_write 🔓 export
📄
pbkdf2.test.vxL29-50
export fn test_pbkdf2_rejects_zero_iterations_before_write(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
assertTagEq
📄
poly1305.test.vxL4-10
fn assertTagEq(ctx: &TestCtx!, left: [u8; 16], right: [u8; 16])Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
left | [u8; 16] |
right | [u8; 16] |
test_poly1305_empty 🔓 export
📄
poly1305.test.vxL12-46
export fn test_poly1305_empty(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
test_poly1305_rfc7539 🔓 export
📄
poly1305.test.vxL48-94
export fn test_poly1305_rfc7539(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
test_poly1305_rfc8439_a3 🔓 export
📄
poly1305.test.vxL96-165
export fn test_poly1305_rfc8439_a3(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
test_poly1305_streaming_partitions_match_one_shot 🔓 export
📄
poly1305.test.vxL167-201
export fn test_poly1305_streaming_partitions_match_one_shot(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
test_sha256_empty 🔓 export
📄
sha256.test.vxL4-8
export fn test_sha256_empty(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
test_sha256_abc 🔓 export
📄
sha256.test.vxL10-14
export fn test_sha256_abc(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
test_sha256_snapshot_does_not_finalize_state 🔓 export
📄
sha256.test.vxL16-32
export fn test_sha256_snapshot_does_not_finalize_state(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
test_sha384_empty 🔓 export
📄
sha512.test.vxL4-11
export fn test_sha384_empty(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
test_sha384_abc 🔓 export
📄
sha512.test.vxL13-20
export fn test_sha384_abc(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
test_sha384_snapshot_does_not_finalize_state 🔓 export
📄
sha512.test.vxL22-40
export fn test_sha384_snapshot_does_not_finalize_state(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
test_sha512_empty 🔓 export
📄
sha512.test.vxL42-49
export fn test_sha512_empty(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
test_sha512_abc 🔓 export
📄
sha512.test.vxL51-58
export fn test_sha512_abc(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
test_sha512_check 🔓 export
📄
test_sha.test.vxL5-33
export fn test_sha512_check(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
xSpan
📄
x25519.test.vxL4-6
fn xSpan<const N: usize>(value: &[u8; N]): Span<u8>Type Parameters:
const N: usize
Parameters:
| Name | Type |
|---|---|
value | &[u8; N] |
Returns: Span<u8>
test_x25519_rfc7748 🔓 export
📄
x25519.test.vxL8-31
export fn test_x25519_rfc7748(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
test_x25519_basepoint_bob 🔓 export
📄
x25519.test.vxL33-54
export fn test_x25519_basepoint_bob(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
test_safe_x25519_agreement 🔓 export
📄
x25519.test.vxL56-79
export fn test_safe_x25519_agreement(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
test_safe_x25519_rejects_non_contributory_peer 🔓 export
📄
x25519.test.vxL81-100
export fn test_safe_x25519_rejects_non_contributory_peer(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
test_x25519_caller_owned_to_api_is_allocation_free_and_exact 🔓 export
📄
x25519.test.vxL102-146
export fn test_x25519_caller_owned_to_api_is_allocation_free_and_exact(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
test_x25519_to_api_rejects_alias_and_zeroes_low_order_output 🔓 export
📄
x25519.test.vxL148-181
export fn test_x25519_to_api_rejects_alias_and_zeroes_low_order_output(ctx: &TestCtx!)Parameters:
| Name | Type |
|---|---|
ctx | &TestCtx! |
Methods
ChaCha20Poly1305.sealDetachedInto 🔓 export
📄
api.vxL93-143
export fn ChaCha20Poly1305.sealDetachedInto(key: Span<u8>, nonce: Span<u8>, aad: Span<u8>, plaintext: Span<u8>, output: &Vec<u8>!): Result<[u8; 16], CryptoError>Encrypt into caller-reusable storage and return a detached 128-bit tag.
Source/output overlap is staged before any resize; output is empty on error.
Parameters:
| Name | Type |
|---|---|
key | Span<u8> |
nonce | Span<u8> |
aad | Span<u8> |
plaintext | Span<u8> |
output | &Vec<u8>! |
Returns: Result<[u8; 16], CryptoError>
ChaCha20Poly1305.openDetachedInto 🔓 export
📄
api.vxL147-199
export fn ChaCha20Poly1305.openDetachedInto(key: Span<u8>, nonce: Span<u8>, aad: Span<u8>, ciphertext: Span<u8>, tag: Span<u8>, output: &Vec<u8>!): Result<usize, CryptoError>Authenticate before releasing plaintext into caller-reusable storage.
The output is securely erased and emptied on every failure.
Parameters:
| Name | Type |
|---|---|
key | Span<u8> |
nonce | Span<u8> |
aad | Span<u8> |
ciphertext | Span<u8> |
tag | Span<u8> |
output | &Vec<u8>! |
Returns: Result<usize, CryptoError>
ChaCha20Poly1305.sealInto 🔓 export
📄
api.vxL202-224
export fn ChaCha20Poly1305.sealInto(key: Span<u8>, nonce: Span<u8>, aad: Span<u8>, plaintext: Span<u8>, output: &Vec<u8>!): Result<usize, CryptoError>Encrypt to the conventional ciphertext || tag representation.
Parameters:
| Name | Type |
|---|---|
key | Span<u8> |
nonce | Span<u8> |
aad | Span<u8> |
plaintext | Span<u8> |
output | &Vec<u8>! |
Returns: Result<usize, CryptoError>
ChaCha20Poly1305.openInto 🔓 export
📄
api.vxL227-247
export fn ChaCha20Poly1305.openInto(key: Span<u8>, nonce: Span<u8>, aad: Span<u8>, sealed: Span<u8>, output: &Vec<u8>!): Result<usize, CryptoError>Open a conventional ciphertext || tag value.
Parameters:
| Name | Type |
|---|---|
key | Span<u8> |
nonce | Span<u8> |
aad | Span<u8> |
sealed | Span<u8> |
output | &Vec<u8>! |
Returns: Result<usize, CryptoError>
ChaCha20Poly1305.seal 🔓 export
📄
api.vxL249-257
export fn ChaCha20Poly1305.seal(key: Span<u8>, nonce: Span<u8>, aad: Span<u8>, plaintext: Span<u8>): Result<Vec<u8>, CryptoError>Parameters:
| Name | Type |
|---|---|
key | Span<u8> |
nonce | Span<u8> |
aad | Span<u8> |
plaintext | Span<u8> |
Returns: Result<Vec<u8>, CryptoError>
ChaCha20Poly1305.open 🔓 export
📄
api.vxL259-267
export fn ChaCha20Poly1305.open(key: Span<u8>, nonce: Span<u8>, aad: Span<u8>, sealed: Span<u8>): Result<Vec<u8>, CryptoError>Parameters:
| Name | Type |
|---|---|
key | Span<u8> |
nonce | Span<u8> |
aad | Span<u8> |
sealed | Span<u8> |
Returns: Result<Vec<u8>, CryptoError>
Aes256Gcm.sealDetachedInto 🔓 export
📄
api.vxL405-409
export fn Aes256Gcm.sealDetachedInto(key: Span<u8>, nonce: Span<u8>, aad: Span<u8>, plaintext: Span<u8>, output: &Vec<u8>!): Result<[u8; 16], CryptoError>AES-256-GCM detached encryption with the checked/reusable contract.
Parameters:
| Name | Type |
|---|---|
key | Span<u8> |
nonce | Span<u8> |
aad | Span<u8> |
plaintext | Span<u8> |
output | &Vec<u8>! |
Returns: Result<[u8; 16], CryptoError>
Aes256Gcm.openDetachedInto 🔓 export
📄
api.vxL411-418
export fn Aes256Gcm.openDetachedInto(key: Span<u8>, nonce: Span<u8>, aad: Span<u8>, ciphertext: Span<u8>, tag: Span<u8>, output: &Vec<u8>!): Result<usize, CryptoError>Parameters:
| Name | Type |
|---|---|
key | Span<u8> |
nonce | Span<u8> |
aad | Span<u8> |
ciphertext | Span<u8> |
tag | Span<u8> |
output | &Vec<u8>! |
Returns: Result<usize, CryptoError>
Aes256Gcm.sealInto 🔓 export
📄
api.vxL420-438
export fn Aes256Gcm.sealInto(key: Span<u8>, nonce: Span<u8>, aad: Span<u8>, plaintext: Span<u8>, output: &Vec<u8>!): Result<usize, CryptoError>Parameters:
| Name | Type |
|---|---|
key | Span<u8> |
nonce | Span<u8> |
aad | Span<u8> |
plaintext | Span<u8> |
output | &Vec<u8>! |
Returns: Result<usize, CryptoError>
Aes256Gcm.openInto 🔓 export
📄
api.vxL440-454
export fn Aes256Gcm.openInto(key: Span<u8>, nonce: Span<u8>, aad: Span<u8>, sealed: Span<u8>, output: &Vec<u8>!): Result<usize, CryptoError>Parameters:
| Name | Type |
|---|---|
key | Span<u8> |
nonce | Span<u8> |
aad | Span<u8> |
sealed | Span<u8> |
output | &Vec<u8>! |
Returns: Result<usize, CryptoError>
Aes256Gcm.seal 🔓 export
📄
api.vxL456-464
export fn Aes256Gcm.seal(key: Span<u8>, nonce: Span<u8>, aad: Span<u8>, plaintext: Span<u8>): Result<Vec<u8>, CryptoError>Parameters:
| Name | Type |
|---|---|
key | Span<u8> |
nonce | Span<u8> |
aad | Span<u8> |
plaintext | Span<u8> |
Returns: Result<Vec<u8>, CryptoError>
Aes256Gcm.open 🔓 export
📄
api.vxL466-474
export fn Aes256Gcm.open(key: Span<u8>, nonce: Span<u8>, aad: Span<u8>, sealed: Span<u8>): Result<Vec<u8>, CryptoError>Parameters:
| Name | Type |
|---|---|
key | Span<u8> |
nonce | Span<u8> |
aad | Span<u8> |
sealed | Span<u8> |
Returns: Result<Vec<u8>, CryptoError>
Aes128Gcm.sealDetachedInto 🔓 export
📄
api.vxL477-481
export fn Aes128Gcm.sealDetachedInto(key: Span<u8>, nonce: Span<u8>, aad: Span<u8>, plaintext: Span<u8>, output: &Vec<u8>!): Result<[u8; 16], CryptoError>AES-128-GCM detached encryption for protocols such as TLS 1.3.
Parameters:
| Name | Type |
|---|---|
key | Span<u8> |
nonce | Span<u8> |
aad | Span<u8> |
plaintext | Span<u8> |
output | &Vec<u8>! |
Returns: Result<[u8; 16], CryptoError>
Aes128Gcm.openDetachedInto 🔓 export
📄
api.vxL483-490
export fn Aes128Gcm.openDetachedInto(key: Span<u8>, nonce: Span<u8>, aad: Span<u8>, ciphertext: Span<u8>, tag: Span<u8>, output: &Vec<u8>!): Result<usize, CryptoError>Parameters:
| Name | Type |
|---|---|
key | Span<u8> |
nonce | Span<u8> |
aad | Span<u8> |
ciphertext | Span<u8> |
tag | Span<u8> |
output | &Vec<u8>! |
Returns: Result<usize, CryptoError>
Aes128Gcm.sealInto 🔓 export
📄
api.vxL492-510
export fn Aes128Gcm.sealInto(key: Span<u8>, nonce: Span<u8>, aad: Span<u8>, plaintext: Span<u8>, output: &Vec<u8>!): Result<usize, CryptoError>Usage contract: The combined result is ciphertext followed by the tag; it does not contain the nonce. Keep nonce allocation and key lifetime at the application boundary. See AEAD nonce lifecycle.
Parameters:
| Name | Type | Description |
|---|---|---|
key | Span<u8> | Exactly 16 borrowed key bytes |
nonce | Span<u8> | Exactly 12 borrowed nonce bytes; unique for every encryption under this key |
aad | Span<u8> | Borrowed associated data; identical bytes must be supplied when opening |
plaintext | Span<u8> | Borrowed plaintext bytes; owners remain live for the call |
output | &Vec<u8>! | Reusable owning destination; replaced with ciphertext followed by a 16-byte tag |
Returns: Result<usize, CryptoError>
Aes128Gcm.openInto 🔓 export
📄
api.vxL512-526
export fn Aes128Gcm.openInto(key: Span<u8>, nonce: Span<u8>, aad: Span<u8>, sealed: Span<u8>, output: &Vec<u8>!): Result<usize, CryptoError>Usage contract: Only a successful result authenticates and releases plaintext. A valid tag does not itself enforce replay policy. Inputs are borrowed; the successful owning output can outlive them.
Parameters:
| Name | Type | Description |
|---|---|---|
key | Span<u8> | Exactly 16 borrowed key bytes |
nonce | Span<u8> | Exactly 12 borrowed nonce bytes; unique for every encryption under this key |
aad | Span<u8> | Borrowed associated data; identical bytes must be supplied when opening |
sealed | Span<u8> | Combined ciphertext followed by a 16-byte tag; at least 16 bytes |
output | &Vec<u8>! | Reusable plaintext destination; failure clears its logical sensitive output |
Returns: Result<usize, CryptoError>
Aes128Gcm.seal 🔓 export
📄
api.vxL528-536
export fn Aes128Gcm.seal(key: Span<u8>, nonce: Span<u8>, aad: Span<u8>, plaintext: Span<u8>): Result<Vec<u8>, CryptoError>Usage contract: The combined result is ciphertext followed by the tag; it does not contain the nonce. Keep nonce allocation and key lifetime at the application boundary. See AEAD nonce lifecycle.
Parameters:
| Name | Type | Description |
|---|---|---|
key | Span<u8> | Exactly 16 borrowed key bytes |
nonce | Span<u8> | Exactly 12 borrowed nonce bytes; unique for every encryption under this key |
aad | Span<u8> | Borrowed associated data; identical bytes must be supplied when opening |
plaintext | Span<u8> | Borrowed plaintext bytes; owners remain live for the call |
Returns: Result<Vec<u8>, CryptoError>
Aes128Gcm.open 🔓 export
📄
api.vxL538-546
export fn Aes128Gcm.open(key: Span<u8>, nonce: Span<u8>, aad: Span<u8>, sealed: Span<u8>): Result<Vec<u8>, CryptoError>Usage contract: Only a successful result authenticates and releases plaintext. A valid tag does not itself enforce replay policy. Inputs are borrowed; the successful owning output can outlive them.
Parameters:
| Name | Type | Description |
|---|---|---|
key | Span<u8> | Exactly 16 borrowed key bytes |
nonce | Span<u8> | Exactly 12 borrowed nonce bytes; unique for every encryption under this key |
aad | Span<u8> | Borrowed associated data; identical bytes must be supplied when opening |
sealed | Span<u8> | Combined ciphertext followed by a 16-byte tag; at least 16 bytes |
Returns: Result<Vec<u8>, CryptoError>
HkdfSha256.extract 🔓 export
📄
api.vxL549-565
export fn HkdfSha256.extract(salt: Span<u8>, inputKeyMaterial: Span<u8>): Result<[u8; 32], CryptoError>Extract a fixed 32-byte pseudorandom key without exposing raw pointers.
Parameters:
| Name | Type |
|---|---|
salt | Span<u8> |
inputKeyMaterial | Span<u8> |
Returns: Result<[u8; 32], CryptoError>
HkdfSha256.expandInto 🔓 export
📄
api.vxL569-600
export fn HkdfSha256.expandInto(prk: Span<u8>, info: Span<u8>, outputLength: usize, output: &Vec<u8>!): Result<usize, CryptoError>Expand a 32-byte PRK into caller-reusable storage. RFC 5869's 8160-byte
maximum is enforced before allocation or output mutation.
Parameters:
| Name | Type |
|---|---|
prk | Span<u8> |
info | Span<u8> |
outputLength | usize |
output | &Vec<u8>! |
Returns: Result<usize, CryptoError>
HkdfSha256.deriveInto 🔓 export
📄
api.vxL603-636
export fn HkdfSha256.deriveInto(salt: Span<u8>, inputKeyMaterial: Span<u8>, info: Span<u8>, outputLength: usize, output: &Vec<u8>!): Result<usize, CryptoError>One-shot HKDF-SHA256 derivation into caller-reusable storage.
Parameters:
| Name | Type |
|---|---|
salt | Span<u8> |
inputKeyMaterial | Span<u8> |
info | Span<u8> |
outputLength | usize |
output | &Vec<u8>! |
Returns: Result<usize, CryptoError>
HkdfSha256.derive 🔓 export
📄
api.vxL638-646
export fn HkdfSha256.derive(salt: Span<u8>, inputKeyMaterial: Span<u8>, info: Span<u8>, outputLength: usize): Result<Vec<u8>, CryptoError>Usage contract: Returns an independent owning byte vector. Length failure is typed; use distinct context values for distinct protocol purposes. See HKDF guidance.
Parameters:
| Name | Type | Description |
|---|---|---|
salt | Span<u8> | Borrowed HKDF salt bytes |
inputKeyMaterial | Span<u8> | Borrowed input keying material; this is not a password-stretching API |
info | Span<u8> | Borrowed protocol-purpose/context bytes |
outputLength | usize | Requested bytes, at most 8160 (255 SHA-256 digest blocks) |
Returns: Result<Vec<u8>, CryptoError>
HkdfSha384.extract 🔓 export
📄
api.vxL649-665
export fn HkdfSha384.extract(salt: Span<u8>, inputKeyMaterial: Span<u8>): Result<[u8; 48], CryptoError>Extract a fixed 48-byte SHA-384 pseudorandom key through safe spans.
Parameters:
| Name | Type |
|---|---|
salt | Span<u8> |
inputKeyMaterial | Span<u8> |
Returns: Result<[u8; 48], CryptoError>
HkdfSha384.expandInto 🔓 export
📄
api.vxL669-697
export fn HkdfSha384.expandInto(prk: Span<u8>, info: Span<u8>, outputLength: usize, output: &Vec<u8>!): Result<usize, CryptoError>Expand a 48-byte PRK into caller-reusable storage. RFC 5869's 12240-byte
SHA-384 maximum is enforced before allocation or output mutation.
Parameters:
| Name | Type |
|---|---|
prk | Span<u8> |
info | Span<u8> |
outputLength | usize |
output | &Vec<u8>! |
Returns: Result<usize, CryptoError>
HkdfSha384.deriveInto 🔓 export
📄
api.vxL699-733
export fn HkdfSha384.deriveInto(salt: Span<u8>, inputKeyMaterial: Span<u8>, info: Span<u8>, outputLength: usize, output: &Vec<u8>!): Result<usize, CryptoError>Parameters:
| Name | Type |
|---|---|
salt | Span<u8> |
inputKeyMaterial | Span<u8> |
info | Span<u8> |
outputLength | usize |
output | &Vec<u8>! |
Returns: Result<usize, CryptoError>
HkdfSha384.derive 🔓 export
📄
api.vxL735-745
export fn HkdfSha384.derive(salt: Span<u8>, inputKeyMaterial: Span<u8>, info: Span<u8>, outputLength: usize): Result<Vec<u8>, CryptoError>Parameters:
| Name | Type |
|---|---|
salt | Span<u8> |
inputKeyMaterial | Span<u8> |
info | Span<u8> |
outputLength | usize |
Returns: Result<Vec<u8>, CryptoError>
Pbkdf2Sha256.deriveInto 🔓 export
📄
api.vxL750-788
export fn Pbkdf2Sha256.deriveInto(password: Span<u8>, salt: Span<u8>, iterations: u64, outputLength: usize, output: &Vec<u8>!): Result<usize, CryptoError>PBKDF2-HMAC-SHA256 into reusable storage. Iteration count and RFC output
block limit are validated before output mutation; all intermediate U/T blocks are securely erased by the kernel.
Parameters:
| Name | Type |
|---|---|
password | Span<u8> |
salt | Span<u8> |
iterations | u64 |
outputLength | usize |
output | &Vec<u8>! |
Returns: Result<usize, CryptoError>
Pbkdf2Sha256.derive 🔓 export
📄
api.vxL790-798
export fn Pbkdf2Sha256.derive(password: Span<u8>, salt: Span<u8>, iterations: u64, outputLength: usize): Result<Vec<u8>, CryptoError>Parameters:
| Name | Type |
|---|---|
password | Span<u8> |
salt | Span<u8> |
iterations | u64 |
outputLength | usize |
Returns: Result<Vec<u8>, CryptoError>
X25519.publicKeyTo 🔓 export
📄
api.vxL801-828
export fn X25519.publicKeyTo(privateKey: Span<u8>, output: &Span<u8>!): Result<usize, CryptoError>Derive an X25519 public key from an exact 32-byte private scalar.
Parameters:
| Name | Type |
|---|---|
privateKey | Span<u8> |
output | &Span<u8>! |
Returns: Result<usize, CryptoError>
X25519.publicKeyInto 🔓 export
📄
api.vxL831-848
export fn X25519.publicKeyInto(privateKey: Span<u8>, output: &Vec<u8>!): Result<usize, CryptoError>Derive an X25519 public key into reusable owned storage.
Parameters:
| Name | Type |
|---|---|
privateKey | Span<u8> |
output | &Vec<u8>! |
Returns: Result<usize, CryptoError>
X25519.publicKey 🔓 export
📄
api.vxL850-864
export fn X25519.publicKey(privateKey: Span<u8>): Result<[u8; 32], CryptoError>Parameters:
| Name | Type |
|---|---|
privateKey | Span<u8> |
Returns: Result<[u8; 32], CryptoError>
X25519.sharedSecretTo 🔓 export
📄
api.vxL871-922
export fn X25519.sharedSecretTo(privateKey: Span<u8>, peerPublicKey: Span<u8>, output: &Span<u8>!): Result<usize, CryptoError>Usage contract: Returns 32 on success. The all-zero shared result clears the destination and returns InvalidPublicKey. Dimension/overlap checks run before the operation; the raw span still requires valid live backing storage. X25519 alone does not authenticate the peer.
Compute a contributory X25519 shared secret. RFC 7748 permits callers to
reject an all-zero result; this safe API always rejects it in constant time so low-order public keys cannot silently collapse the handshake secret. The caller-owned output is exact-width, allocation-free, and zeroed before returning InvalidPublicKey for a non-contributory peer.
Parameters:
| Name | Type | Description |
|---|---|---|
privateKey | Span<u8> | Exactly 32 readable private-scalar bytes |
peerPublicKey | Span<u8> | Exactly 32 readable peer-key bytes |
output | &Span<u8>! | Exactly 32 writable bytes; must overlap neither input |
Returns: Result<usize, CryptoError>
X25519.sharedSecretInto 🔓 export
📄
api.vxL925-956
export fn X25519.sharedSecretInto(privateKey: Span<u8>, peerPublicKey: Span<u8>, output: &Vec<u8>!): Result<usize, CryptoError>Compute a contributory X25519 shared secret into reusable owned storage.
Parameters:
| Name | Type |
|---|---|
privateKey | Span<u8> |
peerPublicKey | Span<u8> |
output | &Vec<u8>! |
Returns: Result<usize, CryptoError>
X25519.sharedSecret 🔓 export
📄
api.vxL958-970
export fn X25519.sharedSecret(privateKey: Span<u8>, peerPublicKey: Span<u8>): Result<[u8; 32], CryptoError>Parameters:
| Name | Type |
|---|---|
privateKey | Span<u8> |
peerPublicKey | Span<u8> |
Returns: Result<[u8; 32], CryptoError>
Ed25519.publicKey 🔓 export
📄
api.vxL973-987
export fn Ed25519.publicKey(privateSeed: Span<u8>): Result<[u8; 32], CryptoError>Derive the RFC 8032 public key for an exact 32-byte private seed.
Parameters:
| Name | Type |
|---|---|
privateSeed | Span<u8> |
Returns: Result<[u8; 32], CryptoError>
Ed25519.signInto 🔓 export
📄
api.vxL991-1024
export fn Ed25519.signInto(privateSeed: Span<u8>, message: Span<u8>, output: &Vec<u8>!): Result<usize, CryptoError>Deterministically sign a message into caller-reusable storage. The private
seed and message may alias the output; both are staged before resize.
Parameters:
| Name | Type |
|---|---|
privateSeed | Span<u8> |
message | Span<u8> |
output | &Vec<u8>! |
Returns: Result<usize, CryptoError>
Ed25519.sign 🔓 export
📄
api.vxL1026-1052
export fn Ed25519.sign(privateSeed: Span<u8>, message: Span<u8>): Result<[u8; 64], CryptoError>Parameters:
| Name | Type |
|---|---|
privateSeed | Span<u8> |
message | Span<u8> |
Returns: Result<[u8; 64], CryptoError>
Ed25519.verify 🔓 export
📄
api.vxL1057-1089
export fn Ed25519.verify(publicKey: Span<u8>, message: Span<u8>, signature: Span<u8>): Result<bool, CryptoError>Usage contract: Accept only Ok(true). Ok(false) means signature rejection; invalid dimensions produce a typed error. Public-key identity/trust is a separate application responsibility.
Strict verification: canonical encodings, canonical S, and non-small-order
R/public-key points are required. Dimension errors are typed; a well-formed but invalid signature returns Ok(false).
Parameters:
| Name | Type | Description |
|---|---|---|
publicKey | Span<u8> | Exactly 32 borrowed Ed25519 public-key bytes |
message | Span<u8> | Borrowed message bytes; no mutation or retention |
signature | Span<u8> | Exactly 64 borrowed signature bytes |
Returns: Result<bool, CryptoError>
Argon2Parameters.new 🔓 export
📄
argon2id.vxL762-772
export fn Argon2Parameters.new(timeCost: u64, memoryKiB: u64, parallelism: u64): Argon2ParametersParameters:
| Name | Type |
|---|---|
timeCost | u64 |
memoryKiB | u64 |
parallelism | u64 |
Returns: Argon2Parameters
Argon2Parameters.recommended 🔓 export
📄
argon2id.vxL777-779
export fn Argon2Parameters.recommended(): Argon2ParametersRFC 9106's memory-constrained recommendation: 64 MiB, three passes and
four lanes. Applications should benchmark and increase memory when their deployment budget permits it.
Returns: Argon2Parameters
Argon2id.deriveInto 🔓 export
📄
argon2id.vxL827-843
export fn Argon2id.deriveInto(password: Span<u8>, salt: Span<u8>, parameters: Argon2Parameters, outputLength: usize, output: &Vec<u8>!): Result<usize, CryptoError>Derive into caller-reusable storage. Input/output aliases are staged before
Vec growth and every failure leaves output empty and securely erased.
Parameters:
| Name | Type |
|---|---|
password | Span<u8> |
salt | Span<u8> |
parameters | Argon2Parameters |
outputLength | usize |
output | &Vec<u8>! |
Returns: Result<usize, CryptoError>
Argon2id.deriveExInto 🔓 export
📄
argon2id.vxL847-907
export fn Argon2id.deriveExInto(password: Span<u8>, salt: Span<u8>, secret: Span<u8>, associatedData: Span<u8>, parameters: Argon2Parameters, outputLength: usize, output: &Vec<u8>!): Result<usize, CryptoError>RFC 9106 extended derivation with an optional secret (pepper) and
associated data. The secret is mixed into H0 and is never copied to output.
Parameters:
| Name | Type |
|---|---|
password | Span<u8> |
salt | Span<u8> |
secret | Span<u8> |
associatedData | Span<u8> |
parameters | Argon2Parameters |
outputLength | usize |
output | &Vec<u8>! |
Returns: Result<usize, CryptoError>
Argon2id.derive 🔓 export
📄
argon2id.vxL909-920
export fn Argon2id.derive(password: Span<u8>, salt: Span<u8>, parameters: Argon2Parameters, outputLength: usize): Result<Vec<u8>, CryptoError>Parameters:
| Name | Type |
|---|---|
password | Span<u8> |
salt | Span<u8> |
parameters | Argon2Parameters |
outputLength | usize |
Returns: Result<Vec<u8>, CryptoError>
Argon2id.deriveEx 🔓 export
📄
argon2id.vxL922-937
export fn Argon2id.deriveEx(password: Span<u8>, salt: Span<u8>, secret: Span<u8>, associatedData: Span<u8>, parameters: Argon2Parameters, outputLength: usize): Result<Vec<u8>, CryptoError>Parameters:
| Name | Type |
|---|---|
password | Span<u8> |
salt | Span<u8> |
secret | Span<u8> |
associatedData | Span<u8> |
parameters | Argon2Parameters |
outputLength | usize |
Returns: Result<Vec<u8>, CryptoError>
CryptoError.new 🔓 export
📄
contracts.vxL25-31
export fn CryptoError.new(kind: CryptoErrorKind, requested: u64, limit: u64): CryptoErrorParameters:
| Name | Type |
|---|---|
kind | CryptoErrorKind |
requested | u64 |
limit | u64 |
Returns: CryptoError
message 🔓 export
📄
contracts.vxL33-46
export fn (self: &CryptoError) message(): strReceiver: self: &CryptoError (immutable reference)
Returns: str
Digest32.reset
📄
contracts.vxL49-49
reset()!;This is the reset requirement of Digest32, not a free function.
Digest32.update
📄
contracts.vxL50-50
update(data: str)!;This is the update requirement of Digest32, not a free function.
Parameters:
| Name | Type |
|---|---|
data | str |
Digest32.updateRaw
📄
contracts.vxL51-51
updateRaw(data: RawBuf, len: u64)!;This is the updateRaw requirement of Digest32, not a free function.
Parameters:
| Name | Type |
|---|---|
data | RawBuf |
len | u64 |
Digest32.sum
📄
contracts.vxL52-52
sum(out: Ptr<u8>, out_len: u64)!;This is the sum requirement of Digest32, not a free function.
Parameters:
| Name | Type |
|---|---|
out | Ptr<u8> |
out_len | u64 |
Mac32.reset
📄
contracts.vxL56-56
reset()!;This is the reset requirement of Mac32, not a free function.
Mac32.update
📄
contracts.vxL57-57
update(data: str)!;This is the update requirement of Mac32, not a free function.
Parameters:
| Name | Type |
|---|---|
data | str |
Mac32.updateRaw
📄
contracts.vxL58-58
updateRaw(data: RawBuf, len: u64)!;This is the updateRaw requirement of Mac32, not a free function.
Parameters:
| Name | Type |
|---|---|
data | RawBuf |
len | u64 |
Mac32.final
📄
contracts.vxL59-59
final(out: Ptr<u8>, out_len: u64)!;This is the final requirement of Mac32, not a free function.
Parameters:
| Name | Type |
|---|---|
out | Ptr<u8> |
out_len | u64 |
Poly1305.new 🔓 export
📄
poly1305.vxL21-67
export fn Poly1305.new(key: RawBuf, key_len: usize): Poly1305Parameters:
| Name | Type |
|---|---|
key | RawBuf |
key_len | usize |
Returns: Poly1305
update 🔓 export
📄
poly1305.vxL75-117
export fn (self: &Poly1305!) update(data: RawBuf, len: usize)Receiver: self: &Poly1305! (mutable reference)
Parameters:
| Name | Type |
|---|---|
data | RawBuf |
len | usize |
processBufferedBlock
📄
poly1305.vxL119-126
fn (self: &Poly1305!) processBufferedBlock(hibit: u32)Receiver: self: &Poly1305! (mutable reference)
Parameters:
| Name | Type |
|---|---|
hibit | u32 |
processDataBlock
📄
poly1305.vxL128-134
fn (self: &Poly1305!) processDataBlock(data: RawBuf, offset: usize)Receiver: self: &Poly1305! (mutable reference)
Parameters:
| Name | Type |
|---|---|
data | RawBuf |
offset | usize |
processWords
📄
poly1305.vxL137-197
fn (self: &Poly1305!) processWords(t0: u32, t1: u32, t2: u32, t3: u32, hibit: u32)Receiver: self: &Poly1305! (mutable reference)
Parameters:
| Name | Type |
|---|---|
t0 | u32 |
t1 | u32 |
t2 | u32 |
t3 | u32 |
hibit | u32 |
finalize 🔓 export
📄
poly1305.vxL200-315
export fn (self: &Poly1305!) finalize(): [u8; 16]Receiver: self: &Poly1305! (mutable reference)
Returns: [u8; 16]
Sha1.new 🔓 export
📄
sha1.vxL14-32
export fn Sha1.new(): Sha1Returns: Sha1
processBlock
📄
sha1.vxL39-112
fn (self: &Sha1!) processBlock(block: RawBuf)Receiver: self: &Sha1! (mutable reference)
Parameters:
| Name | Type |
|---|---|
block | RawBuf |
reset 🔓 export
📄
sha1.vxL114-122
export fn (self: &Sha1!) reset()!Receiver: self: &Sha1! (mutable reference)
update 🔓 export
📄
sha1.vxL124-126
export fn (self: &Sha1!) update(data: str)Receiver: self: &Sha1! (mutable reference)
Parameters:
| Name | Type |
|---|---|
data | str |
updateRaw 🔓 export
📄
sha1.vxL128-143
export fn (self: &Sha1!) updateRaw(data: RawBuf, len: u64)Receiver: self: &Sha1! (mutable reference)
Parameters:
| Name | Type |
|---|---|
data | RawBuf |
len | u64 |
sum 🔓 export
📄
sha1.vxL145-188
export fn (self: &Sha1!) sum(out: Ptr<u8>, out_len: u64)!Receiver: self: &Sha1! (mutable reference)
Parameters:
| Name | Type |
|---|---|
out | Ptr<u8> |
out_len | u64 |
Sha256.new 🔓 export
📄
sha256.vxL41-62
export fn Sha256.new(): Sha256Returns: Sha256
processBlock
📄
sha256.vxL69-128
fn (self: &Sha256!) processBlock(block: RawBuf, offset: usize)Receiver: self: &Sha256! (mutable reference)
Parameters:
| Name | Type |
|---|---|
block | RawBuf |
offset | usize |
reset 🔓 export
📄
sha256.vxL130-141
export fn (self: &Sha256!) reset()!Receiver: self: &Sha256! (mutable reference)
update 🔓 export
📄
sha256.vxL143-145
export fn (self: &Sha256!) update(data: str)Receiver: self: &Sha256! (mutable reference)
Parameters:
| Name | Type |
|---|---|
data | str |
updateRaw 🔓 export
📄
sha256.vxL147-175
export fn (self: &Sha256!) updateRaw(data: RawBuf, len: u64)Receiver: self: &Sha256! (mutable reference)
Parameters:
| Name | Type |
|---|---|
data | RawBuf |
len | u64 |
sum 🔓 export
📄
sha256.vxL177-220
export fn (self: &Sha256!) sum(out: Ptr<u8>, out_len: u64)!Receiver: self: &Sha256! (mutable reference)
Parameters:
| Name | Type |
|---|---|
out | Ptr<u8> |
out_len | u64 |
snapshotTo 🔓 export
📄
sha256.vxL228-243
export fn (self: &Sha256) snapshotTo(out: Ptr<u8>, outLen: u64): boolWrites the digest of the current state without consuming or finalizing it.
Hash-state cloning is deliberately explicit instead of making Sha256Copy: callers can take protocol snapshots without enabling accidental silent duplication of cryptographic state. The temporary state is erased before this function returns.
Receiver: self: &Sha256 (immutable reference)
Parameters:
| Name | Type |
|---|---|
out | Ptr<u8> |
outLen | u64 |
Returns: bool
Sha512.new 🔓 export
📄
sha512.vxL81-85
export fn Sha512.new(): Sha512Returns: Sha512
init 🔓 export
📄
sha512.vxL87-105
export fn (self: &Sha512!) init()Receiver: self: &Sha512! (mutable reference)
init384
📄
sha512.vxL107-125
fn (self: &Sha512!) init384()Receiver: self: &Sha512! (mutable reference)
Sha384.new 🔓 export
📄
sha512.vxL127-131
export fn Sha384.new(): Sha384Returns: Sha384
processBlock512
📄
sha512.vxL133-189
fn (self: &Sha512!) processBlock512(block: RawBuf, offset: usize)Receiver: self: &Sha512! (mutable reference)
Parameters:
| Name | Type |
|---|---|
block | RawBuf |
offset | usize |
update512 🔓 export
📄
sha512.vxL191-193
export fn (self: &Sha512!) update512(data: str)Receiver: self: &Sha512! (mutable reference)
Parameters:
| Name | Type |
|---|---|
data | str |
updateRaw512 🔓 export
📄
sha512.vxL195-226
export fn (self: &Sha512!) updateRaw512(data: RawBuf, len: u64)Receiver: self: &Sha512! (mutable reference)
Parameters:
| Name | Type |
|---|---|
data | RawBuf |
len | u64 |
sum512Family
📄
sha512.vxL228-282
fn (self: &Sha512!) sum512Family(out: Ptr<u8>, outLen: u64, digestLen: u64)Receiver: self: &Sha512! (mutable reference)
Parameters:
| Name | Type |
|---|---|
out | Ptr<u8> |
outLen | u64 |
digestLen | u64 |
sum512 🔓 export
📄
sha512.vxL284-286
export fn (self: &Sha512!) sum512(out: Ptr<u8>, outLen: u64)Receiver: self: &Sha512! (mutable reference)
Parameters:
| Name | Type |
|---|---|
out | Ptr<u8> |
outLen | u64 |
update384 🔓 export
📄
sha512.vxL288-290
export fn (self: &Sha384!) update384(data: str)Receiver: self: &Sha384! (mutable reference)
Parameters:
| Name | Type |
|---|---|
data | str |
updateRaw384 🔓 export
📄
sha512.vxL292-294
export fn (self: &Sha384!) updateRaw384(data: RawBuf, len: u64)Receiver: self: &Sha384! (mutable reference)
Parameters:
| Name | Type |
|---|---|
data | RawBuf |
len | u64 |
sum384 🔓 export
📄
sha512.vxL296-298
export fn (self: &Sha384!) sum384(out: Ptr<u8>, outLen: u64)Receiver: self: &Sha384! (mutable reference)
Parameters:
| Name | Type |
|---|---|
out | Ptr<u8> |
outLen | u64 |
reset384 🔓 export
📄
sha512.vxL301-303
export fn (self: &Sha384!) reset384()Resets a SHA-384 state to its FIPS 180-4 initial value.
Receiver: self: &Sha384! (mutable reference)
snapshotTo 🔓 export
📄
sha512.vxL307-322
export fn (self: &Sha384) snapshotTo(out: Ptr<u8>, outLen: u64): boolWrites the digest of the current state without consuming or finalizing it.
The explicitly cloned temporary state is erased before returning.
Receiver: self: &Sha384 (immutable reference)
Parameters:
| Name | Type |
|---|---|
out | Ptr<u8> |
outLen | u64 |
Returns: bool
Generated by vex-doc v2.0 • 2026-10-28