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 From<Crypto> for Constraint
impl From<Crypto> for Constraint
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
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)