Skip to main content

Module wasm

Module wasm 

Source
Expand description

WebAssembly bindings for lib-Q

This module provides JavaScript-compatible bindings for use in web applications. It integrates with the new modular architecture and provides comprehensive cryptographic functionality for web environments.

Modules§

contexts
WASM-compatible context wrappers
conversions
WASM conversion helpers between Rust buffers and JavaScript js_sys::Uint8Array.
error
WASM Error Handling Module
providers
WASM-compatible provider bindings
secure_contexts
Secure WASM Contexts
utils
WASM utility functions

Structs§

SecureWasmAeadContext
Secure WASM AEAD Context
SecureWasmHashContext
Secure WASM Hash Context
SecureWasmKemContext
Secure WASM KEM Context
SecureWasmSignatureContext
Secure WASM Signature Context
WasmAeadContext
WASM-compatible AEAD context wrapper
WasmConversions
Byte-array conversion helpers for WASM bindings.
WasmCryptoProvider
WASM-compatible CryptoProvider wrapper
WasmHashContext
WASM-compatible Hash context wrapper
WasmKemContext
WASM-compatible KEM context wrapper
WasmProviderFactory
WASM-compatible provider factory
WasmProviderManager
WASM-compatible provider manager
WasmSignatureContext
WASM-compatible Signature context wrapper

Constants§

WASM_SIGNATURE_ALGORITHM_IDS
Canonical WASM signature algorithm id strings for listings (WasmSignatureContext, WasmProviderManager, JSON summaries). Matches WasmConversions::algorithm_to_string for SLH.

Functions§

bytes_to_hex
Convert bytes to hexadecimal string
bytes_to_hex_wasm
Convert bytes to hexadecimal string
convert_result
Helper function to convert Result<T, Error> to Result<T, JsValue>
create_aead_context
Create an AEAD context for WASM backed by lib-q-aead (same wiring as libq::aead::context).
create_hash_context
Create a new Hash context for WASM backed by lib-q-hash (same wiring as crate::create_hash_context).
create_kem_context
Create a new KEM context for WASM
create_provider_manager
Create a new provider manager for WASM
create_signature_context
Create a new Signature context for WASM backed by lib-q-sig (same wiring as native SignatureContext with LibQSignatureProvider).
error_to_js_value
Convert Error to JsValue for WASM compatibility
generate_random_bytes
Generate secure random bytes for WASM
get_library_info
Get library information for WASM
get_library_info_wasm
Get library information for WASM
get_performance_benchmarks_wasm
Get performance benchmarks
get_security_recommendations_wasm
Get security recommendations
get_supported_algorithms
Get supported algorithms by category
get_supported_algorithms_wasm
Get supported algorithms by category
get_version
Get the library version
hex_to_bytes
Convert hexadecimal string to bytes
hex_to_bytes_wasm
Convert hexadecimal string to bytes
init_wasm
Initialize the library for WASM usage
is_algorithm_supported_wasm
Check if an algorithm is supported
is_feature_available
Check if a feature is available
parse_algorithm_wasm
WASM-safe algorithm parsing that returns JsValue errors
random_bytes
Generate cryptographically secure random bytes for WASM
secure_deserialize
Secure WASM deserialization helper
secure_serialize
Secure WASM serialization helper
validate_input
Validate input data for WASM operations