Struct dharitri_wasm::contract_base::CryptoWrapper
source · pub struct CryptoWrapper<A>where
A: CryptoApi,{ /* private fields */ }Implementations§
source§impl<A> CryptoWrapper<A>where
A: CryptoApi,
impl<A> CryptoWrapper<A>where
A: CryptoApi,
pub fn sha256_legacy(&self, data: &[u8]) -> H256
pub fn sha256<B: Borrow<ManagedBuffer<A>>>( &self, data: B ) -> ManagedByteArray<A, 32>
pub fn keccak256_legacy(&self, data: &[u8]) -> H256
pub fn keccak256<B: Borrow<ManagedBuffer<A>>>( &self, data: B ) -> ManagedByteArray<A, 32>
pub fn ripemd160(&self, data: &[u8]) -> Box<[u8; 20]>
pub fn verify_bls(&self, key: &[u8], message: &[u8], signature: &[u8]) -> bool
pub fn verify_ed25519( &self, key: &[u8], message: &[u8], signature: &[u8] ) -> bool
sourcepub fn verify_secp256k1(
&self,
key: &[u8],
message: &[u8],
signature: &[u8]
) -> bool
pub fn verify_secp256k1( &self, key: &[u8], message: &[u8], signature: &[u8] ) -> bool
Note: the signature is minimum 2 bytes in length, the second byte encodes the length of the remaining signature bytes.
pub fn verify_custom_secp256k1( &self, key: &[u8], message: &[u8], signature: &[u8], hash_type: MessageHashType ) -> bool
pub fn encode_secp256k1_der_signature(&self, r: &[u8], s: &[u8]) -> BoxedBytes
Trait Implementations§
Auto Trait Implementations§
impl<A> RefUnwindSafe for CryptoWrapper<A>where
A: RefUnwindSafe,
impl<A> Send for CryptoWrapper<A>where
A: Send,
impl<A> Sync for CryptoWrapper<A>where
A: Sync,
impl<A> Unpin for CryptoWrapper<A>where
A: Unpin,
impl<A> UnwindSafe for CryptoWrapper<A>where
A: UnwindSafe,
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