Enum essential_constraint_vm::asm::Crypto
source · pub enum Crypto {
Sha256,
VerifyEd25519,
RecoverSecp256k1,
}
Expand description
Operations providing cryptographic functionality.
Variants§
Sha256
0x50
Produce a SHA 256 hash from the specified data.
§Stack Input
[data, data_len]
§Stack Output
[hash_w0, hash_w1, hash_w2, hash_w3]
VerifyEd25519
0x51
Validate an Ed25519 signature against a public key.
§Stack Input
[data, data_len, sig_w0, sig_w1, sig_w2, sig_w3, sig_w4, sig_w5, sig_w6, sig_w7, key_w0, key_w1, key_w2, key_w3]
§Stack Output
[bool]
RecoverSecp256k1
0x52
Recover the public key from a secp256k1 signature.
If the signature is invalid, the operation will return all zeros.
§Stack Input
[hash_0, hash_1, hash_2, hash_3, sig_w0, sig_w1, sig_w2, sig_w3, sig_w4, sig_w5, sig_w6, sig_w7, sig_8]
§Stack Output
[pub_key_w0, pub_key_w1, pub_key_w2, pub_key_w3, pub_key_4]
Trait Implementations§
source§impl From<Crypto> for Constraint
impl From<Crypto> for Constraint
source§fn from(subgroup: Crypto) -> Constraint
fn from(subgroup: Crypto) -> Constraint
Converts to this type from the input type.
source§impl Ord for Crypto
impl Ord for Crypto
source§impl PartialEq for Crypto
impl PartialEq for Crypto
source§impl PartialOrd for Crypto
impl PartialOrd for Crypto
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl TryFromBytes for Crypto
impl TryFromBytes for Crypto
§type Error = FromBytesError
type Error = FromBytesError
Represents any error that might occur while parsing an op from bytes.
impl Copy for Crypto
impl Eq for Crypto
impl StructuralPartialEq for Crypto
Auto Trait Implementations§
impl Freeze for Crypto
impl RefUnwindSafe for Crypto
impl Send for Crypto
impl Sync for Crypto
impl Unpin for Crypto
impl UnwindSafe for Crypto
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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 more