pub enum Crypto {
Sha256,
VerifyEd25519,
RecoverSecp256k1,
}
Expand description
Operations providing cryptographic functionality.
Variants§
Sha256
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.
§Stack Input
[data, data_len]
§Stack Output
[hash_w0, hash_w1, hash_w2, hash_w3]
§Panics
- data_len * 8 is longer than the data.
VerifyEd25519
0x51
: VRFYED
Validate an Ed25519 signature against a public key.
Data is byte aligned so length is number of bytes not number of words.
§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
: RSECP
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 Ord for Crypto
impl Ord for Crypto
Source§impl PartialOrd for Crypto
impl PartialOrd for Crypto
Source§impl TryFromBytes for Crypto
impl TryFromBytes for Crypto
Source§type Error = FromBytesError
type Error = FromBytesError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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