pub struct EtfApiWrapper { /* private fields */ }Expand description
a wrapper around the DefaultEtfClient so that it can be compiled to wasm
Implementations§
Source§impl EtfApiWrapper
impl EtfApiWrapper
Sourcepub fn create(p: JsValue, q: JsValue) -> Self
pub fn create(p: JsValue, q: JsValue) -> Self
p and q are the IBE parameters, both elements of G2
pub fn version(&self) -> JsValue
Sourcepub fn encrypt(
&self,
message_bytes: JsValue,
slot_id_bytes: JsValue,
t: u8,
seed_bytes: JsValue,
) -> Result<JsValue, JsError>
pub fn encrypt( &self, message_bytes: JsValue, slot_id_bytes: JsValue, t: u8, seed_bytes: JsValue, ) -> Result<JsValue, JsError>
a wrapper function around the DefaultApi ‘encrypt’ implementation returns a ciphertext blob containing both aes ct and etf ct
pub fn decrypt( &self, ciphertext_bytes: JsValue, nonce_bytes: JsValue, capsule_bytes: JsValue, sks_bytes: JsValue, ) -> Result<JsValue, JsError>
Trait Implementations§
Source§impl From<EtfApiWrapper> for JsValue
impl From<EtfApiWrapper> for JsValue
Source§fn from(value: EtfApiWrapper) -> Self
fn from(value: EtfApiWrapper) -> Self
Converts to this type from the input type.
Source§impl FromWasmAbi for EtfApiWrapper
impl FromWasmAbi for EtfApiWrapper
Source§impl IntoWasmAbi for EtfApiWrapper
impl IntoWasmAbi for EtfApiWrapper
Source§impl LongRefFromWasmAbi for EtfApiWrapper
impl LongRefFromWasmAbi for EtfApiWrapper
Source§impl OptionFromWasmAbi for EtfApiWrapper
impl OptionFromWasmAbi for EtfApiWrapper
Source§impl OptionIntoWasmAbi for EtfApiWrapper
impl OptionIntoWasmAbi for EtfApiWrapper
Source§impl RefFromWasmAbi for EtfApiWrapper
impl RefFromWasmAbi for EtfApiWrapper
Source§type Anchor = RcRef<EtfApiWrapper>
type Anchor = RcRef<EtfApiWrapper>
The type that holds the reference to
Self for the duration of the
invocation of the function that has an &Self parameter. This is
required to ensure that the lifetimes don’t persist beyond one function
call, and so that they remain anonymous.Source§impl RefMutFromWasmAbi for EtfApiWrapper
impl RefMutFromWasmAbi for EtfApiWrapper
Source§impl TryFromJsValue for EtfApiWrapper
impl TryFromJsValue for EtfApiWrapper
Source§impl VectorFromWasmAbi for EtfApiWrapper
impl VectorFromWasmAbi for EtfApiWrapper
type Abi = <Box<[JsValue]> as FromWasmAbi>::Abi
unsafe fn vector_from_abi(js: Self::Abi) -> Box<[EtfApiWrapper]>
Source§impl VectorIntoWasmAbi for EtfApiWrapper
impl VectorIntoWasmAbi for EtfApiWrapper
type Abi = <Box<[JsValue]> as IntoWasmAbi>::Abi
fn vector_into_abi(vector: Box<[EtfApiWrapper]>) -> Self::Abi
Source§impl WasmDescribeVector for EtfApiWrapper
impl WasmDescribeVector for EtfApiWrapper
impl SupportsConstructor for EtfApiWrapper
impl SupportsInstanceProperty for EtfApiWrapper
impl SupportsStaticProperty for EtfApiWrapper
Auto Trait Implementations§
impl Freeze for EtfApiWrapper
impl RefUnwindSafe for EtfApiWrapper
impl !Send for EtfApiWrapper
impl !Sync for EtfApiWrapper
impl Unpin for EtfApiWrapper
impl UnwindSafe for EtfApiWrapper
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§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::AbiSource§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.