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<B: Borrow<ManagedBuffer<A>>>( &self, data: B ) -> ManagedByteArray<A, SHA256_RESULT_LEN>
pub fn sha256_legacy_managed<const MAX_INPUT_LEN: usize>( &self, data: &ManagedBuffer<A> ) -> ManagedByteArray<A, SHA256_RESULT_LEN>
👎Deprecated since 0.31.0: Method no longer needed, use
sha256 instead, functionality is available on mainnet.pub fn keccak256<B: Borrow<ManagedBuffer<A>>>( &self, data: B ) -> ManagedByteArray<A, KECCAK256_RESULT_LEN>
pub fn keccak256_legacy_managed<const MAX_INPUT_LEN: usize>( &self, data: &ManagedBuffer<A> ) -> ManagedByteArray<A, KECCAK256_RESULT_LEN>
👎Deprecated since 0.31.0: Method no longer needed, use
keccak256 instead, functionality is available on mainnet.pub fn verify_bls_legacy( &self, key: &[u8], message: &[u8], signature: &[u8] ) -> bool
pub fn verify_ed25519_legacy( &self, key: &[u8], message: &[u8], signature: &[u8] ) -> bool
pub fn verify_ed25519_legacy_managed<const MAX_MESSAGE_LEN: usize>( &self, key: &ManagedByteArray<A, ED25519_KEY_BYTE_LEN>, message: &ManagedBuffer<A>, signature: &ManagedByteArray<A, ED25519_SIGNATURE_BYTE_LEN> ) -> bool
sourcepub fn verify_secp256k1_legacy(
&self,
key: &[u8],
message: &[u8],
signature: &[u8]
) -> bool
pub fn verify_secp256k1_legacy( &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_legacy( &self, key: &[u8], message: &[u8], signature: &[u8], hash_type: MessageHashType ) -> bool
Trait Implementations§
Auto Trait Implementations§
impl<A> CodecFromSelf for CryptoWrapper<A>where
A: CodecFromSelf,
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