pub struct LibQ { /* private fields */ }
Expand description
Main WASM API for lib-Q
Implementations§
Source§impl LibQ
impl LibQ
Sourcepub fn random_bytes(&self, length: usize) -> StdResult<Uint8Array, JsValue>
pub fn random_bytes(&self, length: usize) -> StdResult<Uint8Array, JsValue>
Generate random bytes
Sourcepub fn random_key(&self, size: usize) -> StdResult<Uint8Array, JsValue>
pub fn random_key(&self, size: usize) -> StdResult<Uint8Array, JsValue>
Generate a random key
Sourcepub fn bytes_to_hex(&self, bytes: &Uint8Array) -> String
pub fn bytes_to_hex(&self, bytes: &Uint8Array) -> String
Convert bytes to hex string
Sourcepub fn hex_to_bytes(&self, hex: &str) -> StdResult<Uint8Array, JsValue>
pub fn hex_to_bytes(&self, hex: &str) -> StdResult<Uint8Array, JsValue>
Convert hex string to bytes
Sourcepub fn hash_shake256(
&self,
data: &Uint8Array,
) -> StdResult<HashResultWasm, JsValue>
pub fn hash_shake256( &self, data: &Uint8Array, ) -> StdResult<HashResultWasm, JsValue>
Hash data using SHAKE256
Sourcepub fn kem_generate_keypair(
&self,
algorithm: &str,
security_level: u32,
) -> StdResult<KemKeyPairWasm, JsValue>
pub fn kem_generate_keypair( &self, algorithm: &str, security_level: u32, ) -> StdResult<KemKeyPairWasm, JsValue>
Generate KEM key pair (placeholder implementation)
Sourcepub fn sig_generate_keypair(
&self,
algorithm: &str,
security_level: u32,
) -> StdResult<SigKeyPairWasm, JsValue>
pub fn sig_generate_keypair( &self, algorithm: &str, security_level: u32, ) -> StdResult<SigKeyPairWasm, JsValue>
Generate signature key pair (placeholder implementation)
Sourcepub fn get_supported_algorithms(&self) -> Object
pub fn get_supported_algorithms(&self) -> Object
Get supported algorithms
Trait Implementations§
Source§impl FromWasmAbi for LibQ
impl FromWasmAbi for LibQ
Source§impl IntoWasmAbi for LibQ
impl IntoWasmAbi for LibQ
Source§impl LongRefFromWasmAbi for LibQ
impl LongRefFromWasmAbi for LibQ
Source§impl OptionFromWasmAbi for LibQ
impl OptionFromWasmAbi for LibQ
Source§impl OptionIntoWasmAbi for LibQ
impl OptionIntoWasmAbi for LibQ
Source§impl RefFromWasmAbi for LibQ
impl RefFromWasmAbi for LibQ
Source§impl RefMutFromWasmAbi for LibQ
impl RefMutFromWasmAbi for LibQ
Source§impl TryFromJsValue for LibQ
impl TryFromJsValue for LibQ
Source§impl VectorFromWasmAbi for LibQ
impl VectorFromWasmAbi for LibQ
Source§impl VectorIntoWasmAbi for LibQ
impl VectorIntoWasmAbi for LibQ
impl SupportsConstructor for LibQ
impl SupportsInstanceProperty for LibQ
impl SupportsStaticProperty for LibQ
Auto Trait Implementations§
impl Freeze for LibQ
impl RefUnwindSafe for LibQ
impl Send for LibQ
impl Sync for LibQ
impl Unpin for LibQ
impl UnwindSafe for LibQ
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
Source§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
Same as
IntoWasmAbi::Abi
Source§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
Same as
IntoWasmAbi::into_abi
, except that it may throw and never
return in the case of Err
.