Struct scrypto::crypto_utils::crypto_utils::CryptoUtils
source · pub struct CryptoUtils {}
Expand description
Crypto utilities.
Implementations§
source§impl CryptoUtils
impl CryptoUtils
sourcepub fn bls12381_v1_verify(
message: Vec<u8>,
public_key: Bls12381G1PublicKey,
signature: Bls12381G2Signature
) -> bool
pub fn bls12381_v1_verify( message: Vec<u8>, public_key: Bls12381G1PublicKey, signature: Bls12381G2Signature ) -> bool
Performs BLS12-381 G2 signature verification. Domain specifier tag: BLS_SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_POP_
sourcepub fn bls12381_v1_aggregate_verify(
pub_keys_and_msgs: Vec<(Bls12381G1PublicKey, Vec<u8>)>,
signature: Bls12381G2Signature
) -> bool
pub fn bls12381_v1_aggregate_verify( pub_keys_and_msgs: Vec<(Bls12381G1PublicKey, Vec<u8>)>, signature: Bls12381G2Signature ) -> bool
Performs BLS12-381 G2 aggregated signature verification of multiple messages each signed with different key. Domain specifier tag: BLS_SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_POP_
sourcepub fn bls12381_v1_fast_aggregate_verify(
message: Vec<u8>,
public_keys: Vec<Bls12381G1PublicKey>,
signature: Bls12381G2Signature
) -> bool
pub fn bls12381_v1_fast_aggregate_verify( message: Vec<u8>, public_keys: Vec<Bls12381G1PublicKey>, signature: Bls12381G2Signature ) -> bool
Performs BLS12-381 G2 aggregated signature verification one message signed with multiple keys. Domain specifier tag: BLS_SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_POP_
sourcepub fn bls12381_g2_signature_aggregate(
signatures: Vec<Bls12381G2Signature>
) -> Bls12381G2Signature
pub fn bls12381_g2_signature_aggregate( signatures: Vec<Bls12381G2Signature> ) -> Bls12381G2Signature
Aggregate multiple BLS12-381 G2 signatures into single one
sourcepub fn keccak256_hash(data: Vec<u8>) -> Hash
pub fn keccak256_hash(data: Vec<u8>) -> Hash
Calculates Keccak-256 digest over given vector of bytes
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for CryptoUtils
impl Send for CryptoUtils
impl Sync for CryptoUtils
impl Unpin for CryptoUtils
impl UnwindSafe for CryptoUtils
Blanket Implementations§
§impl<U> As for U
impl<U> As for U
§fn as_<T>(self) -> Twhere
T: CastFrom<U>,
fn as_<T>(self) -> Twhere
T: CastFrom<U>,
Casts
self
to type T
. The semantics of numeric casting with the as
operator are followed, so <T as As>::as_::<U>
can be used in the same way as T as U
for numeric conversions. Read moresource§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