Enum Crypto
Source pub enum Crypto {
Sha256,
VerifyEd25519,
RecoverSecp256k1,
}
Expand description
Operations providing cryptographic functionality.
0x50
: SHA2
Produce a SHA 256 hash from the specified data.
Hashes are byte aligned so length is number of bytes not number of words.
[data, data_len]
§Stack Output
[hash_w0, hash_w1, hash_w2, hash_w3]
§Panics
- data_len * 8 is longer than the data.
0x51
: VRFYED
Validate an Ed25519 signature against a public key.
Data is byte aligned so length is number of bytes not number of words.
[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]
0x52
: RSECP
Recover the public key from a secp256k1 signature.
If the signature is invalid, the operation will return all zeros.
[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]
Performs copy-assignment from
source
.
Read more
Formats the value using the given formatter.
Read more
Converts to this type from the input type.
Compares and returns the maximum of two values.
Read more
Compares and returns the minimum of two values.
Read more
Restrict a value to a certain interval.
Read more
Tests for self
and other
values to be equal, and is used by ==
.
Tests for !=
. The default implementation is almost always sufficient,
and should not be overridden without very good reason.
This method returns an ordering between
self
and
other
values if one exists.
Read more
Tests less than (for
self
and
other
) and is used by the
<
operator.
Read more
Tests less than or equal to (for
self
and
other
) and is used by the
<=
operator.
Read more
Tests greater than (for
self
and
other
) and is used by the
>
operator.
Read more
Tests greater than or equal to (for
self
and
other
) and is used by
the
>=
operator.
Read more
The iterator yielding bytes.
Convert the operation to its serialized form in bytes.
The associated Opcode
type.
The opcode
associated with this operation.
Represents any error that might occur while parsing an op from bytes.
Parse a single operation from the given iterator yielding bytes.
Read more
Immutably borrows from an owned value.
Read more
Mutably borrows from an owned value.
Read more
🔬This is a nightly-only experimental API. (clone_to_uninit
)
Performs copy-assignment from
self
to
dst
.
Read more
Returns the argument unchanged.
Calls U::from(self)
.
That is, this conversion is whatever the implementation of
From<T> for U
chooses to do.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning.
Read more
Uses borrowed data to replace owned data, usually by cloning.
Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.